2015-05-25 12:37:24 +02:00
|
|
|
--- a/net/minecraft/server/BlockRedstoneWire.java
|
|
|
|
+++ b/net/minecraft/server/BlockRedstoneWire.java
|
2020-06-25 02:00:00 +02:00
|
|
|
@@ -9,6 +9,8 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
import java.util.Set;
|
2016-05-10 13:47:39 +02:00
|
|
|
import javax.annotation.Nullable;
|
2014-11-25 22:32:16 +01:00
|
|
|
|
|
|
|
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
|
|
|
|
+
|
|
|
|
public class BlockRedstoneWire extends Block {
|
|
|
|
|
2020-06-25 02:00:00 +02:00
|
|
|
public static final BlockStateEnum<BlockPropertyRedstoneSide> NORTH = BlockProperties.X;
|
2020-07-09 01:12:57 +02:00
|
|
|
@@ -213,7 +215,16 @@
|
2020-06-25 02:00:00 +02:00
|
|
|
private void a(World world, BlockPosition blockposition, IBlockData iblockdata) {
|
|
|
|
int i = this.a(world, blockposition);
|
2015-02-26 23:41:06 +01:00
|
|
|
|
2020-06-25 02:00:00 +02:00
|
|
|
- if ((Integer) iblockdata.get(BlockRedstoneWire.POWER) != i) {
|
2014-11-25 22:32:16 +01:00
|
|
|
+ // CraftBukkit start
|
2020-06-25 02:00:00 +02:00
|
|
|
+ int oldPower = (Integer) iblockdata.get(BlockRedstoneWire.POWER);
|
|
|
|
+ if (oldPower != i) {
|
|
|
|
+ BlockRedstoneEvent event = new BlockRedstoneEvent(world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), oldPower, i);
|
2014-11-25 22:32:16 +01:00
|
|
|
+ world.getServer().getPluginManager().callEvent(event);
|
|
|
|
+
|
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
|
|
|
|
if (world.getType(blockposition) == iblockdata) {
|
|
|
|
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneWire.POWER, i), 2);
|
|
|
|
}
|