Add missing spawn eggs (#7896)

This commit is contained in:
Owen 2022-06-08 16:25:47 -04:00 committed by GitHub
parent 11c2705ac2
commit cbb47cacdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 57 additions and 0 deletions

View File

@ -0,0 +1,57 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
Date: Wed, 8 Jun 2022 15:58:20 -0400
Subject: [PATCH] Add missing spawn eggs
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
index ce64286ac5b836283318ac1ac0bd4afb29db9bb7..09b6475b77ebc7f43c13861aa2af26e2f6e6a8b5 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
@@ -196,6 +196,12 @@ public final class CraftItemFactory implements ItemFactory {
case ZOMBIE_SPAWN_EGG:
case ZOMBIE_VILLAGER_SPAWN_EGG:
case ZOMBIFIED_PIGLIN_SPAWN_EGG:
+ // Paper start
+ case ALLAY_SPAWN_EGG:
+ case FROG_SPAWN_EGG:
+ case TADPOLE_SPAWN_EGG:
+ case WARDEN_SPAWN_EGG:
+ // Paper end
return meta instanceof CraftMetaSpawnEgg ? meta : new CraftMetaSpawnEgg(meta);
case ARMOR_STAND:
return meta instanceof CraftMetaArmorStand ? meta : new CraftMetaArmorStand(meta);
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index c7c5f18cde7a4ad4dd821e452de3068c2e2187d1..f5363a753e5d24ccda946a9d65132eed28f19172 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -424,6 +424,12 @@ public final class CraftItemStack extends ItemStack {
case ZOMBIE_SPAWN_EGG:
case ZOMBIE_VILLAGER_SPAWN_EGG:
case ZOMBIFIED_PIGLIN_SPAWN_EGG:
+ // Paper start
+ case ALLAY_SPAWN_EGG:
+ case FROG_SPAWN_EGG:
+ case TADPOLE_SPAWN_EGG:
+ case WARDEN_SPAWN_EGG:
+ // Paper end
return new CraftMetaSpawnEgg(item.getTag());
case ARMOR_STAND:
return new CraftMetaArmorStand(item.getTag());
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java
index 34eb61547d727ffa8c580110cdc5a0f34562f073..f7f3b7cdb92e4852c7745125e3ac7d43512942d0 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java
@@ -179,6 +179,12 @@ public class CraftMetaSpawnEgg extends CraftMetaItem implements SpawnEggMeta {
case ZOMBIE_SPAWN_EGG:
case ZOMBIE_VILLAGER_SPAWN_EGG:
case ZOMBIFIED_PIGLIN_SPAWN_EGG:
+ // Paper start
+ case ALLAY_SPAWN_EGG:
+ case FROG_SPAWN_EGG:
+ case TADPOLE_SPAWN_EGG:
+ case WARDEN_SPAWN_EGG:
+ // Paper end
return true;
default:
return false;