aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/og/net/minecraft/world/level/block/BlockFenceGate.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/og/net/minecraft/world/level/block/BlockFenceGate.patch')
-rw-r--r--patch-remap/og/net/minecraft/world/level/block/BlockFenceGate.patch20
1 files changed, 20 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/world/level/block/BlockFenceGate.patch b/patch-remap/og/net/minecraft/world/level/block/BlockFenceGate.patch
new file mode 100644
index 0000000000..ab12c8c076
--- /dev/null
+++ b/patch-remap/og/net/minecraft/world/level/block/BlockFenceGate.patch
@@ -0,0 +1,20 @@
+--- 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);