Skip to content

Fix #5720: color from /nick transfers into balance on /baltop#5728

Closed
TiagoFar78 wants to merge 1 commit intoEssentialsX:2.xfrom
TiagoFar78:2.x
Closed

Fix #5720: color from /nick transfers into balance on /baltop#5728
TiagoFar78 wants to merge 1 commit intoEssentialsX:2.xfrom
TiagoFar78:2.x

Conversation

@TiagoFar78
Copy link
Contributor

@TiagoFar78 TiagoFar78 commented Mar 5, 2024

Information

This PR fixes #5720 .

Details

Proposed fix:

My fix consists in storing the name of the player with a color reseting string at the end. By doing this everytime a /balancetop command is executed the colors in the player name don't spread to the following part of the line.

Environments tested:

OS: Windows 11

Java version: 17.0.9

  • Most recent Paper version (1.20.4, git-Paper-BUILD)
  • CraftBukkit/Spigot/Paper 1.12.2
  • CraftBukkit 1.8.8

Demonstration:

Before:
When the command /balancetop was executed the colors from the name of a player would spread to the money amount text, as the following screenshot shows.

image

After:
I fixed this bug by storing the player's name with a color format reseting string at the end. By doing this I was able to avoid the bug. Other way to solve this would be by adding the color format reseting string after getting the entries from the BalanceTop but it would not solve the case where the entries are used to other things different from showing the balance top to a player.

image

@pop4959
Copy link
Member

pop4959 commented Mar 11, 2024

This fix technically works, but there are a hundred other instances of legacy converted placeholders bleeding into translations - this general case will be addressed by #5740 which by extension closes this PR as well.

@JRoy JRoy closed this in #5740 Mar 11, 2024
@JRoy JRoy closed this in 2cb0af0 Mar 11, 2024
HarvelsX pushed a commit to HarvelsX/Essentials that referenced this pull request Jun 2, 2024
This fixes issues where arguments converted implicitly from MiniMessage
are prone to bleeding into the rest of the output.

The fix mostly works since `MINI_MESSAGE_NO_TAGS` is only used for
legacy conversion, while `miniMessageInstance` is used in all other
cases normally. If that were not the case, we would not want strict
parsing everywhere since we don't enforce this in translations anyway.

Fixes EssentialsX#5729
Fixes EssentialsX#5730
Fixes EssentialsX#5732
Fixes EssentialsX#5735

Fixes EssentialsX#5720
Closes EssentialsX#5728
Starmism pushed a commit to valence-smp/Essentials that referenced this pull request Jan 8, 2025
This fixes issues where arguments converted implicitly from MiniMessage
are prone to bleeding into the rest of the output.

The fix mostly works since `MINI_MESSAGE_NO_TAGS` is only used for
legacy conversion, while `miniMessageInstance` is used in all other
cases normally. If that were not the case, we would not want strict
parsing everywhere since we don't enforce this in translations anyway.

Fixes EssentialsX#5729
Fixes EssentialsX#5730
Fixes EssentialsX#5732
Fixes EssentialsX#5735

Fixes EssentialsX#5720
Closes EssentialsX#5728
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.

color from /nick transfers into balance on /baltop

2 participants