SPIGOT-7200: CreatureSpawnEvent is called with incorrect SpawnReason when using spawn eggs

This commit is contained in:
md_5 2022-12-10 21:48:22 +11:00
parent eecb4c0dc0
commit 4fa7e1c31d
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

View File

@ -45,6 +45,15 @@
if (itemstack != null) { if (itemstack != null) {
nbttagcompound = itemstack.getTag(); nbttagcompound = itemstack.getTag();
@@ -342,7 +350,7 @@
nbttagcompound = null;
}
- return this.spawn(worldserver, nbttagcompound, consumer, blockposition, enummobspawn, flag, flag1);
+ return this.spawn(worldserver, nbttagcompound, consumer, blockposition, enummobspawn, flag, flag1, spawnReason); // CraftBukkit
}
public static <T extends Entity> Consumer<T> createDefaultStackConfig(WorldServer worldserver, ItemStack itemstack, @Nullable EntityHuman entityhuman) {
@@ -363,21 +371,37 @@ @@ -363,21 +371,37 @@
NBTTagCompound nbttagcompound = itemstack.getTag(); NBTTagCompound nbttagcompound = itemstack.getTag();