2018-08-09 14:44:57 +02:00
|
|
|
--- a/net/minecraft/server/BlockObserver.java
|
|
|
|
+++ b/net/minecraft/server/BlockObserver.java
|
|
|
|
@@ -2,6 +2,8 @@
|
|
|
|
|
|
|
|
import java.util.Random;
|
|
|
|
|
|
|
|
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
|
|
|
+
|
|
|
|
public class BlockObserver extends BlockDirectional {
|
|
|
|
|
|
|
|
public static final BlockStateBoolean b = BlockProperties.t;
|
|
|
|
@@ -25,8 +27,18 @@
|
|
|
|
|
|
|
|
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) {
|
2018-12-06 00:00:00 +01:00
|
|
|
if ((Boolean) iblockdata.get(BlockObserver.b)) {
|
2018-08-09 14:44:57 +02:00
|
|
|
+ // CraftBukkit start
|
|
|
|
+ if (CraftEventFactory.callRedstoneChange(world, blockposition, 15, 0).getNewCurrent() != 0) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2018-12-06 00:00:00 +01:00
|
|
|
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockObserver.b, false), 2);
|
2018-08-09 14:44:57 +02:00
|
|
|
} else {
|
|
|
|
+ // CraftBukkit start
|
|
|
|
+ if (CraftEventFactory.callRedstoneChange(world, blockposition, 0, 15).getNewCurrent() != 15) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2018-12-06 00:00:00 +01:00
|
|
|
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockObserver.b, true), 2);
|
2018-08-26 04:00:00 +02:00
|
|
|
world.J().a(blockposition, this, 2);
|
2018-08-09 14:44:57 +02:00
|
|
|
}
|