Fix tools without NBT crashing the game in inventories

This commit is contained in:
Bernhard Bonigl committed 2014-09-26 14:58:23 +02:00
1 parent 47ee4f4825
commit e98ffa46f7
1 file changed
+3
@@ -759,6 +759,9 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IMo
/* Proper stack damage */
@Override
public boolean showDurabilityBar(ItemStack stack) {
if(!stack.hasTagCompound())
return false;
NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
return !tags.getBoolean("Broken") && getDamage(stack) > 0;
}