Add basic support for using vanilla style, world-based, scoreboard name coloring
Closes GH-188
Dieser Commit ist enthalten in:
Ursprung
6dae26cf14
Commit
6b75dac6f4
@ -0,0 +1,53 @@
|
||||
From f46589b84ced4464830f16cc794803837e0c2573 Mon Sep 17 00:00:00 2001
|
||||
From: Zach Brown <zach.brown@destroystokyo.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 275bf10..ad69ed3 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -318,4 +318,9 @@ 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 ffbe81d..a9a908f 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -1345,15 +1345,21 @@ 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
|
||||
}
|
||||
}
|
||||
}
|
||||
--
|
||||
2.8.0
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren