mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-03 23:07:40 +01:00
Add basic support for using vanilla style, world-based, scoreboard name coloring
Closes GH-188
This commit is contained in:
parent
d79fcf72fa
commit
b9f596b8d2
@ -0,0 +1,51 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Zach Brown <1254957+zachbr@users.noreply.github.com>
|
||||
Date: Wed, 6 Apr 2016 01:04:23 -0500
|
||||
Subject: [PATCH] Option to use vanilla per-world scoreboard coloring on names
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||
keepLoadedRange = (short) (getInt("keep-spawn-loaded-range", Math.min(spigotConfig.viewDistance, 8)) * 16);
|
||||
log( "Keep Spawn Loaded Range: " + (keepLoadedRange/16));
|
||||
}
|
||||
+
|
||||
+ public boolean useVanillaScoreboardColoring;
|
||||
+ private void useVanillaScoreboardColoring() {
|
||||
+ useVanillaScoreboardColoring = getBoolean("use-vanilla-world-scoreboard-name-coloring", false);
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||
return;
|
||||
}
|
||||
|
||||
- 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()));
|
||||
+ if (this.player.getWorld().paperConfig.useVanillaScoreboardColoring) {
|
||||
+ baseComponent = new ChatMessage(event.getFormat(), ScoreboardTeam.getPlayerDisplayName(this.player.aO(), player.getDisplayName()), event.getMessage());
|
||||
+ }
|
||||
+ // Paper end
|
||||
+ minecraftServer.console.sendMessage(baseComponent.toPlainText());
|
||||
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 New Issue
Block a user