Jump to content

Recommended Posts

Posted

Hello, I have a problem with loading Items from NBT. I have worked with and loaded NBT data before because it is fairly easy to use, but I have a special case. I don't think that my NBT Loading Code is wrong, but I'll post it anyway. So basically I have a special Inventory that is Individualized for each Player like the crafting table. Essentially I made a bank that has around 4212 slots, and no that number is not a random number. I use a tab system and a scroll bar to navigate and I have a special slot numbering system. I am telling you this because if you look through the code you might be confused. So basically i have all of the slot in the Inv get loaded into an Extended Properties Class Linked to the player. From there, when the player logs out, I save the ItemStacks to the players Extended NBT.(I think that this part works fine too) When I go to load this NBT data when the player logs in, I get a message saying that says, "Successfully Loaded ItemStack: Blah  to Slot #: Blah", because i have a println in my code. This told me that it is at least saving and loading correctly, but when I set the Item Stacks to the slots, The inv is completely empty and when I log off It says that is saved the Item that I put in the Inventory originally. My thoughts are that I may need to sync, the server and the client, but how would I do that easily? Is there a method that can sync Invs easily or will I need to send a packet with a bunch of little info such as ItemID, StackSize, MetaData, ect.

 

I will only post my Extended Properties Class for now because that is where everything is basically happering.

Also sorry that my code might be messy, I have been try ideas to solve this problem and frankly I have been too lazy to clean it up.

 

 

  Reveal hidden contents

 

Don't be afraid to ask question when modding, there are no stupid question! Unless you don't know java then all your questions are stupid!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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