aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPedro <[email protected]>2022-04-15 18:23:10 -0400
committerGitHub <[email protected]>2022-04-15 15:23:10 -0700
commitc6e631aacb3a418e39a59d22a73deb404be6fe94 (patch)
tree7c2df73edb41141b4ff2fef0e9bf179d208a3141
parentb8fa41ecdf955cb26a6c44892de53b1154c6b94b (diff)
downloadPaper-c6e631aacb3a418e39a59d22a73deb404be6fe94.tar.gz
Paper-c6e631aacb3a418e39a59d22a73deb404be6fe94.zip
Use username instead of display name in PlayerList#getPlayerStats (#7740)
-rw-r--r--patches/server/0893-Use-username-instead-of-display-name-in-PlayerList-g.patch20
1 files changed, 20 insertions, 0 deletions
diff --git a/patches/server/0893-Use-username-instead-of-display-name-in-PlayerList-g.patch b/patches/server/0893-Use-username-instead-of-display-name-in-PlayerList-g.patch
new file mode 100644
index 0000000000..21342db8ba
--- /dev/null
+++ b/patches/server/0893-Use-username-instead-of-display-name-in-PlayerList-g.patch
@@ -0,0 +1,20 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Doc <[email protected]>
+Date: Fri, 15 Apr 2022 17:40:30 -0400
+Subject: [PATCH] Use username instead of display name in
+ PlayerList#getPlayerStats
+
+
+diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
+index 02dc93c394d37c9a84aa4a58d80615c403c54fb9..b183732a9cf63e246579ba18609201c27cd4ea25 100644
+--- a/src/main/java/net/minecraft/server/players/PlayerList.java
++++ b/src/main/java/net/minecraft/server/players/PlayerList.java
+@@ -1414,7 +1414,7 @@ public abstract class PlayerList {
+ // CraftBukkit start
+ public ServerStatsCounter getPlayerStats(ServerPlayer entityhuman) {
+ ServerStatsCounter serverstatisticmanager = entityhuman.getStats();
+- return serverstatisticmanager == null ? this.getPlayerStats(entityhuman.getUUID(), entityhuman.getDisplayName().getString()) : serverstatisticmanager;
++ return serverstatisticmanager == null ? this.getPlayerStats(entityhuman.getUUID(), entityhuman.getGameProfile().getName()) : serverstatisticmanager; // Paper - use username and not display name
+ }
+
+ public ServerStatsCounter getPlayerStats(UUID uuid, String displayName) {