SPIGOT-7568: Call EntityChangeBlockEvent for DecoratedPot

By: Doc <nachito94@msn.com>
This commit is contained in:
CraftBukkit/Spigot 2024-01-24 21:49:24 +11:00
parent f5b984c8a0
commit 67ab2cd516

View file

@ -0,0 +1,14 @@
--- a/net/minecraft/world/level/block/DecoratedPotBlock.java
+++ b/net/minecraft/world/level/block/DecoratedPotBlock.java
@@ -230,6 +230,11 @@
BlockPosition blockposition = movingobjectpositionblock.getBlockPos();
if (!world.isClientSide && iprojectile.mayInteract(world, blockposition) && iprojectile.mayBreak(world)) {
+ // CraftBukkit start - call EntityChangeBlockEvent
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(iprojectile, blockposition, this.getFluidState(iblockdata).createLegacyBlock())) {
+ return;
+ }
+ // CraftBukkit end
world.setBlock(blockposition, (IBlockData) iblockdata.setValue(DecoratedPotBlock.CRACKED, true), 4);
world.destroyBlock(blockposition, true, iprojectile);
}