From 9ab758c7b608854ec658450227c2a17e51845de5 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 9 Oct 2017 18:32:45 +1100 Subject: [PATCH] SPIGOT-3605: Spawn eggs not saving internal data --- .../bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java index 782a781ec6..2f438eb46b 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java @@ -6,6 +6,7 @@ import java.util.Map; import net.minecraft.server.DataConverterTypes; import net.minecraft.server.MinecraftKey; import net.minecraft.server.MinecraftServer; +import net.minecraft.server.NBTBase; import net.minecraft.server.NBTTagCompound; import org.bukkit.Material; import org.bukkit.configuration.serialization.DelegateDeserialization; @@ -66,6 +67,13 @@ public class CraftMetaSpawnEgg extends CraftMetaItem implements SpawnEggMeta { } } + @Override + void serializeInternal(Map internalTags) { + if (entityTag != null) { + internalTags.put(ENTITY_TAG.NBT, entityTag); + } + } + @Override void applyToItem(NBTTagCompound tag) { super.applyToItem(tag);