geforkt von Mirrors/Paper
4cdbb0c86c
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 Bukkit Changes: 044d4ee9 SPIGOT-7283, SPIGOT-7318: Add AsyncStructureGenerateEvent and BlockState cloning 57b73d57 PR-913: Deprecate Projectile#doesBounce() and #setBounce() 43373c44 PR-904: Update FeatureFlag for 1.20.2 a7bbbf0c PR-911: Expand DataPack API with 1.20.2 pack version methods 0341e3a0 SPIGOT-7489: Add TeleportDuration to Display Entity bcd8d2aa PR-912: Update Minecraft Wiki URLs CraftBukkit Changes: 99aafc222 Increase outdated build delay dab849f08 SPIGOT-7283, SPIGOT-7318: Add AsyncStructureGenerateEvent and BlockState cloning 041b29ae3 Upgrade specialsource-maven-plugin 851a32cff PR-1263: Remove unused implementation of AbstractProjectile#doesBounce() and #setBounce() 251af0da3 PR-1261: Expand DataPack API with 1.20.2 pack version methods 46e4ba627 Upgrade specialsource-maven-plugin df3738a24 SPIGOT-7489: Add TeleportDuration to Display Entity 8d0fea457 PR-1262: Update Minecraft Wiki URLs e62905aab SPIGOT-7490: Fix entity equipment updates Spigot Changes: a0f3d486 Rebuild patches
105 Zeilen
4.6 KiB
Diff
105 Zeilen
4.6 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Aikar <aikar@aikar.co>
|
|
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 34aa42dce4340d80906750369633bfafc8189b88..4b46863cd0fb32cd1423370605f0be9312e77935 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java
|
|
@@ -111,7 +111,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;
|
|
@@ -121,11 +136,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 b202f425cbb880079b9e3ec64d077482d7aa5f99..9b9e20014042da4324c9f4babb05d8ba9513f81d 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
|
|
@@ -187,6 +187,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()) {
|
|
@@ -237,6 +250,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
|
|
}
|
|
|
|
@Override
|
|
+ @Deprecated // Paper
|
|
public PlayerProfile getOwnerProfile() {
|
|
if (!this.hasOwner()) {
|
|
return null;
|
|
@@ -246,11 +260,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
|
|
}
|
|
}
|
|
|
|
@@ -304,7 +319,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(SKULL_OWNER.BUKKIT, new CraftPlayerProfile(this.profile));
|
|
+ return builder.put(SKULL_OWNER.BUKKIT, new com.destroystokyo.paper.profile.CraftPlayerProfile(this.profile)); // Paper
|
|
}
|
|
NamespacedKey namespacedKeyNB = this.getNoteBlockSound();
|
|
if (namespacedKeyNB != null) {
|