--- a/net/minecraft/world/level/redstone/NeighborUpdater.java +++ b/net/minecraft/world/level/redstone/NeighborUpdater.java @@ -13,6 +13,13 @@ import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.IBlockData; +// CraftBukkit start +import net.minecraft.server.level.WorldServer; +import org.bukkit.craftbukkit.CraftWorld; +import org.bukkit.craftbukkit.block.CraftBlock; +import org.bukkit.craftbukkit.block.data.CraftBlockData; +import org.bukkit.event.block.BlockPhysicsEvent; +// CraftBukkit end public interface NeighborUpdater { @@ -50,6 +57,17 @@ static void executeUpdate(World world, IBlockData iblockdata, BlockPosition blockposition, Block block, @Nullable Orientation orientation, boolean flag) { try { + // CraftBukkit start + CraftWorld cworld = ((WorldServer) world).getWorld(); + if (cworld != null) { + BlockPhysicsEvent event = new BlockPhysicsEvent(CraftBlock.at(world, blockposition), CraftBlockData.fromData(iblockdata)); + ((WorldServer) world).getCraftServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { + return; + } + } + // CraftBukkit end iblockdata.handleNeighborChanged(world, blockposition, block, orientation, flag); } catch (Throwable throwable) { CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception while updating neighbours");