2015-05-25 12:37:24 +02:00
|
|
|
--- a/net/minecraft/server/BlockDiodeAbstract.java
|
|
|
|
+++ b/net/minecraft/server/BlockDiodeAbstract.java
|
2014-11-25 22:32:16 +01:00
|
|
|
@@ -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 {
|
2014-11-25 22:32:16 +01:00
|
|
|
|
2016-02-29 22:32:46 +01:00
|
|
|
protected static final AxisAlignedBB c = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.125D, 1.0D);
|
|
|
|
@@ -35,8 +37,18 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
boolean flag = this.e(world, blockposition, iblockdata);
|
|
|
|
|
2016-02-29 22:32:46 +01:00
|
|
|
if (this.d && !flag) {
|
2014-11-25 22:32:16 +01:00
|
|
|
+ // CraftBukkit start
|
|
|
|
+ if (CraftEventFactory.callRedstoneChange(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), 15, 0).getNewCurrent() != 0) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2017-05-19 13:00:13 +02:00
|
|
|
world.setTypeAndData(blockposition, this.z(iblockdata), 2);
|
2016-02-29 22:32:46 +01:00
|
|
|
} else if (!this.d) {
|
2014-11-25 22:32:16 +01:00
|
|
|
+ // CraftBukkit start
|
|
|
|
+ if (CraftEventFactory.callRedstoneChange(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), 0, 15).getNewCurrent() != 15) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2017-05-19 13:00:13 +02:00
|
|
|
world.setTypeAndData(blockposition, this.y(iblockdata), 2);
|
2014-11-25 22:32:16 +01:00
|
|
|
if (!flag) {
|
2017-05-19 13:00:13 +02:00
|
|
|
world.a(blockposition, this.y(iblockdata).getBlock(), this.E(iblockdata), -1);
|