diff options
author | Riley Park <[email protected]> | 2024-05-15 17:06:59 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2024-05-15 17:06:59 -0700 |
commit | f17519338bc589c045e0b32bfc37e048b23544d5 (patch) | |
tree | e50182ec698b4a9de8f366f485ee089b1901bbd9 /patches/server/0167-Add-setPlayerProfile-API-for-Skulls.patch | |
parent | 3fc93581bb876e8149b2ca423375a98f5ca12d27 (diff) | |
download | Paper-f17519338bc589c045e0b32bfc37e048b23544d5.tar.gz Paper-f17519338bc589c045e0b32bfc37e048b23544d5.zip |
Expose server build information (#10729)
* Expose server build information
* squash patches
* final tweaks
---------
Co-authored-by: Jake Potrebic <[email protected]>
Co-authored-by: masmc05 <[email protected]>
Diffstat (limited to 'patches/server/0167-Add-setPlayerProfile-API-for-Skulls.patch')
-rw-r--r-- | patches/server/0167-Add-setPlayerProfile-API-for-Skulls.patch | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/patches/server/0167-Add-setPlayerProfile-API-for-Skulls.patch b/patches/server/0167-Add-setPlayerProfile-API-for-Skulls.patch new file mode 100644 index 0000000000..99435ec31e --- /dev/null +++ b/patches/server/0167-Add-setPlayerProfile-API-for-Skulls.patch @@ -0,0 +1,104 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar <[email protected]> +Date: Fri, 19 Jan 2018 00:36:25 -0500 +Subject: [PATCH] Add setPlayerProfile API for Skulls + +This allows you to create already filled textures on Skulls to avoid texture lookups +which commonly cause rate limit issues with Mojang API + +diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java +index aa965ea05fb364e9cfc4bbf4241a47c3400355b0..45ac1d9193c3a0dc397d6e7ccfccec896fa78a13 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java +@@ -98,7 +98,22 @@ public class CraftSkull extends CraftBlockEntityState<SkullBlockEntity> implemen + } + } + ++ // Paper start + @Override ++ public void setPlayerProfile(com.destroystokyo.paper.profile.PlayerProfile profile) { ++ Preconditions.checkNotNull(profile, "profile"); ++ this.profile = com.destroystokyo.paper.profile.CraftPlayerProfile.asAuthlibCopy(profile); ++ } ++ ++ @javax.annotation.Nullable ++ @Override ++ public com.destroystokyo.paper.profile.PlayerProfile getPlayerProfile() { ++ return profile != null ? com.destroystokyo.paper.profile.CraftPlayerProfile.asBukkitCopy(profile) : null; ++ } ++ // Paper end ++ ++ @Override ++ @Deprecated // Paper + public PlayerProfile getOwnerProfile() { + if (!this.hasOwner()) { + return null; +@@ -108,11 +123,12 @@ public class CraftSkull extends CraftBlockEntityState<SkullBlockEntity> implemen + } + + @Override ++ @Deprecated // Paper + public void setOwnerProfile(PlayerProfile profile) { + if (profile == null) { + this.profile = null; + } else { +- this.profile = CraftPlayerProfile.validateSkullProfile(((CraftPlayerProfile) profile).buildGameProfile()); ++ this.profile = CraftPlayerProfile.validateSkullProfile(((com.destroystokyo.paper.profile.SharedPlayerProfile) profile).buildGameProfile()); // Paper + } + } + +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java +index d20ae5345d85dee1bcc83a45837d2288a6da49be..0f725408691384800abb2cc7a43d9e1c75c9a17e 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java +@@ -178,6 +178,19 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { + return this.hasOwner() ? this.profile.getName() : null; + } + ++ // Paper start ++ @Override ++ public void setPlayerProfile(@org.jetbrains.annotations.Nullable com.destroystokyo.paper.profile.PlayerProfile profile) { ++ setProfile((profile == null) ? null : com.destroystokyo.paper.profile.CraftPlayerProfile.asAuthlibCopy(profile)); ++ } ++ ++ @org.jetbrains.annotations.Nullable ++ @Override ++ public com.destroystokyo.paper.profile.PlayerProfile getPlayerProfile() { ++ return profile != null ? com.destroystokyo.paper.profile.CraftPlayerProfile.asBukkitCopy(profile) : null; ++ } ++ // Paper end ++ + @Override + public OfflinePlayer getOwningPlayer() { + if (this.hasOwner()) { +@@ -228,6 +241,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { + } + + @Override ++ @Deprecated // Paper + public PlayerProfile getOwnerProfile() { + if (!this.hasOwner()) { + return null; +@@ -237,11 +251,12 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { + } + + @Override ++ @Deprecated // Paper + public void setOwnerProfile(PlayerProfile profile) { + if (profile == null) { + this.setProfile(null); + } else { +- this.setProfile(CraftPlayerProfile.validateSkullProfile(((CraftPlayerProfile) profile).buildGameProfile())); ++ this.setProfile(CraftPlayerProfile.validateSkullProfile(((com.destroystokyo.paper.profile.SharedPlayerProfile) profile).buildGameProfile())); // Paper + } + } + +@@ -295,7 +310,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { + Builder<String, Object> serialize(Builder<String, Object> builder) { + super.serialize(builder); + if (this.profile != null) { +- return builder.put(CraftMetaSkull.SKULL_OWNER.BUKKIT, new CraftPlayerProfile(this.profile)); ++ return builder.put(CraftMetaSkull.SKULL_OWNER.BUKKIT, new com.destroystokyo.paper.profile.CraftPlayerProfile(this.profile)); // Paper + } + NamespacedKey namespacedKeyNB = this.getNoteBlockSound(); + if (namespacedKeyNB != null) { |