diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java | 5 | ||||
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java index f12b67be..6adbbd4a 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -40,9 +40,12 @@ public final class CraftItemStack extends ItemStack { return net.minecraft.server.ItemStack.a; } - net.minecraft.server.ItemStack stack = new net.minecraft.server.ItemStack(item, original.getAmount(), original.getDurability()); + net.minecraft.server.ItemStack stack = new net.minecraft.server.ItemStack(item, original.getAmount(), original.getDurability(), false); if (original.hasItemMeta()) { setItemMeta(stack, original.getItemMeta()); + } else { + // Converted after setItemMeta + stack.convertStack(); } return stack; } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java index b98c02ff..360f95f7 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java @@ -70,7 +70,7 @@ public class CraftMetaSpawnEgg extends CraftMetaItem implements SpawnEggMeta { void applyToItem(NBTTagCompound tag) { super.applyToItem(tag); - if (entityTag == null) { + if (!isSpawnEggEmpty() && entityTag == null) { entityTag = new NBTTagCompound(); } @@ -78,7 +78,9 @@ public class CraftMetaSpawnEgg extends CraftMetaItem implements SpawnEggMeta { entityTag.setString(ENTITY_ID.NBT, new MinecraftKey(spawnedType.getName()).toString()); } - tag.set(ENTITY_TAG.NBT, entityTag); + if (entityTag != null) { + tag.set(ENTITY_TAG.NBT, entityTag); + } } @Override |