Skip to content

Commit

Permalink
Change material-item-mapping IMC to have the item in an item-subtag l…
Browse files Browse the repository at this point in the history
…ike the partbuilder IMC
  • Loading branch information
bonii-xx committed Jan 15, 2015
1 parent f4d9d54 commit 6be78f4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/java/tconstruct/util/IMCHandler.java
Expand Up @@ -202,12 +202,17 @@ else if(type.equals("addMaterialItem")) {

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);
Expand Down

0 comments on commit 6be78f4

Please sign in to comment.