mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
Fix click event when vanilla scoreboard name coloring is enabled (#6652)
This commit is contained in:
parent
1264c08ef8
commit
4ee912fbfd
1 changed files with 2 additions and 8 deletions
|
@ -46,20 +46,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
|
|
||||||
private static String legacyDisplayName(final CraftPlayer player) {
|
private static String legacyDisplayName(final CraftPlayer player) {
|
||||||
+ if (((CraftWorld) player.getWorld()).getHandle().paperConfig.useVanillaScoreboardColoring) {
|
+ if (((CraftWorld) player.getWorld()).getHandle().paperConfig.useVanillaScoreboardColoring) {
|
||||||
+ final ServerPlayer ep = player.getHandle();
|
+ return PaperAdventure.LEGACY_SECTION_UXRC.serialize(player.teamDisplayName()) + ChatColor.RESET;
|
||||||
+ net.minecraft.network.chat.Component name = ep.getName();
|
|
||||||
+ final Team team = ep.getTeam();
|
|
||||||
+ if (team != null) {
|
|
||||||
+ name = team.getFormattedName(name);
|
|
||||||
+ }
|
|
||||||
+ return PaperAdventure.LEGACY_SECTION_UXRC.serialize(PaperAdventure.asAdventure(name)) + ChatColor.RESET;
|
|
||||||
+ }
|
+ }
|
||||||
return player.getDisplayName();
|
return player.getDisplayName();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Component displayName(final CraftPlayer player) {
|
private static Component displayName(final CraftPlayer player) {
|
||||||
+ if (((CraftWorld) player.getWorld()).getHandle().paperConfig.useVanillaScoreboardColoring) {
|
+ if (((CraftWorld) player.getWorld()).getHandle().paperConfig.useVanillaScoreboardColoring) {
|
||||||
+ return PaperAdventure.asAdventure(PlayerTeam.formatNameForTeam(player.getHandle().getTeam(), player.getHandle().getName()));
|
+ return player.teamDisplayName();
|
||||||
+ }
|
+ }
|
||||||
return player.displayName();
|
return player.displayName();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue