mirror of
https://github.com/PaperMC/Paper.git
synced 2024-09-06 11:58:10 +02:00
ea855e2b46
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Developers!: You will need to clean up your work/Minecraft/1.13.2 folder for this Also, restore a patch that was dropped in the last upstream Bukkit Changes: 279eeab3 Fix command description not being set 96e2bb18 Remove debug print from SyntheticEventTest CraftBukkit Changes:d3ed1516
Fix dangerously threaded beacons217a293d
Don't relocate joptsimple to allow --help to work.1be05a21
Prepare for imminent Java 12 releasea49270b2
Mappings Update5259d80c
SPIGOT-4669: Fix PlayerTeleportEvent coordinates for relative teleports Spigot Changes: e6eb36f2 Rebuild patches
66 lines
3.7 KiB
Diff
66 lines
3.7 KiB
Diff
From fc795917307bbed324521bca9996db6dcbfc7976 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
|
|
|
|
This change is basically a bandaid to fix CB's complete and utter lack
|
|
of support for vanilla scoreboard name modifications.
|
|
|
|
In the future, finding a way to merge the vanilla expectations in with
|
|
bukkit's concept of a display name would be preferable. There was a PR
|
|
for this on CB at one point but I can't find it. We may need to do this
|
|
ourselves at some point in the future.
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
index 276dd98fd..973ea8bca 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
@@ -255,4 +255,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 72c06cdb8..5516726e8 100644
|
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
@@ -1610,7 +1610,16 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
|
return;
|
|
}
|
|
|
|
- s = 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) {
|
|
+ IChatBaseComponent nameFromTeam = ScoreboardTeam.a(this.player.getScoreboardTeam(),((CraftPlayer) player).getHandle().getDisplayName());
|
|
+ // Explicitly add a RESET here, vanilla uses components for this now...
|
|
+ displayName = CraftChatMessage.fromComponent(nameFromTeam, EnumChatFormat.WHITE) + org.bukkit.ChatColor.RESET;
|
|
+ }
|
|
+
|
|
+ s = String.format(event.getFormat(), displayName, event.getMessage());
|
|
+ // Paper end
|
|
minecraftServer.console.sendMessage(s);
|
|
if (((LazyPlayerSet) event.getRecipients()).isLazy()) {
|
|
for (Object recipient : minecraftServer.getPlayerList().players) {
|
|
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
|
index 6e62ea90d..523694899 100644
|
|
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
|
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
|
@@ -176,7 +176,7 @@ public abstract class PlayerList {
|
|
}
|
|
|
|
chatmessage.a(EnumChatFormat.YELLOW);
|
|
- this.onPlayerJoin(entityplayer, CraftChatMessage.fromComponent(chatmessage));
|
|
+ this.onPlayerJoin(entityplayer, CraftChatMessage.fromComponent(chatmessage, EnumChatFormat.WHITE)); // Paper
|
|
// CraftBukkit end
|
|
worldserver = server.getWorldServer(entityplayer.dimension); // CraftBukkit - Update in case join event changed it
|
|
playerconnection.a(entityplayer.locX, entityplayer.locY, entityplayer.locZ, entityplayer.yaw, entityplayer.pitch);
|
|
--
|
|
2.21.0
|
|
|