3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-20 21:40:06 +01:00
Paper/nms-patches/BlockDiodeAbstract.patch

31 Zeilen
1.4 KiB
Diff

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/BlockDiodeAbstract.java
+++ b/net/minecraft/server/BlockDiodeAbstract.java
@@ -2,6 +2,8 @@
import java.util.Random;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
2016-02-29 22:32:46 +01:00
public abstract class BlockDiodeAbstract extends BlockFacingHorizontal {
2018-07-15 02:00:00 +02:00
protected static final VoxelShape b = Block.a(0.0D, 0.0D, 0.0D, 16.0D, 2.0D, 16.0D);
2019-04-23 04:00:00 +02:00
@@ -28,8 +30,18 @@
2019-12-10 23:00:00 +01:00
boolean flag1 = this.a((World) worldserver, blockposition, iblockdata);
2018-07-15 02:00:00 +02:00
if (flag && !flag1) {
+ // CraftBukkit start
2019-12-10 23:00:00 +01:00
+ if (CraftEventFactory.callRedstoneChange(worldserver, blockposition, 15, 0).getNewCurrent() != 0) {
+ return;
+ }
+ // CraftBukkit end
2019-12-10 23:00:00 +01:00
worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockDiodeAbstract.c, false), 2);
2018-07-15 02:00:00 +02:00
} else if (!flag) {
+ // CraftBukkit start
2019-12-10 23:00:00 +01:00
+ if (CraftEventFactory.callRedstoneChange(worldserver, blockposition, 0, 15).getNewCurrent() != 15) {
+ return;
+ }
+ // CraftBukkit end
2019-12-10 23:00:00 +01:00
worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockDiodeAbstract.c, true), 2);
2018-07-15 02:00:00 +02:00
if (!flag1) {
2019-12-10 23:00:00 +01:00
worldserver.getBlockTickList().a(blockposition, this, this.h(iblockdata), TickListPriority.VERY_HIGH);