Paper/patches/server/0832-Use-username-instead-of-display-name-in-PlayerList-g.patch
Jake Potrebic 9147456fc9
Updated Upstream (CraftBukkit/Spigot) (#8815)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

CraftBukkit Changes:
ab8ace685 SPIGOT-7236: Bone meal doesn't increase use statistic
7dcb59b8e Avoid switch on material in previous commit

Spigot Changes:
19641c75 SPIGOT-7235: World.Spigot#strikeLightningEffect doesn't do anything
2023-01-27 12:52:04 -08:00

21 lines
1.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Doc <nachito94@msn.com>
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 0093be36b2d107549da99d51894f7a332af5e3fa..c092bfa679c60fd11eb95aaa4828b4f3403869f8 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1407,7 +1407,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) {