mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 08:17:44 +01:00
Call EntityChangeBlockEvent for frogs egg (#8136)
This commit is contained in:
parent
eb3f66c6da
commit
6d4edceb20
@ -78,6 +78,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
world.setBlockAndUpdate(blockposition1Final, iblockdata1); // CraftBukkit - decompile error
|
world.setBlockAndUpdate(blockposition1Final, iblockdata1); // CraftBukkit - decompile error
|
||||||
});
|
});
|
||||||
world.levelEvent(3002, blockposition1, -1);
|
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 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
|
||||||
|
@@ -0,0 +0,0 @@ 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
|
diff --git a/src/main/java/net/minecraft/world/item/AxeItem.java b/src/main/java/net/minecraft/world/item/AxeItem.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/item/AxeItem.java
|
--- a/src/main/java/net/minecraft/world/item/AxeItem.java
|
||||||
|
Loading…
Reference in New Issue
Block a user