Skip to content

Fix team colors being erased if re-encoding WrapperPlayServerTeams on 1.8-1.12#1519

Open
LeonTG wants to merge 1 commit into
retrooper:2.0from
LeonTG:fix/team-colors-1.8
Open

Fix team colors being erased if re-encoding WrapperPlayServerTeams on 1.8-1.12#1519
LeonTG wants to merge 1 commit into
retrooper:2.0from
LeonTG:fix/team-colors-1.8

Conversation

@LeonTG
Copy link
Copy Markdown
Contributor

@LeonTG LeonTG commented May 17, 2026

Closes #1517

@booky10
Copy link
Copy Markdown
Collaborator

booky10 commented May 18, 2026

The adventure-patch modules will be removed eventually because we will replace our adventure handling with a more robust solution - though I don't know if there is a another good way to fix this, other than writing our own legacy component serializer

@LeonTG
Copy link
Copy Markdown
Contributor Author

LeonTG commented May 18, 2026

I did try this too when testing it:

image

adding text there when serializing it and then removing the text after its been turned into text

but I found it kinda hacky solution

@booky10
Copy link
Copy Markdown
Collaborator

booky10 commented May 18, 2026

We could also just passthrough plain text instead of using legacy component serialization at all

@LeonTG
Copy link
Copy Markdown
Contributor Author

LeonTG commented May 18, 2026

You mean store it as string instead of component? wont that mess with 1.13+?

@booky10
Copy link
Copy Markdown
Collaborator

booky10 commented May 18, 2026

I meant using a String for versions the protocol uses legacy strings and using a Component for versions the protocol uses components

@TheFaser
Copy link
Copy Markdown
Contributor

adding text there when serializing it and then removing the text after its been turned into text

I have this problem too, and it's exactly MiniMessage issue (all serializers). And btw, I also solved this problem, just like you, by adding a space and deleting it at the end

@TheFaser
Copy link
Copy Markdown
Contributor

MiniMessage adds a closing tag if there is no text after it, I think this is their usual behavior and they don't want to fix it

@LeonTG
Copy link
Copy Markdown
Contributor Author

LeonTG commented May 18, 2026

I meant using a String for versions the protocol uses legacy strings and using a Component for versions the protocol uses components

Maybe you guys should do that then cuz ngl I'm not entirely sure how you'd want me to structure that change with setting up 2 variables and how the setters/getters would then work

Depending on how long your solution will take tho, maybe this should be the solution in the meantime so this doesn't go unresolved for too long?

@RaynLegends
Copy link
Copy Markdown
Contributor

Adding my two cents since I've had this problem too.

This issue is caused by a bug in the legacy serializer (note that the other serializers do not have this behaviour, just the legacy one...) that could be fixed in Adventure upstream (PaperMC/adventure#1312).

I think the best way other than getting that bug fixed (which is likely not happening) is a passthrough as suggested by booky10.

@TheFaser
Copy link
Copy Markdown
Contributor

This issue is caused by a bug in the legacy serializer (note that the other serializers do not have this behaviour, just the legacy one...) that could be fixed in Adventure upstream

no, I have this issue in default MiniMessage serializer, and it's not solved by updating

@RaynLegends
Copy link
Copy Markdown
Contributor

no, I have this issue in default MiniMessage serializer, and it's not solved by updating

Very weird, since the MiniMessage serializer does not strip trailing colors...

You can easily test this by trying:

MiniMessage miniMessage = MiniMessage.miniMessage();

Component exampleComponent = text("").color(NamedTextColor.GOLD);
IO.println(miniMessage.serialize(exampleComponent));

String exampleString = "<yellow>";
IO.println(miniMessage.deserialize(exampleString));

Which produces the following:

image

Maybe this is a bit off topic though, happy to discuss on discord if you want (@raynlegends)

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.

Team colors get removed if re-encoding a WrapperPlayServerTeams

4 participants