Prevent crash that sometimes happens when placing a tool/part/stencil whatever station block.

This commit is contained in:
Bernhard Bonigl committed 2014-10-01 21:13:27 +02:00
1 parent 968cba4f18
commit d7b560c0ff
1 file changed
+3 -2
@@ -266,9 +266,10 @@ public class ToolStationBlock extends InventoryBlock
if (stack.hasTagCompound())
{
NBTTagCompound inventory = stack.getTagCompound().getCompoundTag("Inventory");
if (inventory != null)
TileEntity te = world.getTileEntity(x, y, z);
if (inventory != null && te instanceof PatternChestLogic)
{
PatternChestLogic logic = (PatternChestLogic) world.getTileEntity(x, y, z);
PatternChestLogic logic = (PatternChestLogic) te;
logic.readInventoryFromNBT(inventory);
logic.xCoord = x;
logic.yCoord = y;