2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/level/block/BlockRedstoneWire.java
|
|
|
|
+++ b/net/minecraft/world/level/block/BlockRedstoneWire.java
|
2022-12-07 17:00:00 +01:00
|
|
|
@@ -36,6 +36,8 @@
|
2021-03-15 23:00:00 +01:00
|
|
|
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
|
|
|
import net.minecraft.world.phys.shapes.VoxelShapes;
|
2014-11-25 22:32:16 +01:00
|
|
|
|
|
|
|
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
|
|
|
|
+
|
|
|
|
public class BlockRedstoneWire extends Block {
|
|
|
|
|
2021-06-11 07:00:00 +02:00
|
|
|
public static final BlockStateEnum<BlockPropertyRedstoneSide> NORTH = BlockProperties.NORTH_REDSTONE;
|
2022-12-07 17:00:00 +01:00
|
|
|
@@ -254,7 +256,16 @@
|
2021-11-21 23:00:00 +01:00
|
|
|
private void updatePowerStrength(World world, BlockPosition blockposition, IBlockData iblockdata) {
|
|
|
|
int i = this.calculateTargetStrength(world, blockposition);
|
2015-02-26 23:41:06 +01:00
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
- if ((Integer) iblockdata.getValue(BlockRedstoneWire.POWER) != i) {
|
2014-11-25 22:32:16 +01:00
|
|
|
+ // CraftBukkit start
|
2021-11-21 23:00:00 +01:00
|
|
|
+ int oldPower = (Integer) iblockdata.getValue(BlockRedstoneWire.POWER);
|
2020-06-25 02:00:00 +02:00
|
|
|
+ if (oldPower != i) {
|
|
|
|
+ BlockRedstoneEvent event = new BlockRedstoneEvent(world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), oldPower, i);
|
2021-06-11 13:33:49 +02:00
|
|
|
+ world.getCraftServer().getPluginManager().callEvent(event);
|
2014-11-25 22:32:16 +01:00
|
|
|
+
|
2020-06-25 02:00:00 +02:00
|
|
|
+ i = event.getNewCurrent();
|
2020-07-09 01:12:57 +02:00
|
|
|
+ }
|
|
|
|
+ if (oldPower != i) {
|
2020-06-25 02:00:00 +02:00
|
|
|
+ // CraftBukkit end
|
2021-11-21 23:00:00 +01:00
|
|
|
if (world.getBlockState(blockposition) == iblockdata) {
|
|
|
|
world.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockRedstoneWire.POWER, i), 2);
|
2020-06-25 02:00:00 +02:00
|
|
|
}
|