Change material-item-mapping IMC to have the item in an item-subtag like the partbuilder IMC

This commit is contained in:
Bernhard Bonigl committed 2015-01-15 15:54:57 +01:00
1 parent f4d9d54d41
commit 6be78f4edb
1 file changed
+7 -2
@@ -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);