Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ported annotation-based NBT handling #34

Open
wants to merge 1 commit into
base: 1.8.9
Choose a base branch
from

Conversation

HenryLoenwind
Copy link
Member

This is what I've been using in Ender IO Addon for ages. No changes other than Java 1.6 and Minecraft 1.8.9 compatibility and a different package name.

The changes to the TileEntity are a bit different because we don't need compatibility with an existing Ender IO class hierarchy. It may need some changes once we port over classes that actually use it.

In a nutshell: There are no callbacks for world saving/loading and description packet handling anymore. Instead fields that should be saved are annotated (see EIOA for examples). There are two tool methods to read/write data from/to an item's NBT. A subclass that wants to do that, needs to call them.

@CrazyPants
Copy link
Member

one quick question, is ti still easy to add special NBT handling code? The situation I am thinking of is migrating a change in TEs. In the past when I have changed a field, added new ones etc, I have added code that would read the old tags and transform them into the new object.

@HenryLoenwind
Copy link
Member Author

yes, it is. For one, that "final" on those methods doesn't mean we cannot add a new "handleMigrateNbt()" call to the read methods (I put the final there to help us not miss a method when migrating), and on the other hand we can easily add handlers for specific TEs.

And in general, do we really expect people to migrate their modded 1.7.10 worlds to 1.8.9?

@kylev
Copy link

kylev commented Aug 14, 2016

Is this still viable in 1.10.2?

@HenryLoenwind
Copy link
Member Author

This has been put into Ender IO during porting to 1.8.9 and is in use there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants