gr8pefish / IronBackpacks

A Minecraft mod that adds portable storage in the form of tiered backpacks with modular upgrades.
GNU General Public License v3.0
60 stars 33 forks source link

Add BackpackBlock #218

Open gr8pefish opened 6 years ago

gr8pefish commented 6 years ago

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)

gr8pefish commented 6 years ago

From the chat:

Alright, so bear with me, here was my general idea:

1) R-click the ItemStack (of and ItemBackpack) 2) Makes a BlockBackpack of the appropriate BackpackVariant 3) That block (specifically the BackpackTileEntity) has the BackpackInfo taken from the (now-deleted) ItemStack 4) The TE therefore uses the IItemHandler, same serialization, etc. as the ItemStack. Easy. Life is full of rainbows and sunshine 5) 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: