mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 12:02:36 +01:00
9da047989c
By: md_5 <git@md-5.net>
30 lines
1.4 KiB
Diff
30 lines
1.4 KiB
Diff
--- a/net/minecraft/world/level/block/BlockObserver.java
|
|
+++ b/net/minecraft/world/level/block/BlockObserver.java
|
|
@@ -14,6 +14,8 @@
|
|
import net.minecraft.world.level.block.state.properties.BlockProperties;
|
|
import net.minecraft.world.level.block.state.properties.BlockStateBoolean;
|
|
|
|
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
|
+
|
|
public class BlockObserver extends BlockDirectional {
|
|
|
|
public static final BlockStateBoolean b = BlockProperties.w;
|
|
@@ -41,8 +43,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);
|
|
}
|