diff --git a/patches/api/0391-Add-CreatureSpawnEvent.SpawnReason.SPAWNER_BUCKET.patch b/patches/api/0391-Add-CreatureSpawnEvent.SpawnReason.SPAWNER_BUCKET.patch new file mode 100644 index 0000000000..1c59bcea32 --- /dev/null +++ b/patches/api/0391-Add-CreatureSpawnEvent.SpawnReason.SPAWNER_BUCKET.patch @@ -0,0 +1,23 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Doc +Date: Wed, 3 Aug 2022 22:15:16 -0400 +Subject: [PATCH] Add CreatureSpawnEvent.SpawnReason.SPAWNER_BUCKET + + +diff --git a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java +index 6d5c81824c7cb36f0c76baf532434fb7bf233da6..7d2990b33e2404c3c5942d852e8a948c052efabf 100644 +--- a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java ++++ b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java +@@ -71,6 +71,12 @@ public class CreatureSpawnEvent extends EntitySpawnEvent { + * When a creature spawns from a Spawner Egg + */ + SPAWNER_EGG, ++ // Paper start ++ /** ++ * When a creature spawns from a Bucket ++ */ ++ SPAWNER_BUCKET, ++ // Paper end + /** + * When a creature spawns because of a lightning strike + */ diff --git a/patches/server/0933-Add-CreatureSpawnEvent.SpawnReason.SPAWNER_BUCKET.patch b/patches/server/0933-Add-CreatureSpawnEvent.SpawnReason.SPAWNER_BUCKET.patch new file mode 100644 index 0000000000..0edc9ddd4d --- /dev/null +++ b/patches/server/0933-Add-CreatureSpawnEvent.SpawnReason.SPAWNER_BUCKET.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Doc +Date: Wed, 3 Aug 2022 22:17:08 -0400 +Subject: [PATCH] Add CreatureSpawnEvent.SpawnReason.SPAWNER_BUCKET + + +diff --git a/src/main/java/net/minecraft/world/item/MobBucketItem.java b/src/main/java/net/minecraft/world/item/MobBucketItem.java +index a45d93273c6ac881249f0828131e6fd6040c0d69..3a58aec5cc150af5f346ed9b6fbcbf00a42815b8 100644 +--- a/src/main/java/net/minecraft/world/item/MobBucketItem.java ++++ b/src/main/java/net/minecraft/world/item/MobBucketItem.java +@@ -46,7 +46,7 @@ public class MobBucketItem extends BucketItem { + } + + private void spawn(ServerLevel world, ItemStack stack, BlockPos pos) { +- Entity entity = this.type.spawn(world, stack, (Player)null, pos, MobSpawnType.BUCKET, true, false); ++ Entity entity = this.type.spawn(world, stack == null ? null : stack.getTag(), stack != null && stack.hasCustomHoverName() ? stack.getHoverName() : null, (Player)null, pos, MobSpawnType.BUCKET, true, false, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER_BUCKET); // Paper + if (entity instanceof Bucketable bucketable) { + bucketable.loadFromBucketTag(stack.getOrCreateTag()); + bucketable.setFromBucket(true);