IronBackpacks
IronBackpacks copied to clipboard
Add BackpackBlock
First pass:
Added /block package, containing AbstractBlockTE, BlockBackpack, and TEBackpack Altered ContainerBackpack to have an overloaded constructor for the TE as well as the ItemStack Added (untested) IronBackpacksAPI.applyPackInfo(tile) Added (untested) BackpackInfo.fromTE(tile) Minor changes (renamed creative_tab, and renamed inventory_capability_handler)
From the chat:
Alright, so bear with me, here was my general idea:
- R-click the ItemStack (of and ItemBackpack)
- Makes a BlockBackpack of the appropriate BackpackVariant
- That block (specifically the BackpackTileEntity) has the BackpackInfo taken from the (now-deleted) ItemStack
- The TE therefore uses the IItemHandler, same serialization, etc. as the ItemStack. Easy. Life is full of rainbows and sunshine
- When the block is broken it takes the BackpackInfo from the TE to drop an ItemBackpack (with that info copied back to it) into the world.
Obviously, that was not reality. I have to:
- Add in the r-click code for item stack (actually mostly wirtten, but have to copy over from my TestMod)
- Add registration for all variants of the Block (or just the single block with the Variant as a param in the constructor)
- Initialize and access the TE data correctly (big one)
- Figure out the black magic that is ItemStack IItemHandler capabilities so I can use the same one for the TE
- Rewrite lots of the methods (that are currently hardcoded for itemstacks) so that #4 above can actually exist in reality.
- Do the custom dropping of an ItemBackpack from the TE's data.
- Copy over the models/blockstate JSONs/textures (from the TestMod)