aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/RedStoneWireBlock.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/RedStoneWireBlock.java.patch')
-rw-r--r--patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/RedStoneWireBlock.java.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/RedStoneWireBlock.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/RedStoneWireBlock.java.patch
new file mode 100644
index 0000000000..19688d2738
--- /dev/null
+++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/RedStoneWireBlock.java.patch
@@ -0,0 +1,32 @@
+--- a/net/minecraft/world/level/block/RedStoneWireBlock.java
++++ b/net/minecraft/world/level/block/RedStoneWireBlock.java
+@@ -36,6 +36,7 @@
+ import net.minecraft.world.phys.shapes.CollisionContext;
+ import net.minecraft.world.phys.shapes.Shapes;
+ import net.minecraft.world.phys.shapes.VoxelShape;
++import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
+ public class RedStoneWireBlock extends Block {
+
+@@ -267,9 +262,18 @@
+ private void updatePowerStrength(Level level, BlockPos blockpos, BlockState blockstate) {
+ int i = this.calculateTargetStrength(level, blockpos);
+
+- if ((Integer) blockstate.getValue(RedStoneWireBlock.POWER) != i) {
+- if (level.getBlockState(blockpos) == blockstate) {
+- level.setBlock(blockpos, (BlockState) blockstate.setValue(RedStoneWireBlock.POWER, i), 2);
++ // CraftBukkit start
++ int oldPower = (Integer) state.getValue(RedStoneWireBlock.POWER);
++ if (oldPower != i) {
++ BlockRedstoneEvent event = new BlockRedstoneEvent(level.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ()), oldPower, i);
++ level.getCraftServer().getPluginManager().callEvent(event);
++
++ i = event.getNewCurrent();
++ }
++ if (oldPower != i) {
++ // CraftBukkit end
++ if (level.getBlockState(pos) == state) {
++ level.setBlock(pos, (IBlockData) state.setValue(RedStoneWireBlock.POWER, i), 2);
+ }
+
+ Set<BlockPos> set = Sets.newHashSet();