From 6e4188fe62a8e3ace416fde588e5e97e19cdc69d Mon Sep 17 00:00:00 2001 From: alexbegt Date: Mon, 30 May 2016 13:43:45 -0400 Subject: [PATCH] This should fix #69, I couldn't recreate the crash so it needs to be tested. --- .../java/cpw/mods/ironchest/TileEntityIronChest.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java index e766cc6..7cd7733 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java @@ -85,7 +85,16 @@ public class TileEntityIronChest extends TileEntityLockable implements ITickable public IronChestType getType() { - return this.hasWorldObj() ? this.worldObj.getBlockState(this.pos).getValue(BlockIronChest.VARIANT_PROP) : IronChestType.WOOD; + IronChestType type = IronChestType.WOOD; + if (this.hasWorldObj()) + { + IBlockState state = this.worldObj.getBlockState(this.pos); + if (state.getBlock() == IronChest.ironChestBlock) + { + type = state.getValue(BlockIronChest.VARIANT_PROP); + } + } + return type; } @Override