From d76a8e373b94d4223c5d926f3301588c931da1a6 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Mon, 11 Mar 2024 15:09:39 +1100 Subject: [PATCH] SPIGOT-7600: EntityChangeBlockEvent is not fired for frog eggs By: md_5 --- .../ai/behavior/TryLaySpawnOnWaterNearLand.patch | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 paper-server/nms-patches/net/minecraft/world/entity/ai/behavior/TryLaySpawnOnWaterNearLand.patch diff --git a/paper-server/nms-patches/net/minecraft/world/entity/ai/behavior/TryLaySpawnOnWaterNearLand.patch b/paper-server/nms-patches/net/minecraft/world/entity/ai/behavior/TryLaySpawnOnWaterNearLand.patch new file mode 100644 index 0000000000..6dda67cf74 --- /dev/null +++ b/paper-server/nms-patches/net/minecraft/world/entity/ai/behavior/TryLaySpawnOnWaterNearLand.patch @@ -0,0 +1,15 @@ +--- a/net/minecraft/world/entity/ai/behavior/TryLaySpawnOnWaterNearLand.java ++++ b/net/minecraft/world/entity/ai/behavior/TryLaySpawnOnWaterNearLand.java +@@ -38,6 +38,12 @@ + if (worldserver.getBlockState(blockposition2).isAir()) { + IBlockData iblockdata = block.defaultBlockState(); + ++ // CraftBukkit start ++ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entityliving, blockposition2, iblockdata)) { ++ memoryaccessor2.erase(); ++ return true; ++ } ++ // CraftBukkit end + worldserver.setBlock(blockposition2, iblockdata, 3); + worldserver.gameEvent(GameEvent.BLOCK_PLACE, blockposition2, GameEvent.a.of(entityliving, iblockdata)); + worldserver.playSound((EntityHuman) null, (Entity) entityliving, SoundEffects.FROG_LAY_SPAWN, SoundCategory.BLOCKS, 1.0F, 1.0F);