diff options
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/FenceGateBlock.java.patch')
-rw-r--r-- | patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/FenceGateBlock.java.patch | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/FenceGateBlock.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/FenceGateBlock.java.patch new file mode 100644 index 0000000000..09f55ee7bd --- /dev/null +++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/FenceGateBlock.java.patch @@ -0,0 +1,22 @@ +--- a/net/minecraft/world/level/block/FenceGateBlock.java ++++ b/net/minecraft/world/level/block/FenceGateBlock.java +@@ -178,7 +167,18 @@ + @Override + public void neighborChanged(BlockState blockstate, Level level, BlockPos blockpos, Block block, BlockPos blockpos1, boolean flag) { + if (!level.isClientSide) { +- boolean flag1 = level.hasNeighborSignal(blockpos); ++ boolean flag1 = level.hasNeighborSignal(pos); ++ // CraftBukkit start ++ boolean oldPowered = state.getValue(FenceGateBlock.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(level, pos); ++ org.bukkit.event.block.BlockRedstoneEvent eventRedstone = new org.bukkit.event.block.BlockRedstoneEvent(bukkitBlock, oldPower, newPower); ++ level.getCraftServer().getPluginManager().callEvent(eventRedstone); ++ flag1 = eventRedstone.getNewCurrent() > 0; ++ } ++ // CraftBukkit end + + if ((Boolean) blockstate.getValue(FenceGateBlock.POWERED) != flag1) { + level.setBlock(blockpos, (BlockState) ((BlockState) blockstate.setValue(FenceGateBlock.POWERED, flag1)).setValue(FenceGateBlock.OPEN, flag1), 2); |