diff --git a/src/main/java/tconstruct/util/IMCHandler.java b/src/main/java/tconstruct/util/IMCHandler.java index feaf30cc..221855dd 100644 --- a/src/main/java/tconstruct/util/IMCHandler.java +++ b/src/main/java/tconstruct/util/IMCHandler.java @@ -202,12 +202,17 @@ public final class IMCHandler { NBTTagCompound tag = message.getNBTValue(); - if (!checkRequiredTags("Material Item", tag, "MaterialId", "Value", "id", "Count", "Damage")) + if (!checkRequiredTags("Material Item", tag, "MaterialId", "Value", "Item")) continue; int id = tag.getInteger("MaterialId"); int value = tag.getInteger("Value"); - ItemStack stack = ItemStack.loadItemStackFromNBT(tag); + ItemStack stack = ItemStack.loadItemStackFromNBT(tag.getCompoundTag("Item")); + + if(stack == null) { + TConstruct.logger.error("Material Item IMC: Item for Material %d is null", id); + continue; + } if(TConstructRegistry.getMaterial(id) == null) { TConstruct.logger.error("Material Item IMC: Material with ID %d does not exist", id);