From 366c3ca80fad4201a76f76278cfab72d53fe8ca8 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 11 Mar 2024 15:09:39 +1100 Subject: [PATCH] SPIGOT-7600: EntityChangeBlockEvent is not fired for frog eggs --- .../ai/behavior/TryLaySpawnOnWaterNearLand.patch | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 nms-patches/net/minecraft/world/entity/ai/behavior/TryLaySpawnOnWaterNearLand.patch diff --git a/nms-patches/net/minecraft/world/entity/ai/behavior/TryLaySpawnOnWaterNearLand.patch b/nms-patches/net/minecraft/world/entity/ai/behavior/TryLaySpawnOnWaterNearLand.patch new file mode 100644 index 000000000..6dda67cf7 --- /dev/null +++ b/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);