Jump to content

tylermmorton

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by tylermmorton

  1. Thanks. I'll have a look at them. They seem a lot more flexible than IInventory. Is there an example implementation of the Forge wiki?
  2. Hi, I'm programming an item that has it's own inventory inside, and I'm using NBT to store the itemstacks of the inventory. The problem is, every time I open the inventory of the item it resets my NBT tags to a new compound. Here is the code. http://pastebin.com/9BjeE9D6 (edit - the param "backpack" is actually "stack" in the code.) Every time I create a new isntance of ItemInventory using the exact same ItemStack, it always ends up not having a tag compound, and ends up generating a new one. (I know this because of the sysouts that get called when I add a test tag) My only guess as to why the NBT data isn't saving is because Java's pass-by-value system, where the ItemStack I'm passing into this constructor never gets changed where it actually resides in memory, and in turn the data is not getting saved. If anyone has an insight on this, that would be awesome thanks!
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.