Archiviert
13
0
Dieses Repository wurde am 2024-12-25 archiviert. Du kannst Dateien ansehen und es klonen, aber nicht pushen oder Issues/Pull-Requests öffnen.
Paper-Old/nms-patches/BlockCommand.patch

39 Zeilen
1.7 KiB
Diff

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/BlockCommand.java
+++ b/net/minecraft/server/BlockCommand.java
2016-11-17 02:41:03 +01:00
@@ -2,6 +2,8 @@
import java.util.Random;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
2016-02-29 22:32:46 +01:00
public class BlockCommand extends BlockTileEntity {
2016-02-29 22:32:46 +01:00
public static final BlockStateDirection a = BlockDirectional.FACING;
2016-11-17 02:41:03 +01:00
@@ -29,7 +31,16 @@
boolean flag1 = tileentitycommand.f();
2016-06-09 03:43:49 +02:00
boolean flag2 = tileentitycommand.h();
2015-02-26 23:41:06 +01:00
2016-02-29 22:32:46 +01:00
- if (flag && !flag1) {
+ // CraftBukkit start
+ org.bukkit.block.Block bukkitBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
+ int old = flag1 ? 15 : 0;
+ int current = flag ? 15 : 0;
+
+ BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(bukkitBlock, old, current);
+ world.getServer().getPluginManager().callEvent(eventRedstone);
+ // CraftBukkit end
2015-02-26 23:41:06 +01:00
+
+ if (eventRedstone.getNewCurrent() > 0 && !(eventRedstone.getOldCurrent() > 0)) { // CraftBukkit
2016-02-29 22:32:46 +01:00
tileentitycommand.a(true);
2016-06-09 03:43:49 +02:00
if (tileentitycommand.k() != TileEntityCommand.Type.SEQUENCE && !flag2) {
boolean flag3 = !tileentitycommand.l() || this.e(world, blockposition, iblockdata);
2016-11-17 02:41:03 +01:00
@@ -40,7 +51,7 @@
2016-02-29 22:32:46 +01:00
this.c(world, blockposition);
}
}
- } else if (!flag && flag1) {
+ } else if (!(eventRedstone.getNewCurrent() > 0) && eventRedstone.getOldCurrent() > 0) { // CraftBukkit
2016-02-29 22:32:46 +01:00
tileentitycommand.a(false);
}