diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java index b7460c191d..4832a3393a 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java @@ -131,11 +131,13 @@ public final class CraftItemFactory implements ItemFactory { case YELLOW_BANNER: case YELLOW_WALL_BANNER: return meta instanceof CraftMetaBanner ? meta : new CraftMetaBanner(meta); + case ALLAY_SPAWN_EGG: case AXOLOTL_SPAWN_EGG: case BAT_SPAWN_EGG: case BEE_SPAWN_EGG: case BLAZE_SPAWN_EGG: case CAT_SPAWN_EGG: + case CAMEL_SPAWN_EGG: case CAVE_SPIDER_SPAWN_EGG: case CHICKEN_SPAWN_EGG: case COD_SPAWN_EGG: @@ -145,6 +147,7 @@ public final class CraftItemFactory implements ItemFactory { case DONKEY_SPAWN_EGG: case DROWNED_SPAWN_EGG: case ELDER_GUARDIAN_SPAWN_EGG: + case ENDER_DRAGON_SPAWN_EGG: case ENDERMAN_SPAWN_EGG: case ENDERMITE_SPAWN_EGG: case EVOKER_SPAWN_EGG: @@ -156,6 +159,7 @@ public final class CraftItemFactory implements ItemFactory { case HOGLIN_SPAWN_EGG: case HORSE_SPAWN_EGG: case HUSK_SPAWN_EGG: + case IRON_GOLEM_SPAWN_EGG: case LLAMA_SPAWN_EGG: case MAGMA_CUBE_SPAWN_EGG: case MOOSHROOM_SPAWN_EGG: @@ -179,6 +183,7 @@ public final class CraftItemFactory implements ItemFactory { case SKELETON_HORSE_SPAWN_EGG: case SKELETON_SPAWN_EGG: case SLIME_SPAWN_EGG: + case SNOW_GOLEM_SPAWN_EGG: case SPIDER_SPAWN_EGG: case SQUID_SPAWN_EGG: case STRAY_SPAWN_EGG: @@ -190,8 +195,10 @@ public final class CraftItemFactory implements ItemFactory { case VILLAGER_SPAWN_EGG: case VINDICATOR_SPAWN_EGG: case WANDERING_TRADER_SPAWN_EGG: + case WARDEN_SPAWN_EGG: case WITCH_SPAWN_EGG: case WITHER_SKELETON_SPAWN_EGG: + case WITHER_SPAWN_EGG: case WOLF_SPAWN_EGG: case ZOGLIN_SPAWN_EGG: case ZOMBIE_HORSE_SPAWN_EGG: diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java index b34fa65a4f..71eb617cbf 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -394,11 +394,13 @@ public final class CraftItemStack extends ItemStack { case YELLOW_BANNER: case YELLOW_WALL_BANNER: return new CraftMetaBanner(item.getTag()); + case ALLAY_SPAWN_EGG: case AXOLOTL_SPAWN_EGG: case BAT_SPAWN_EGG: case BEE_SPAWN_EGG: case BLAZE_SPAWN_EGG: case CAT_SPAWN_EGG: + case CAMEL_SPAWN_EGG: case CAVE_SPIDER_SPAWN_EGG: case CHICKEN_SPAWN_EGG: case COD_SPAWN_EGG: @@ -408,6 +410,7 @@ public final class CraftItemStack extends ItemStack { case DONKEY_SPAWN_EGG: case DROWNED_SPAWN_EGG: case ELDER_GUARDIAN_SPAWN_EGG: + case ENDER_DRAGON_SPAWN_EGG: case ENDERMAN_SPAWN_EGG: case ENDERMITE_SPAWN_EGG: case EVOKER_SPAWN_EGG: @@ -419,6 +422,7 @@ public final class CraftItemStack extends ItemStack { case HOGLIN_SPAWN_EGG: case HORSE_SPAWN_EGG: case HUSK_SPAWN_EGG: + case IRON_GOLEM_SPAWN_EGG: case LLAMA_SPAWN_EGG: case MAGMA_CUBE_SPAWN_EGG: case MOOSHROOM_SPAWN_EGG: @@ -442,6 +446,7 @@ public final class CraftItemStack extends ItemStack { case SKELETON_HORSE_SPAWN_EGG: case SKELETON_SPAWN_EGG: case SLIME_SPAWN_EGG: + case SNOW_GOLEM_SPAWN_EGG: case SPIDER_SPAWN_EGG: case SQUID_SPAWN_EGG: case STRAY_SPAWN_EGG: @@ -452,9 +457,11 @@ public final class CraftItemStack extends ItemStack { case VEX_SPAWN_EGG: case VILLAGER_SPAWN_EGG: case VINDICATOR_SPAWN_EGG: + case WARDEN_SPAWN_EGG: case WANDERING_TRADER_SPAWN_EGG: case WITCH_SPAWN_EGG: case WITHER_SKELETON_SPAWN_EGG: + case WITHER_SPAWN_EGG: case WOLF_SPAWN_EGG: case ZOGLIN_SPAWN_EGG: case ZOMBIE_HORSE_SPAWN_EGG: diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java index ab8c13136b..c9b2cabedd 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java @@ -18,11 +18,13 @@ import org.bukkit.material.MaterialData; public class CraftMetaSpawnEgg extends CraftMetaItem implements SpawnEggMeta { private static final Set SPAWN_EGG_MATERIALS = Sets.newHashSet( + Material.ALLAY_SPAWN_EGG, Material.AXOLOTL_SPAWN_EGG, Material.BAT_SPAWN_EGG, Material.BEE_SPAWN_EGG, Material.BLAZE_SPAWN_EGG, Material.CAT_SPAWN_EGG, + Material.CAMEL_SPAWN_EGG, Material.CAVE_SPIDER_SPAWN_EGG, Material.CHICKEN_SPAWN_EGG, Material.COD_SPAWN_EGG, @@ -32,6 +34,7 @@ public class CraftMetaSpawnEgg extends CraftMetaItem implements SpawnEggMeta { Material.DONKEY_SPAWN_EGG, Material.DROWNED_SPAWN_EGG, Material.ELDER_GUARDIAN_SPAWN_EGG, + Material.ENDER_DRAGON_SPAWN_EGG, Material.ENDERMAN_SPAWN_EGG, Material.ENDERMITE_SPAWN_EGG, Material.EVOKER_SPAWN_EGG, @@ -43,6 +46,7 @@ public class CraftMetaSpawnEgg extends CraftMetaItem implements SpawnEggMeta { Material.HOGLIN_SPAWN_EGG, Material.HORSE_SPAWN_EGG, Material.HUSK_SPAWN_EGG, + Material.IRON_GOLEM_SPAWN_EGG, Material.LLAMA_SPAWN_EGG, Material.MAGMA_CUBE_SPAWN_EGG, Material.MOOSHROOM_SPAWN_EGG, @@ -66,6 +70,7 @@ public class CraftMetaSpawnEgg extends CraftMetaItem implements SpawnEggMeta { Material.SKELETON_HORSE_SPAWN_EGG, Material.SKELETON_SPAWN_EGG, Material.SLIME_SPAWN_EGG, + Material.SNOW_GOLEM_SPAWN_EGG, Material.SPIDER_SPAWN_EGG, Material.SQUID_SPAWN_EGG, Material.STRAY_SPAWN_EGG, @@ -76,8 +81,10 @@ public class CraftMetaSpawnEgg extends CraftMetaItem implements SpawnEggMeta { Material.VEX_SPAWN_EGG, Material.VILLAGER_SPAWN_EGG, Material.VINDICATOR_SPAWN_EGG, + Material.WARDEN_SPAWN_EGG, Material.WANDERING_TRADER_SPAWN_EGG, Material.WITCH_SPAWN_EGG, + Material.WITHER_SPAWN_EGG, Material.WITHER_SKELETON_SPAWN_EGG, Material.WOLF_SPAWN_EGG, Material.ZOGLIN_SPAWN_EGG, @@ -97,11 +104,10 @@ public class CraftMetaSpawnEgg extends CraftMetaItem implements SpawnEggMeta { CraftMetaSpawnEgg(CraftMetaItem meta) { super(meta); - if (!(meta instanceof CraftMetaSpawnEgg)) { + if (!(meta instanceof CraftMetaSpawnEgg egg)) { return; } - CraftMetaSpawnEgg egg = (CraftMetaSpawnEgg) meta; this.spawnedType = egg.spawnedType; updateMaterial(null); // Trigger type population