diff --git a/src/main/java/tconstruct/tools/blocks/ToolStationBlock.java b/src/main/java/tconstruct/tools/blocks/ToolStationBlock.java index 59b63fa6..d30498b6 100644 --- a/src/main/java/tconstruct/tools/blocks/ToolStationBlock.java +++ b/src/main/java/tconstruct/tools/blocks/ToolStationBlock.java @@ -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;