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(); }