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

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2022-12-10 21:48:22 +11:00
parent 644b6c302a
commit 0cb9e6122e

View file

@ -45,6 +45,15 @@
if (itemstack != null) {
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 @@
NBTTagCompound nbttagcompound = itemstack.getTag();