diff --git a/src/main/java/noppes/npcs/DataDisplay.java b/src/main/java/noppes/npcs/DataDisplay.java index 0bc50badd..2921958a5 100644 --- a/src/main/java/noppes/npcs/DataDisplay.java +++ b/src/main/java/noppes/npcs/DataDisplay.java @@ -126,6 +126,7 @@ public class DataDisplay { title = nbttagcompound.getString("Title"); + String prevUrl = url; url = nbttagcompound.getString("SkinUrl"); int prevSkinType = skinType; @@ -143,7 +144,6 @@ public class DataDisplay { } String prevTexture = texture; - texture = nbttagcompound.getString("Texture"); cloakTexture = nbttagcompound.getString("CloakTexture"); @@ -200,7 +200,7 @@ public class DataDisplay { else collidesWith = 1; - if(prevSkinType != skinType || !texture.equals(prevTexture)) + if(prevSkinType != skinType || !texture.equals(prevTexture)|| !url.equals(prevUrl)) npc.textureLocation = null; npc.updateHitbox(); } diff --git a/src/main/java/noppes/npcs/blocks/tiles/TileScripted.java b/src/main/java/noppes/npcs/blocks/tiles/TileScripted.java index 649675cce..b2d3bf8b4 100644 --- a/src/main/java/noppes/npcs/blocks/tiles/TileScripted.java +++ b/src/main/java/noppes/npcs/blocks/tiles/TileScripted.java @@ -133,14 +133,18 @@ public class TileScripted extends TileEntity implements IScriptBlockHandler { if(scaleZ <= 0) scaleZ = 1; - if(compound.hasKey("Text3")) { + if(compound.hasKey("Text1")) text1.setNBT(compound.getCompoundTag("Text1")); + if(compound.hasKey("Text2")) text2.setNBT(compound.getCompoundTag("Text2")); + if(compound.hasKey("Text3")) text3.setNBT(compound.getCompoundTag("Text3")); + if(compound.hasKey("Text4")) text4.setNBT(compound.getCompoundTag("Text4")); + if(compound.hasKey("Text5")) text5.setNBT(compound.getCompoundTag("Text5")); + if(compound.hasKey("Text6")) text6.setNBT(compound.getCompoundTag("Text6")); - } } @Override diff --git a/src/main/java/noppes/npcs/containers/ContainerCrate.java b/src/main/java/noppes/npcs/containers/ContainerCrate.java index 47205545f..0dab25a35 100644 --- a/src/main/java/noppes/npcs/containers/ContainerCrate.java +++ b/src/main/java/noppes/npcs/containers/ContainerCrate.java @@ -16,31 +16,34 @@ public class ContainerCrate extends Container { this.lowerChestInventory = par2IInventory; this.upperChestInventory = par1IInventory; - this.numRows = par2IInventory.getSizeInventory() / 9; - par2IInventory.openInventory(); - int i = (this.numRows - 4) * 18; - int j; - int k; + this.numRows = 0; + if(par2IInventory != null && par1IInventory != null){ + this.numRows = par2IInventory.getSizeInventory() / 9; + par2IInventory.openInventory(); + int i = (this.numRows - 4) * 18; + int j; + int k; - for (j = 0; j < this.numRows; ++j) - { - for (k = 0; k < 9; ++k) + for (j = 0; j < this.numRows; ++j) { - this.addSlotToContainer(new Slot(par2IInventory, k + j * 9, 8 + k * 18, 18 + j * 18)); + for (k = 0; k < 9; ++k) + { + this.addSlotToContainer(new Slot(par2IInventory, k + j * 9, 8 + k * 18, 18 + j * 18)); + } } - } - for (j = 0; j < 3; ++j) - { - for (k = 0; k < 9; ++k) + for (j = 0; j < 3; ++j) { - this.addSlotToContainer(new Slot(par1IInventory, k + j * 9 + 9, 8 + k * 18, 103 + j * 18 + i)); + for (k = 0; k < 9; ++k) + { + this.addSlotToContainer(new Slot(par1IInventory, k + j * 9 + 9, 8 + k * 18, 103 + j * 18 + i)); + } } - } - for (j = 0; j < 9; ++j) - { - this.addSlotToContainer(new Slot(par1IInventory, j, 8 + j * 18, 161 + i)); + for (j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(par1IInventory, j, 8 + j * 18, 161 + i)); + } } } @@ -103,4 +106,4 @@ public class ContainerCrate extends Container { return this.lowerChestInventory; } -} \ No newline at end of file +} diff --git a/src/main/java/noppes/npcs/entity/EntityNPCInterface.java b/src/main/java/noppes/npcs/entity/EntityNPCInterface.java index a47a67cca..348ca6158 100644 --- a/src/main/java/noppes/npcs/entity/EntityNPCInterface.java +++ b/src/main/java/noppes/npcs/entity/EntityNPCInterface.java @@ -288,9 +288,11 @@ public abstract class EntityNPCInterface extends EntityCreature implements IEnti if (this.worldObj instanceof WorldServer) { - NpcEvent.SwingEvent event = new NpcEvent.SwingEvent(wrappedNPC, stack); - if(EventHooks.onNPCMeleeSwing(this, event)) - return; + if(!isRemote()){ + NpcEvent.SwingEvent event = new NpcEvent.SwingEvent(wrappedNPC, stack); + if(EventHooks.onNPCMeleeSwing(this, event)) + return; + } ((WorldServer)this.worldObj).getEntityTracker().func_151247_a(this, new S0BPacketAnimation(this, 0)); } diff --git a/src/main/java/noppes/npcs/scripted/entity/ScriptNpc.java b/src/main/java/noppes/npcs/scripted/entity/ScriptNpc.java index 53dcf1a09..29f027248 100644 --- a/src/main/java/noppes/npcs/scripted/entity/ScriptNpc.java +++ b/src/main/java/noppes/npcs/scripted/entity/ScriptNpc.java @@ -1319,7 +1319,8 @@ public class ScriptNpc extends ScriptLiving imp return; this.npc.display.url = url; npc.textureLocation = null; - npc.display.skinType = 2; + if(npc.display.skinType < 2) + npc.display.skinType = 2; npc.script.clientNeedsUpdate = true; }