aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0138-Basic-PlayerProfile-API.patch
diff options
context:
space:
mode:
authorBjarne Koll <[email protected]>2022-04-22 20:54:08 +0200
committerGitHub <[email protected]>2022-04-22 19:54:08 +0100
commitef6a1a5f99e364a2509219716097beaa511c51fb (patch)
tree5df44607f3be0a42c0b01c8587a6a061d959ddaa /patches/server/0138-Basic-PlayerProfile-API.patch
parentc449f6a1f712b81b50e250a2e258ef3e37fd6b9b (diff)
downloadPaper-ef6a1a5f99e364a2509219716097beaa511c51fb.tar.gz
Paper-ef6a1a5f99e364a2509219716097beaa511c51fb.zip
Revert to old createProfile(UUID, String) logic (#7723)
Diffstat (limited to 'patches/server/0138-Basic-PlayerProfile-API.patch')
-rw-r--r--patches/server/0138-Basic-PlayerProfile-API.patch12
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())) {