mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Simplify vanilla scoreboard nickname coloring patch
Closes GH-195
This commit is contained in:
parent
85a924b7dd
commit
d6b1996ab3
1 changed files with 6 additions and 16 deletions
|
@ -27,25 +27,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
}
|
||||
|
||||
- s = String.format(event.getFormat(), event.getPlayer().getDisplayName(), event.getMessage());
|
||||
- minecraftServer.console.sendMessage(s);
|
||||
+ // Paper start - (Meh) Support for vanilla world scoreboard name coloring
|
||||
+ //s = String.format(event.getFormat(), event.getPlayer().getDisplayName(), event.getMessage());
|
||||
+ IChatBaseComponent baseComponent = new ChatMessage(String.format(event.getFormat(), event.getPlayer().getDisplayName(), event.getMessage()));
|
||||
+ // Paper Start - (Meh) Support for vanilla world scoreboard name coloring
|
||||
+ String displayName = event.getPlayer().getDisplayName();
|
||||
+ if (this.player.getWorld().paperConfig.useVanillaScoreboardColoring) {
|
||||
+ baseComponent = new ChatMessage(event.getFormat(), ScoreboardTeam.getPlayerDisplayName(this.player.aO(), player.getDisplayName()), event.getMessage());
|
||||
+ displayName = ScoreboardTeam.getPlayerDisplayName(this.player.aO(), player.getDisplayName());
|
||||
+ }
|
||||
+
|
||||
+ s = String.format(event.getFormat(), displayName, event.getMessage());
|
||||
+ // Paper end
|
||||
+ minecraftServer.console.sendMessage(baseComponent.toPlainText());
|
||||
minecraftServer.console.sendMessage(s);
|
||||
if (((LazyPlayerSet) event.getRecipients()).isLazy()) {
|
||||
for (Object recipient : minecraftServer.getPlayerList().players) {
|
||||
- ((EntityPlayer) recipient).sendMessage(CraftChatMessage.fromString(s));
|
||||
+ ((EntityPlayer) recipient).sendMessage(baseComponent); // Paper - (Meh) Support for vanilla world scoreboard name coloring
|
||||
}
|
||||
} else {
|
||||
for (Player recipient : event.getRecipients()) {
|
||||
- recipient.sendMessage(s);
|
||||
+ ((CraftPlayer) recipient).getHandle().sendMessage(baseComponent); // Paper - (Meh) Support for vanilla world scoreboard name coloring
|
||||
}
|
||||
}
|
||||
}
|
||||
--
|
Loading…
Reference in a new issue