diff options
author | Lulu13022002 <[email protected]> | 2023-05-15 12:56:12 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2023-05-15 12:56:12 +0200 |
commit | 5b66d33a777ab9c44cd0828b5b35843d9aa2c6de (patch) | |
tree | b6952291faff44289650ff110ad503076ded11cf | |
parent | f8603a46a81ee2f973728e8a9f7631f683fdc6dc (diff) | |
download | Paper-5b66d33a777ab9c44cd0828b5b35843d9aa2c6de.tar.gz Paper-5b66d33a777ab9c44cd0828b5b35843d9aa2c6de.zip |
Call EntityChangeBlockEvent for frogs egg (#9213)
-rw-r--r-- | patches/server/0881-Fire-EntityChangeBlockEvent-in-more-places.patch | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/patches/server/0881-Fire-EntityChangeBlockEvent-in-more-places.patch b/patches/server/0881-Fire-EntityChangeBlockEvent-in-more-places.patch index b9d398ccc1..d9b87c3373 100644 --- a/patches/server/0881-Fire-EntityChangeBlockEvent-in-more-places.patch +++ b/patches/server/0881-Fire-EntityChangeBlockEvent-in-more-places.patch @@ -78,6 +78,23 @@ index 534ff7d4844448eaddb2778f81dfd66d1ee375db..558c14af6415681909f9e3a15f303ce4 world.setBlockAndUpdate(blockposition1Final, iblockdata1); // CraftBukkit - decompile error }); world.levelEvent(3002, blockposition1, -1); +diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/TryLaySpawnOnWaterNearLand.java b/src/main/java/net/minecraft/world/entity/ai/behavior/TryLaySpawnOnWaterNearLand.java +index 04fe142984760a1162703b46e08bf172b7277258..578f98981d3fa50630f8b25ecd69a11e523f7d8d 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/behavior/TryLaySpawnOnWaterNearLand.java ++++ b/src/main/java/net/minecraft/world/entity/ai/behavior/TryLaySpawnOnWaterNearLand.java +@@ -27,6 +27,12 @@ public class TryLaySpawnOnWaterNearLand { + BlockPos blockPos3 = blockPos2.above(); + if (world.getBlockState(blockPos3).isAir()) { + BlockState blockState = frogSpawn.defaultBlockState(); ++ // Paper start ++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entity, blockPos3, blockState).isCancelled()) { ++ isPregnant.erase(); // forgot pregnant memory ++ return true; ++ } ++ // Paper end + world.setBlock(blockPos3, blockState, 3); + world.gameEvent(GameEvent.BLOCK_PLACE, blockPos3, GameEvent.Context.of(entity, blockState)); + world.playSound((Player)null, entity, SoundEvents.FROG_LAY_SPAWN, SoundSource.BLOCKS, 1.0F, 1.0F); diff --git a/src/main/java/net/minecraft/world/item/AxeItem.java b/src/main/java/net/minecraft/world/item/AxeItem.java index 2f8ae1786a4c4438515c59fa56acaefdff60703d..9c7d0b9cc2fa98d5785c914c0183f7d4b5b1c1ea 100644 --- a/src/main/java/net/minecraft/world/item/AxeItem.java |