aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/RedStoneWireBlock.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/RedStoneWireBlock.java.patch')
-rw-r--r--patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/RedStoneWireBlock.java.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/RedStoneWireBlock.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/RedStoneWireBlock.java.patch
new file mode 100644
index 0000000000..6d81ae2cf8
--- /dev/null
+++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/RedStoneWireBlock.java.patch
@@ -0,0 +1,29 @@
+--- a/net/minecraft/world/level/block/RedStoneWireBlock.java
++++ b/net/minecraft/world/level/block/RedStoneWireBlock.java
+@@ -33,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 {
+ public static final MapCodec<RedStoneWireBlock> CODEC = simpleCodec(RedStoneWireBlock::new);
+@@ -278,7 +261,17 @@
+
+ private void updatePowerStrength(Level level, BlockPos pos, BlockState state) {
+ int i = this.calculateTargetStrength(level, pos);
+- if (state.getValue(POWER) != i) {
++
++ // 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, state.setValue(POWER, Integer.valueOf(i)), 2);
+ }