2016-10-23 06:32:04 +00:00
|
|
|
From eae31361f0bb0cdd478a0654fb10b034e4586117 Mon Sep 17 00:00:00 2001
|
2016-04-06 06:10:26 +00:00
|
|
|
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
|
2016-08-27 23:41:58 +00:00
|
|
|
index 84694b2..64e20d5 100644
|
2016-04-06 06:10:26 +00:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2016-08-27 23:41:58 +00:00
|
|
|
@@ -308,4 +308,9 @@ public class PaperWorldConfig {
|
2016-04-06 06:10:26 +00:00
|
|
|
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);
|
|
|
|
+ }
|
|
|
|
}
|
2016-07-27 22:46:02 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
2016-10-13 22:29:38 +00:00
|
|
|
index 7696998..966f9fd 100644
|
2016-07-27 22:46:02 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
2016-10-13 22:29:38 +00:00
|
|
|
@@ -1894,6 +1894,7 @@ public abstract class Entity implements ICommandListener {
|
2016-07-27 22:46:02 +00:00
|
|
|
return this.getFlag(5);
|
|
|
|
}
|
|
|
|
|
|
|
|
+ @Nullable public ScoreboardTeamBase getTeam() { return this.aQ(); } // Paper - OBFHELPER
|
|
|
|
@Nullable
|
|
|
|
public ScoreboardTeamBase aQ() {
|
|
|
|
if (!this.world.paperConfig.nonPlayerEntitiesOnScoreboards && !(this instanceof EntityHuman)) { return null; } // Paper
|
2016-04-06 06:10:26 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
2016-10-23 06:32:04 +00:00
|
|
|
index f562373..236062d 100644
|
2016-04-06 06:10:26 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
2016-10-23 06:32:04 +00:00
|
|
|
@@ -1352,7 +1352,14 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
2016-04-06 06:10:26 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
- s = String.format(event.getFormat(), event.getPlayer().getDisplayName(), event.getMessage());
|
2016-04-07 22:31:06 +00:00
|
|
|
+ // Paper Start - (Meh) Support for vanilla world scoreboard name coloring
|
|
|
|
+ String displayName = event.getPlayer().getDisplayName();
|
2016-04-06 06:10:26 +00:00
|
|
|
+ if (this.player.getWorld().paperConfig.useVanillaScoreboardColoring) {
|
2016-07-27 22:46:02 +00:00
|
|
|
+ displayName = ScoreboardTeam.getPlayerDisplayName(this.player.getTeam(), player.getDisplayName());
|
2016-04-06 06:10:26 +00:00
|
|
|
+ }
|
2016-04-07 22:31:06 +00:00
|
|
|
+
|
|
|
|
+ s = String.format(event.getFormat(), displayName, event.getMessage());
|
2016-04-06 06:10:26 +00:00
|
|
|
+ // Paper end
|
2016-04-07 22:31:06 +00:00
|
|
|
minecraftServer.console.sendMessage(s);
|
2016-04-06 06:10:26 +00:00
|
|
|
if (((LazyPlayerSet) event.getRecipients()).isLazy()) {
|
|
|
|
for (Object recipient : minecraftServer.getPlayerList().players) {
|
|
|
|
--
|
2016-10-21 20:28:44 +00:00
|
|
|
2.9.3
|
2016-04-06 06:10:26 +00:00
|
|
|
|