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
Improved ComponentSerializer #3463
base: master
Are you sure you want to change the base?
Conversation
- Fixed ComponentSerializer#toString methods - Code enhanced Now the ComponentSerializer#toString follows the default Minecraft's component json format. Multiples BaseComponents will be now serialized as a json array
Formatting... |
What does this exactly means? |
Look at the diff and build errors please |
Hahah i'm sorry, first time using this. This new commit should fix the tests now. |
I need to do something more? It says the merging is blocked |
Its only about commit signing - md-5 will resolve that by signing the commit himself, nothing you need to do |
chat/src/main/java/net/md_5/bungee/chat/ComponentSerializer.java
Outdated
Show resolved
Hide resolved
- Improved component serializer. Thanks to @MrIvanPlays (SpigotMC#3463 (comment)).
Where do you get the default as this? Won't this break anyone (incorrectly) relying on just accessing [0]? Re #3490 |
What you mean exactly? |
Why do we want arrays? |
I don't think we do want arrays, but I think this PR is necessary for the sake of consistency between
Yes. Including Spigot. Though I will be moving away from this. |
If you mean about this:
I think it's better than the extras. It's a bit buggy, with the arrays we can easily edit the base components using the Gson parser, we will not need to access the extras, and the extras of the extras. I heavily recommend using this new way. |
if ( object instanceof BaseComponent ) | ||
{ | ||
return toString( (BaseComponent) object ); |
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.
redundant
Now the ComponentSerializer#toString follows the default Minecraft's component json format. Multiples BaseComponents will be now serialized as a json array.