From d445af3b1442434ecee8acfcc6c3e375e0d0584a Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 13 Jun 2019 20:51:39 +1000 Subject: [PATCH] SPIGOT-5067: Add item meta for 1.14 spawn eggs --- .../craftbukkit/inventory/CraftItemFactory.java | 9 ++++++++- .../bukkit/craftbukkit/inventory/CraftItemStack.java | 9 ++++++++- .../craftbukkit/inventory/CraftMetaSpawnEgg.java | 11 +++++++++-- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java index a4320f8446..133a80ee05 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java @@ -142,18 +142,20 @@ public final class CraftItemFactory implements ItemFactory { return meta instanceof CraftMetaBanner ? meta : new CraftMetaBanner(meta); case BAT_SPAWN_EGG: case BLAZE_SPAWN_EGG: + case CAT_SPAWN_EGG: case CAVE_SPIDER_SPAWN_EGG: case CHICKEN_SPAWN_EGG: case COD_SPAWN_EGG: case COW_SPAWN_EGG: case CREEPER_SPAWN_EGG: case DOLPHIN_SPAWN_EGG: - case DROWNED_SPAWN_EGG: case DONKEY_SPAWN_EGG: + case DROWNED_SPAWN_EGG: case ELDER_GUARDIAN_SPAWN_EGG: case ENDERMAN_SPAWN_EGG: case ENDERMITE_SPAWN_EGG: case EVOKER_SPAWN_EGG: + case FOX_SPAWN_EGG: case GHAST_SPAWN_EGG: case GUARDIAN_SPAWN_EGG: case HORSE_SPAWN_EGG: @@ -163,12 +165,15 @@ public final class CraftItemFactory implements ItemFactory { case MOOSHROOM_SPAWN_EGG: case MULE_SPAWN_EGG: case OCELOT_SPAWN_EGG: + case PANDA_SPAWN_EGG: case PARROT_SPAWN_EGG: case PHANTOM_SPAWN_EGG: case PIG_SPAWN_EGG: + case PILLAGER_SPAWN_EGG: case POLAR_BEAR_SPAWN_EGG: case PUFFERFISH_SPAWN_EGG: case RABBIT_SPAWN_EGG: + case RAVAGER_SPAWN_EGG: case SALMON_SPAWN_EGG: case SHEEP_SPAWN_EGG: case SHULKER_SPAWN_EGG: @@ -179,11 +184,13 @@ public final class CraftItemFactory implements ItemFactory { case SPIDER_SPAWN_EGG: case SQUID_SPAWN_EGG: case STRAY_SPAWN_EGG: + case TRADER_LLAMA_SPAWN_EGG: case TROPICAL_FISH_SPAWN_EGG: case TURTLE_SPAWN_EGG: case VEX_SPAWN_EGG: case VILLAGER_SPAWN_EGG: case VINDICATOR_SPAWN_EGG: + case WANDERING_TRADER_SPAWN_EGG: case WITCH_SPAWN_EGG: case WITHER_SKELETON_SPAWN_EGG: case WOLF_SPAWN_EGG: diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java index 42f7bb0f7d..2a9e2ab58a 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -393,18 +393,20 @@ public final class CraftItemStack extends ItemStack { return new CraftMetaBanner(item.getTag()); case BAT_SPAWN_EGG: case BLAZE_SPAWN_EGG: + case CAT_SPAWN_EGG: case CAVE_SPIDER_SPAWN_EGG: case CHICKEN_SPAWN_EGG: case COD_SPAWN_EGG: case COW_SPAWN_EGG: case CREEPER_SPAWN_EGG: case DOLPHIN_SPAWN_EGG: - case DROWNED_SPAWN_EGG: case DONKEY_SPAWN_EGG: + case DROWNED_SPAWN_EGG: case ELDER_GUARDIAN_SPAWN_EGG: case ENDERMAN_SPAWN_EGG: case ENDERMITE_SPAWN_EGG: case EVOKER_SPAWN_EGG: + case FOX_SPAWN_EGG: case GHAST_SPAWN_EGG: case GUARDIAN_SPAWN_EGG: case HORSE_SPAWN_EGG: @@ -414,12 +416,15 @@ public final class CraftItemStack extends ItemStack { case MOOSHROOM_SPAWN_EGG: case MULE_SPAWN_EGG: case OCELOT_SPAWN_EGG: + case PANDA_SPAWN_EGG: case PARROT_SPAWN_EGG: case PHANTOM_SPAWN_EGG: case PIG_SPAWN_EGG: + case PILLAGER_SPAWN_EGG: case POLAR_BEAR_SPAWN_EGG: case PUFFERFISH_SPAWN_EGG: case RABBIT_SPAWN_EGG: + case RAVAGER_SPAWN_EGG: case SALMON_SPAWN_EGG: case SHEEP_SPAWN_EGG: case SHULKER_SPAWN_EGG: @@ -430,11 +435,13 @@ public final class CraftItemStack extends ItemStack { case SPIDER_SPAWN_EGG: case SQUID_SPAWN_EGG: case STRAY_SPAWN_EGG: + case TRADER_LLAMA_SPAWN_EGG: case TROPICAL_FISH_SPAWN_EGG: case TURTLE_SPAWN_EGG: case VEX_SPAWN_EGG: case VILLAGER_SPAWN_EGG: case VINDICATOR_SPAWN_EGG: + case WANDERING_TRADER_SPAWN_EGG: case WITCH_SPAWN_EGG: case WITHER_SKELETON_SPAWN_EGG: case WOLF_SPAWN_EGG: diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java index d8914fa20b..082f851197 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java @@ -112,18 +112,20 @@ public class CraftMetaSpawnEgg extends CraftMetaItem implements SpawnEggMeta { switch (type) { case BAT_SPAWN_EGG: case BLAZE_SPAWN_EGG: + case CAT_SPAWN_EGG: case CAVE_SPIDER_SPAWN_EGG: case CHICKEN_SPAWN_EGG: case COD_SPAWN_EGG: case COW_SPAWN_EGG: case CREEPER_SPAWN_EGG: case DOLPHIN_SPAWN_EGG: - case DROWNED_SPAWN_EGG: case DONKEY_SPAWN_EGG: + case DROWNED_SPAWN_EGG: case ELDER_GUARDIAN_SPAWN_EGG: case ENDERMAN_SPAWN_EGG: case ENDERMITE_SPAWN_EGG: case EVOKER_SPAWN_EGG: + case FOX_SPAWN_EGG: case GHAST_SPAWN_EGG: case GUARDIAN_SPAWN_EGG: case HORSE_SPAWN_EGG: @@ -133,12 +135,15 @@ public class CraftMetaSpawnEgg extends CraftMetaItem implements SpawnEggMeta { case MOOSHROOM_SPAWN_EGG: case MULE_SPAWN_EGG: case OCELOT_SPAWN_EGG: + case PANDA_SPAWN_EGG: case PARROT_SPAWN_EGG: case PHANTOM_SPAWN_EGG: case PIG_SPAWN_EGG: + case PILLAGER_SPAWN_EGG: case POLAR_BEAR_SPAWN_EGG: case PUFFERFISH_SPAWN_EGG: case RABBIT_SPAWN_EGG: + case RAVAGER_SPAWN_EGG: case SALMON_SPAWN_EGG: case SHEEP_SPAWN_EGG: case SHULKER_SPAWN_EGG: @@ -149,18 +154,20 @@ public class CraftMetaSpawnEgg extends CraftMetaItem implements SpawnEggMeta { case SPIDER_SPAWN_EGG: case SQUID_SPAWN_EGG: case STRAY_SPAWN_EGG: + case TRADER_LLAMA_SPAWN_EGG: case TROPICAL_FISH_SPAWN_EGG: case TURTLE_SPAWN_EGG: case VEX_SPAWN_EGG: case VILLAGER_SPAWN_EGG: case VINDICATOR_SPAWN_EGG: + case WANDERING_TRADER_SPAWN_EGG: case WITCH_SPAWN_EGG: case WITHER_SKELETON_SPAWN_EGG: case WOLF_SPAWN_EGG: case ZOMBIE_HORSE_SPAWN_EGG: case ZOMBIE_PIGMAN_SPAWN_EGG: case ZOMBIE_SPAWN_EGG: - case ZOMBIE_VILLAGER_SPAWN_EGG: + case ZOMBIE_VILLAGER_SPAWN_EGG: return true; default: return false;