diff options
| author | bspkrs <bspkrs@gmail.com> | 2013-12-16 15:28:12 -0500 |
|---|---|---|
| committer | bspkrs <bspkrs@gmail.com> | 2013-12-16 15:28:12 -0500 |
| commit | 39b407adba0d389ed4e911af477c86a112d94c78 (patch) | |
| tree | 78f2197d8ccc86e127498581bb21da5542837faf /common/darkknight/jewelrycraft/block/BlockMolder.java | |
| parent | 80ec62513742ba5515fc0ba3f6ab2f3429176a8b (diff) | |
fixed a few NPEs
Diffstat (limited to 'common/darkknight/jewelrycraft/block/BlockMolder.java')
| -rw-r--r-- | common/darkknight/jewelrycraft/block/BlockMolder.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/common/darkknight/jewelrycraft/block/BlockMolder.java b/common/darkknight/jewelrycraft/block/BlockMolder.java index 795a689..ac10ca4 100644 --- a/common/darkknight/jewelrycraft/block/BlockMolder.java +++ b/common/darkknight/jewelrycraft/block/BlockMolder.java @@ -47,10 +47,10 @@ public class BlockMolder extends BlockContainer ItemStack item = entityPlayer.inventory.getCurrentItem(); if (te != null && item != null && !te.hasMold && item.itemID == ItemList.molds.itemID) { - entityPlayer.addChatMessage(StatCollector.translateToLocalFormatted("chatmessage.jewelrycraft.molder.addedmold", te.mold.getDisplayName())); te.mold = item; te.hasMold = true; --item.stackSize; + entityPlayer.addChatMessage(StatCollector.translateToLocalFormatted("chatmessage.jewelrycraft.molder.addedmold", te.mold.getDisplayName())); } if (te.hasMold && entityPlayer.isSneaking()) { @@ -125,7 +125,7 @@ public class BlockMolder extends BlockContainer public void onBlockClicked(World world, int i, int j, int k, EntityPlayer player) { TileEntityMolder me = (TileEntityMolder) world.getBlockTileEntity(i, j, k); - if (me != null) + if (me != null && !world.isRemote) { if (me.hasJewelBase) { @@ -135,9 +135,9 @@ public class BlockMolder extends BlockContainer } else if (me.hasMoltenMetal && me.cooling > 0) player.addChatMessage(StatCollector.translateToLocal("chatmessage.jewelrycraft.molder.metaliscooling")); - else if (me.hasMold && !me.hasMoltenMetal) + else if (me.mold.itemID == ItemList.molds.itemID && !me.hasMoltenMetal) player.addChatMessage(StatCollector.translateToLocal("chatmessage.jewelrycraft.molder.moldisempty")); - else if (!me.hasMold) + else if (me.mold.itemID != ItemList.molds.itemID) player.addChatMessage(StatCollector.translateToLocal("chatmessage.jewelrycraft.molder.moldismissing")); } } |
