From 4ee912fbfd1419db8c842956bfbc4fae90dc0dcf Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Thu, 30 Sep 2021 13:33:19 -0500 Subject: [PATCH] Fix click event when vanilla scoreboard name coloring is enabled (#6652) --- ...to-use-vanilla-per-world-scoreboard-coloring-.patch | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/patches/server/Option-to-use-vanilla-per-world-scoreboard-coloring-.patch b/patches/server/Option-to-use-vanilla-per-world-scoreboard-coloring-.patch index b901efd33f..0306e39437 100644 --- a/patches/server/Option-to-use-vanilla-per-world-scoreboard-coloring-.patch +++ b/patches/server/Option-to-use-vanilla-per-world-scoreboard-coloring-.patch @@ -46,20 +46,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 private static String legacyDisplayName(final CraftPlayer player) { + if (((CraftWorld) player.getWorld()).getHandle().paperConfig.useVanillaScoreboardColoring) { -+ final ServerPlayer ep = player.getHandle(); -+ 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 PaperAdventure.LEGACY_SECTION_UXRC.serialize(player.teamDisplayName()) + ChatColor.RESET; + } return player.getDisplayName(); } private static Component displayName(final CraftPlayer player) { + if (((CraftWorld) player.getWorld()).getHandle().paperConfig.useVanillaScoreboardColoring) { -+ return PaperAdventure.asAdventure(PlayerTeam.formatNameForTeam(player.getHandle().getTeam(), player.getHandle().getName())); ++ return player.teamDisplayName(); + } return player.displayName(); }