Use username instead of display name in PlayerList#getPlayerStats

This commit is contained in:
Doc 2022-04-15 17:40:30 -04:00
parent f97f51d382
commit 90ee0e7de2

View file

@ -1154,7 +1154,7 @@
+ // 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) {