2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/level/block/BlockDiodeAbstract.java
|
|
|
|
+++ b/net/minecraft/world/level/block/BlockDiodeAbstract.java
|
2023-06-07 17:30:00 +02:00
|
|
|
@@ -20,6 +20,8 @@
|
2021-03-15 23:00:00 +01:00
|
|
|
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
2021-11-21 23:00:00 +01:00
|
|
|
import net.minecraft.world.ticks.TickListPriority;
|
2014-11-25 22:32:16 +01:00
|
|
|
|
|
|
|
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
|
|
|
+
|
2016-02-29 22:32:46 +01:00
|
|
|
public abstract class BlockDiodeAbstract extends BlockFacingHorizontal {
|
2014-11-25 22:32:16 +01:00
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
protected static final VoxelShape SHAPE = Block.box(0.0D, 0.0D, 0.0D, 16.0D, 2.0D, 16.0D);
|
2023-06-07 17:30:00 +02:00
|
|
|
@@ -46,8 +48,18 @@
|
2021-11-21 23:00:00 +01:00
|
|
|
boolean flag1 = this.shouldTurnOn(worldserver, blockposition, iblockdata);
|
2014-11-25 22:32:16 +01:00
|
|
|
|
2018-07-15 02:00:00 +02:00
|
|
|
if (flag && !flag1) {
|
2014-11-25 22:32:16 +01:00
|
|
|
+ // CraftBukkit start
|
2019-12-10 23:00:00 +01:00
|
|
|
+ if (CraftEventFactory.callRedstoneChange(worldserver, blockposition, 15, 0).getNewCurrent() != 0) {
|
2014-11-25 22:32:16 +01:00
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2021-11-21 23:00:00 +01:00
|
|
|
worldserver.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockDiodeAbstract.POWERED, false), 2);
|
2018-07-15 02:00:00 +02:00
|
|
|
} else if (!flag) {
|
2014-11-25 22:32:16 +01:00
|
|
|
+ // CraftBukkit start
|
2019-12-10 23:00:00 +01:00
|
|
|
+ if (CraftEventFactory.callRedstoneChange(worldserver, blockposition, 0, 15).getNewCurrent() != 15) {
|
2014-11-25 22:32:16 +01:00
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2021-11-21 23:00:00 +01:00
|
|
|
worldserver.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockDiodeAbstract.POWERED, true), 2);
|
2018-07-15 02:00:00 +02:00
|
|
|
if (!flag1) {
|
2021-11-21 23:00:00 +01:00
|
|
|
worldserver.scheduleTick(blockposition, (Block) this, this.getDelay(iblockdata), TickListPriority.VERY_HIGH);
|