aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/og/net/minecraft/world/level/block/BlockRedstoneWire.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/og/net/minecraft/world/level/block/BlockRedstoneWire.patch')
-rw-r--r--patch-remap/og/net/minecraft/world/level/block/BlockRedstoneWire.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/world/level/block/BlockRedstoneWire.patch b/patch-remap/og/net/minecraft/world/level/block/BlockRedstoneWire.patch
new file mode 100644
index 0000000000..99beb3beb8
--- /dev/null
+++ b/patch-remap/og/net/minecraft/world/level/block/BlockRedstoneWire.patch
@@ -0,0 +1,29 @@
+--- a/net/minecraft/world/level/block/BlockRedstoneWire.java
++++ b/net/minecraft/world/level/block/BlockRedstoneWire.java
+@@ -37,6 +37,8 @@
+ import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+ import net.minecraft.world.phys.shapes.VoxelShapes;
+
++import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
++
+ public class BlockRedstoneWire extends Block {
+
+ public static final MapCodec<BlockRedstoneWire> CODEC = simpleCodec(BlockRedstoneWire::new);
+@@ -261,7 +263,16 @@
+ private void updatePowerStrength(World world, BlockPosition blockposition, IBlockData iblockdata) {
+ int i = this.calculateTargetStrength(world, blockposition);
+
+- if ((Integer) iblockdata.getValue(BlockRedstoneWire.POWER) != i) {
++ // CraftBukkit start
++ int oldPower = (Integer) iblockdata.getValue(BlockRedstoneWire.POWER);
++ if (oldPower != i) {
++ BlockRedstoneEvent event = new BlockRedstoneEvent(world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), oldPower, i);
++ world.getCraftServer().getPluginManager().callEvent(event);
++
++ i = event.getNewCurrent();
++ }
++ if (oldPower != i) {
++ // CraftBukkit end
+ if (world.getBlockState(blockposition) == iblockdata) {
+ world.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockRedstoneWire.POWER, i), 2);
+ }