Skip to content

Commit

Permalink
Fix patternchest -> slab not keeping the inventory #1172
Browse files Browse the repository at this point in the history
  • Loading branch information
bonii-xx committed Nov 16, 2014
1 parent df64bc8 commit 2d6c7f7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/main/java/tconstruct/tools/TinkerToolEvents.java
Expand Up @@ -44,6 +44,22 @@ public void onCrafting (ItemCraftedEvent event)
AbilityHelper.spawnItemAtPlayer(event.player, new ItemStack(TinkerTools.manualBook, 1, 1));
}
}

// slab pattern chest
if(item == Item.getItemFromBlock(TinkerTools.craftingSlabWood) && event.crafting.getItemDamage() == 4) {
// copy over NBT
for(int i = 0; i < event.craftMatrix.getSizeInventory(); i++) {
ItemStack stack = event.craftMatrix.getStackInSlot(i);
if(stack == null)
continue;
// regular pattern chest
if(stack.getItem() == Item.getItemFromBlock(TinkerTools.toolStationWood) && stack.getItemDamage() == 5)
{
event.crafting.setTagCompound(stack.getTagCompound());
break;
}
}
}
}
}

Expand Down

0 comments on commit 2d6c7f7

Please sign in to comment.