mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 03:52:45 +01:00
b3a8254758
By: md_5 <git@md-5.net>
30 lines
1.5 KiB
Diff
30 lines
1.5 KiB
Diff
--- a/net/minecraft/world/level/block/BlockDiodeAbstract.java
|
|
+++ b/net/minecraft/world/level/block/BlockDiodeAbstract.java
|
|
@@ -20,6 +20,8 @@
|
|
import net.minecraft.world.phys.shapes.VoxelShape;
|
|
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
|
|
|
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
|
+
|
|
public abstract class BlockDiodeAbstract extends BlockFacingHorizontal {
|
|
|
|
protected static final VoxelShape SHAPE = Block.a(0.0D, 0.0D, 0.0D, 16.0D, 2.0D, 16.0D);
|
|
@@ -46,8 +48,18 @@
|
|
boolean flag1 = this.a((World) worldserver, blockposition, iblockdata);
|
|
|
|
if (flag && !flag1) {
|
|
+ // CraftBukkit start
|
|
+ if (CraftEventFactory.callRedstoneChange(worldserver, blockposition, 15, 0).getNewCurrent() != 0) {
|
|
+ return;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockDiodeAbstract.POWERED, false), 2);
|
|
} else if (!flag) {
|
|
+ // CraftBukkit start
|
|
+ if (CraftEventFactory.callRedstoneChange(worldserver, blockposition, 0, 15).getNewCurrent() != 15) {
|
|
+ return;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockDiodeAbstract.POWERED, true), 2);
|
|
if (!flag1) {
|
|
worldserver.getBlockTickList().a(blockposition, this, this.g(iblockdata), TickListPriority.VERY_HIGH);
|