-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
NBT Component Serializer #1084
base: main/4
Are you sure you want to change the base?
NBT Component Serializer #1084
Conversation
…f stuff after spigotting (looking at nms code decompiled and mapped with build tools)
The serialization works now, but i need to clean it up, add backwards compatibility (old nbt), add javadocs and deserialization. But the hardest part with understanding how everything realted to this (in both adventure and Minecraft) is done. |
Component deserialization works properly (tested with a large component with many children and styling), component serialization however doesn't serialize lists of components (children, etc.) as anything else than compounds. I'll check if there's a way to make it check if all types of components can be serialized as a string without looping through the entire list twice (one time for checks, second time for creating the list). What's left (let me know if i forgot anything):
|
Another TODO: |
…ion instead of returning null
I forgot to add tests for hover event and click event, i'm adding them right now |
Ok, it's ready now, i think |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please review what the game actually does, you've dragged over so much legacy baggage that'd be completely unnecessary if you actually thought things through
...rializer-nbt/src/main/java/net/kyori/adventure/text/serializer/nbt/NBTSerializerOptions.java
Show resolved
Hide resolved
...alizer-nbt/src/main/java/net/kyori/adventure/text/serializer/nbt/NBTComponentSerializer.java
Outdated
Show resolved
Hide resolved
...rializer-nbt/src/main/java/net/kyori/adventure/text/serializer/nbt/ClickEventSerializer.java
Outdated
Show resolved
Hide resolved
...rializer-nbt/src/main/java/net/kyori/adventure/text/serializer/nbt/HoverEventSerializer.java
Outdated
Show resolved
Hide resolved
I've added a possibility to (de)-serialize a style without a component, because it's useful for new chat type registry in Minecraft. For example Minestom uses adventure styles to (de)-serialize the chat type styles. |
text-serializer-nbt/src/main/java/net/kyori/adventure/text/serializer/nbt/StyleSerializer.java
Outdated
Show resolved
Hide resolved
After ~ 3 months i can say that it's stable. I've not noticed any issues with the serializer. I was using it in my server software - Jet - for that time. I tested all functionality, including item data components etc. |
Adds a support for serializing components as NBT Binary Tags.
Resolves #995