--- a/net/minecraft/world/level/block/BlockFenceGate.java +++ b/net/minecraft/world/level/block/BlockFenceGate.java @@ -168,6 +168,17 @@ public void neighborChanged(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1, boolean flag) { if (!world.isClientSide) { boolean flag1 = world.hasNeighborSignal(blockposition); + // CraftBukkit start + boolean oldPowered = iblockdata.getValue(BlockFenceGate.POWERED); + if (oldPowered != flag1) { + int newPower = flag1 ? 15 : 0; + int oldPower = oldPowered ? 15 : 0; + org.bukkit.block.Block bukkitBlock = org.bukkit.craftbukkit.block.CraftBlock.at(world, blockposition); + org.bukkit.event.block.BlockRedstoneEvent eventRedstone = new org.bukkit.event.block.BlockRedstoneEvent(bukkitBlock, oldPower, newPower); + world.getCraftServer().getPluginManager().callEvent(eventRedstone); + flag1 = eventRedstone.getNewCurrent() > 0; + } + // CraftBukkit end if ((Boolean) iblockdata.getValue(BlockFenceGate.POWERED) != flag1) { world.setBlock(blockposition, (IBlockData) ((IBlockData) iblockdata.setValue(BlockFenceGate.POWERED, flag1)).setValue(BlockFenceGate.OPEN, flag1), 2);