diff options
Diffstat (limited to 'patches/server/0138-Basic-PlayerProfile-API.patch')
-rw-r--r-- | patches/server/0138-Basic-PlayerProfile-API.patch | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/patches/server/0138-Basic-PlayerProfile-API.patch b/patches/server/0138-Basic-PlayerProfile-API.patch index 624a0a5794..42b4b646e4 100644 --- a/patches/server/0138-Basic-PlayerProfile-API.patch +++ b/patches/server/0138-Basic-PlayerProfile-API.patch @@ -621,7 +621,7 @@ index c4142568c3188c89142799cc4911dd7eae32a45f..f379e108ec3c762940bddea878a0a711 String s1 = name.toLowerCase(Locale.ROOT); GameProfileCache.GameProfileInfo usercache_usercacheentry = (GameProfileCache.GameProfileInfo) this.profilesByName.get(s1); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 6f1b1191426d864719e1b5cbd42bf5699e6193e3..59f3167c276d93c36b0b36ff0e36918cf498424b 100644 +index 6f1b1191426d864719e1b5cbd42bf5699e6193e3..4dad4b95f263bd7cd086d87848ee8c8a862e1577 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -244,6 +244,9 @@ import org.yaml.snakeyaml.error.MarkedYAMLException; @@ -642,7 +642,7 @@ index 6f1b1191426d864719e1b5cbd42bf5699e6193e3..59f3167c276d93c36b0b36ff0e36918c CraftItemFactory.instance(); } -@@ -2574,5 +2578,29 @@ public final class CraftServer implements Server { +@@ -2574,5 +2578,37 @@ public final class CraftServer implements Server { public boolean suggestPlayerNamesWhenNullTabCompletions() { return com.destroystokyo.paper.PaperConfig.suggestPlayersWhenNullTabCompletions; } @@ -660,6 +660,14 @@ index 6f1b1191426d864719e1b5cbd42bf5699e6193e3..59f3167c276d93c36b0b36ff0e36918c + @Override + public com.destroystokyo.paper.profile.PlayerProfile createProfile(@Nullable UUID uuid, @Nullable String name) { + Player player = uuid != null ? Bukkit.getPlayer(uuid) : (name != null ? Bukkit.getPlayerExact(name) : null); ++ if (player != null) return new com.destroystokyo.paper.profile.CraftPlayerProfile((CraftPlayer) player); ++ ++ return new com.destroystokyo.paper.profile.CraftPlayerProfile(uuid, name); ++ } ++ ++ @Override ++ public com.destroystokyo.paper.profile.PlayerProfile createProfileExact(@Nullable UUID uuid, @Nullable String name) { ++ Player player = uuid != null ? Bukkit.getPlayer(uuid) : (name != null ? Bukkit.getPlayerExact(name) : null); + if (player == null) return new com.destroystokyo.paper.profile.CraftPlayerProfile(uuid, name); + + if (Objects.equals(uuid, player.getUniqueId()) && Objects.equals(name, player.getName())) { |