diff --git a/patches/server/Entity-fromMobSpawner.patch b/patches/server/Entity-fromMobSpawner.patch index 6783b95769..ef53553141 100644 --- a/patches/server/Entity-fromMobSpawner.patch +++ b/patches/server/Entity-fromMobSpawner.patch @@ -48,6 +48,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // CraftBukkit start if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, pos).isCancelled()) { continue; +diff --git a/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawner.java b/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawner.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawner.java ++++ b/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawner.java +@@ -0,0 +0,0 @@ public final class TrialSpawner { + optional1.ifPresent(entityinsentient::equip); + } + ++ entity.spawnedViaMobSpawner = true; // Paper + // CraftBukkit start + if (org.bukkit.craftbukkit.event.CraftEventFactory.callTrialSpawnerSpawnEvent(entity, pos).isCancelled()) { + return Optional.empty(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java diff --git a/patches/server/Fixes-and-additions-to-the-spawn-reason-API.patch b/patches/server/Fixes-and-additions-to-the-spawn-reason-API.patch index 956ba341da..7c69c02c91 100644 --- a/patches/server/Fixes-and-additions-to-the-spawn-reason-API.patch +++ b/patches/server/Fixes-and-additions-to-the-spawn-reason-API.patch @@ -201,6 +201,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 .isPresent(); } +diff --git a/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawner.java b/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawner.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawner.java ++++ b/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawner.java +@@ -0,0 +0,0 @@ public final class TrialSpawner { + } + + entity.spawnedViaMobSpawner = true; // Paper ++ entity.spawnReason = org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.TRIAL_SPAWNER; // Paper - Entity#getEntitySpawnReason + // CraftBukkit start + if (org.bukkit.craftbukkit.event.CraftEventFactory.callTrialSpawnerSpawnEvent(entity, pos).isCancelled()) { + return Optional.empty(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java