Hbm's Nuclear Tech Mod

Hbm's Nuclear Tech Mod

1M Downloads

Upgrading crates voids contents

abel1502 opened this issue ยท 3 comments

commented

It would be nice if upgrading steel crates to desh (and other similar recipes) kept the inventories intact. As of now, the inventory is reset silently

commented

That's a limitation of the vanilla crafting table, while there is a function to preserve NBT for vanilla recipes, it's both really crappy (simply preserving the NBT of whatever first item in the list that has NBT data) and also doesn't even exist for ShapedOreRecipe.

Fixing this would introduce a separate issue where, if an item has NBT other than the main crate, the output will seemingly randomly lose its contents, as well as giving up ore dictionary support, meaning that other mod's materials are no longer compatible in crate recipes.

commented

@HbmMods I know Iron Backpacks does this without much issue. I think the key to doing this properly is introducing a custom recipe handler class, instead of blindly preserving NBT of all items. See here:

https://github.com/gr8pefish/IronBackpacks/blob/master-1.7.10/src/main/java/main/ironbackpacks/crafting/BackpackIncreaseTierRecipe.java

https://github.com/gr8pefish/IronBackpacks/blob/master-1.7.10/src/main/java/main/ironbackpacks/crafting/ItemRecipeRegistry.java

commented

I can try and implement this myself, then make a PR, if you'd prefer it this way