From 17c30fd4e2036ff65a588fae4acc5557fc842fa9 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sat, 21 Oct 2023 13:39:52 +1100 Subject: [PATCH] Simplify texture updating in CraftMetaSkull By: md_5 --- .../bukkit/craftbukkit/inventory/CraftMetaSkull.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java index 5852fcd9c1..1c69d56724 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java @@ -11,7 +11,6 @@ import net.minecraft.SystemUtils; import net.minecraft.nbt.GameProfileSerializer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.resources.MinecraftKey; -import net.minecraft.world.level.block.entity.TileEntitySkull; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.NamespacedKey; @@ -143,12 +142,13 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { // SPIGOT-6558: Set initial textures tag.put(SKULL_OWNER.NBT, serializedProfile); // Fill in textures - TileEntitySkull.fillProfileTextures(profile).thenAccept((optional) -> { - optional.ifPresent((filledProfile) -> { - setProfile(filledProfile); + PlayerProfile ownerProfile = getOwnerProfile(); + if (ownerProfile.getTextures().isEmpty()) { + ownerProfile.update().thenAccept((filledProfile) -> { + setOwnerProfile(filledProfile); tag.put(SKULL_OWNER.NBT, serializedProfile); }); - }); + } } if (noteBlockSound != null) {