mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-22 00:04:59 +01:00
Simplify texture updating in CraftMetaSkull
By: md_5 <git@md-5.net>
This commit is contained in:
parent
b7693bfff8
commit
17c30fd4e2
1 changed files with 5 additions and 5 deletions
|
@ -11,7 +11,6 @@ import net.minecraft.SystemUtils;
|
||||||
import net.minecraft.nbt.GameProfileSerializer;
|
import net.minecraft.nbt.GameProfileSerializer;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.resources.MinecraftKey;
|
import net.minecraft.resources.MinecraftKey;
|
||||||
import net.minecraft.world.level.block.entity.TileEntitySkull;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.NamespacedKey;
|
import org.bukkit.NamespacedKey;
|
||||||
|
@ -143,12 +142,13 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
|
||||||
// SPIGOT-6558: Set initial textures
|
// SPIGOT-6558: Set initial textures
|
||||||
tag.put(SKULL_OWNER.NBT, serializedProfile);
|
tag.put(SKULL_OWNER.NBT, serializedProfile);
|
||||||
// Fill in textures
|
// Fill in textures
|
||||||
TileEntitySkull.fillProfileTextures(profile).thenAccept((optional) -> {
|
PlayerProfile ownerProfile = getOwnerProfile();
|
||||||
optional.ifPresent((filledProfile) -> {
|
if (ownerProfile.getTextures().isEmpty()) {
|
||||||
setProfile(filledProfile);
|
ownerProfile.update().thenAccept((filledProfile) -> {
|
||||||
|
setOwnerProfile(filledProfile);
|
||||||
tag.put(SKULL_OWNER.NBT, serializedProfile);
|
tag.put(SKULL_OWNER.NBT, serializedProfile);
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (noteBlockSound != null) {
|
if (noteBlockSound != null) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue