mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-26 12:36:07 +01:00
31 lines
1.3 KiB
Diff
31 lines
1.3 KiB
Diff
--- 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.w;
|
|
@@ -29,8 +31,18 @@
|
|
@Override
|
|
public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
|
|
if ((Boolean) iblockdata.get(BlockObserver.b)) {
|
|
+ // CraftBukkit start
|
|
+ if (CraftEventFactory.callRedstoneChange(worldserver, blockposition, 15, 0).getNewCurrent() != 0) {
|
|
+ return;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockObserver.b, false), 2);
|
|
} else {
|
|
+ // CraftBukkit start
|
|
+ if (CraftEventFactory.callRedstoneChange(worldserver, blockposition, 0, 15).getNewCurrent() != 15) {
|
|
+ return;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockObserver.b, true), 2);
|
|
worldserver.getBlockTickList().a(blockposition, this, 2);
|
|
}
|