-
Notifications
You must be signed in to change notification settings - Fork 2
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
Support Java protocol version 764+ with nameless tags #36
Comments
Oh fun! 🙃 😆 Thanks for the heads up! I think you're right with adding a And I agree with your configuration option downside, since it really is its own format in the way it's encoded differently. I should have time in the coming days to thoroughly think this through (and reply to your other comments) :) |
There are also two other ideas that I think are worth considering: Separate named root tags from nameless root tagsThe idea here is to clearly delineate the differences between named and nameless root tags. One way this could be implemented, is by encoding/decoding types as nameless by default, and by adding a special type with a custom serializer to indicate a named tag:
There are several benefits in structuring things in this way, some of which are:
Remove root tag names from the API and make them implementation-specificThe idea is essentially to remove from the API ability of defining custom root tag names in the first place, and making it so a hard-coded value (the usual empty string) is always written when necessary, and ignored when read. This may seem a bit extreme/controversial as it would break the "NBT specification", but there are also arguments in support of it:
|
Sorry for the late reply, it's been a hectic few weeks but My schedule's freeing up so I should have more time. I like a lot of the ideas from your first option though, thanks for taking the time to flesh all that out so clearly :) I went ahead implementing a JavaNetwork variant, treating all tags as unnamed tags similar to how And to avoid any confusion with the format change, it takes in a I'll probably give Let me know what you think of that, and if you don't have any additional feedback, I can go ahead and merge that in! |
As for changing the API for named/unnamed/etc. in general, feel free to open up a separate issue about that. For now I'm going to focus up my efforts on pushing out the long-in-development v0.12 release (which has been slow because it's been hard to find free time, but I'm newly laid off and have a lot more bandwidth now 🥲). I can tell you that your mind's exactly where mine was when I first started when I was first designing the library, and I can share why I went the route I did if you open that new issue. |
Sorry for the late reply as well. It works just perfectly for my use case. |
I've looked at the JavaNetwork variant implementation and I think the user should be able to specify whether empty or unnamed tags should be used without the protocol version abstraction. For example, if you had a boolean |
As of 23w31a, NBT tags sent over the network no longer encode the usual "empty tag name", and instead only the tag type id and payload. A comparison can be seen here.
A configuration option to not encode the root tag's name should be included in the library, but I'm unsure what would be the best approach. Here are some ideas and arguments in favor/against:
NbtVariant
(such asNbtVariant.JavaNetwork
). This would make sense since the change only affects tags sent over the network, while the ones saved to the disk remain the same. However, it could cause confusion since this changes only affects 23w31a and beyond, while prior versions remain unaffected.encodeRootTagName = true
). This would eliminate the necessity for a NbtVariant that would be version dependent. However, this option wouldn't make sense for other NbtVariants aside from Java.The text was updated successfully, but these errors were encountered: