#1012: Always save as skull owner and not as internal data

By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
CraftBukkit/Spigot 2022-02-13 20:52:46 +01:00
parent 8b46bfaaa2
commit 80e9699ccf

View file

@ -5,7 +5,6 @@ import com.mojang.authlib.GameProfile;
import java.util.Map;
import java.util.UUID;
import net.minecraft.nbt.GameProfileSerializer;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.level.block.entity.TileEntitySkull;
import org.bukkit.Bukkit;
@ -79,13 +78,6 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
}
}
@Override
void serializeInternal(final Map<String, NBTBase> internalTags) {
if (profile != null) {
internalTags.put(SKULL_PROFILE.NBT, serializedProfile);
}
}
private void setProfile(GameProfile profile) {
this.profile = profile;
this.serializedProfile = (profile == null) ? null : GameProfileSerializer.writeGameProfile(new NBTTagCompound(), profile);
@ -244,7 +236,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
@Override
Builder<String, Object> serialize(Builder<String, Object> builder) {
super.serialize(builder);
if (hasOwner()) {
if (this.profile != null) {
return builder.put(SKULL_OWNER.BUKKIT, new CraftPlayerProfile(this.profile));
}
return builder;