mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Call EntityChangeBlockEvent for frogs egg (#9213)
This commit is contained in:
parent
5957c490da
commit
b4656d3a02
1 changed files with 17 additions and 0 deletions
|
@ -78,6 +78,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
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 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 {
|
||||
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/AxeItem.java
|
||||
|
|
Loading…
Reference in a new issue