diff options
author | Lulu13022002 <[email protected]> | 2022-09-23 07:32:32 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2022-09-23 06:32:32 +0100 |
commit | 8681503d10842dc5f6155387317afbdcdbfbc01e (patch) | |
tree | ee5ac51ab94e562a35e7531f4de002fe8d9a8462 | |
parent | 980c1d1f9081f4b235bd99bbf5710b724059eea5 (diff) | |
download | Paper-8681503d10842dc5f6155387317afbdcdbfbc01e.tar.gz Paper-8681503d10842dc5f6155387317afbdcdbfbc01e.zip |
Call EntityChangeBlockEvent for frogs egg (#8136)
-rw-r--r-- | patches/server/0939-Fire-EntityChangeBlockEvent-in-more-places.patch | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/patches/server/0939-Fire-EntityChangeBlockEvent-in-more-places.patch b/patches/server/0939-Fire-EntityChangeBlockEvent-in-more-places.patch index 0239bf3a4f..35c92f85b3 100644 --- a/patches/server/0939-Fire-EntityChangeBlockEvent-in-more-places.patch +++ b/patches/server/0939-Fire-EntityChangeBlockEvent-in-more-places.patch @@ -78,6 +78,23 @@ index 359c78b4f98c38c81af27a2c4cf0939da51e5a0b..50612c00f53821ccafce94835caf1ba4 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 09457cb957d8fef403198b027b33d310e5e5169f..3e7e79e8bf6abfa639a69b827a46047569ad1b0a 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 +@@ -37,6 +37,12 @@ public class TryLaySpawnOnWaterNearLand extends Behavior<Frog> { + if (world.getBlockState(blockPos2).getCollisionShape(world, blockPos2).getFaceShape(Direction.UP).isEmpty() && world.getFluidState(blockPos2).is(Fluids.WATER)) { + BlockPos blockPos3 = blockPos2.above(); + if (world.getBlockState(blockPos3).isAir()) { ++ // Paper start ++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entity, blockPos3, this.spawnBlock.defaultBlockState()).isCancelled()) { ++ entity.getBrain().eraseMemory(this.memoryModule); // forgot pregnant memory ++ return; ++ } ++ // Paper end + world.setBlock(blockPos3, this.spawnBlock.defaultBlockState(), 3); + world.playSound((Player)null, entity, SoundEvents.FROG_LAY_SPAWN, SoundSource.BLOCKS, 1.0F, 1.0F); + entity.getBrain().eraseMemory(this.memoryModule); diff --git a/src/main/java/net/minecraft/world/item/AxeItem.java b/src/main/java/net/minecraft/world/item/AxeItem.java index 03a6a99dcc0c8fcc32776dd49cf6092b899bf6ed..9c49d8f696864d2aad23208422c4ab5b598a0cd9 100644 --- a/src/main/java/net/minecraft/world/item/AxeItem.java |