Jump to content

[1.10.2] NBT Data mysteriously dissapearing


Recommended Posts

TL;DR: When switching from IEEP (It's kinda an old mod) to Capabilities, I got 90% of the way there but can't seem to get the NBT data to load properly.


So, I've been working on/maintaining a mod sporadically for a long time. It was originally made on 1.6, so it's been through a lot.


Recently, I've been trying to port it from 1.8 to 1.10. This meant dropping IEEP, and switching to capabilities. I had a bit of a hard time (entirely due to my own stupidity), but on my most recent attempt got it to work.


Kind of.


Basically, if I open up a world, do some stuff which would edit the NBT data I'm storing to the player, and exit, the data is saved all fine. I've confirmed this by looking in NBT explorer and seeing the data there. But, upon re-entering the world, it is all reset. Checking level.dat again, I see that the values are now all at their defaults. I've been faffing around for a while, trying to find examples or solutions, and I have come up dry. Can anyone else take a look and see what might be happening? Full disclosure, I'm self-taught when it comes to Java. I know this is "not Java school", I just wanted to give warning in case I've simply done something dumb.


Capability Class https://github.com/legobmw99/Allomancy/blob/exp/src/main/java/common/legobmw99/allomancy/common/AllomancyCapabilities.java


Event Handler https://github.com/legobmw99/Allomancy/blob/exp/src/main/java/common/legobmw99/allomancy/handlers/AllomancyEventHandler.java


Main Mod Class https://github.com/legobmw99/Allomancy/blob/exp/src/main/java/common/legobmw99/allomancy/Allomancy.java



Thank you very much to anyone who can help. I've been working on this mod as a passion-project for over two years and would love to get it fully functioning again.

Link to comment
Share on other sites

You've already set a breakpoint in deserializeNBT and run in the debugger, right? What happened when you stepped through that method?


If you didn't even reach that method, try again with a breakpoint set high enough in its call chain that you can see how and why the program branches around the call.

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

Link to comment
Share on other sites

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.

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.


  • Create New...

Important Information

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