summaryrefslogtreecommitdiffstats
path: root/nms-patches/BlockCommand.patch
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2017-05-14 12:00:00 +1000
committermd_5 <git@md-5.net>2017-05-14 12:00:00 +1000
commit5195487ec6c01a80e3a2fca8c4acfc6b9524fcf5 (patch)
tree0314ba59f51141bb5e0e7ff6ca7723d168ac94b9 /nms-patches/BlockCommand.patch
parent6e3cec8bc78269d72ef7ef49ce82a5eadfb9615a (diff)
downloadcraftbukkit-5195487ec6c01a80e3a2fca8c4acfc6b9524fcf5.tar
craftbukkit-5195487ec6c01a80e3a2fca8c4acfc6b9524fcf5.tar.gz
craftbukkit-5195487ec6c01a80e3a2fca8c4acfc6b9524fcf5.tar.lz
craftbukkit-5195487ec6c01a80e3a2fca8c4acfc6b9524fcf5.tar.xz
craftbukkit-5195487ec6c01a80e3a2fca8c4acfc6b9524fcf5.zip
Update to Minecraft 1.12-pre2
Diffstat (limited to 'nms-patches/BlockCommand.patch')
-rw-r--r--nms-patches/BlockCommand.patch45
1 files changed, 17 insertions, 28 deletions
diff --git a/nms-patches/BlockCommand.patch b/nms-patches/BlockCommand.patch
index 808f7944..12a88a41 100644
--- a/nms-patches/BlockCommand.patch
+++ b/nms-patches/BlockCommand.patch
@@ -1,38 +1,27 @@
--- a/net/minecraft/server/BlockCommand.java
+++ b/net/minecraft/server/BlockCommand.java
-@@ -2,6 +2,8 @@
-
- import java.util.Random;
+@@ -4,6 +4,8 @@
+ import org.apache.logging.log4j.LogManager;
+ import org.apache.logging.log4j.Logger;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
public class BlockCommand extends BlockTileEntity {
- public static final BlockStateDirection a = BlockDirectional.FACING;
-@@ -29,7 +31,16 @@
+ private static final Logger c = LogManager.getLogger();
+@@ -30,6 +32,15 @@
+ TileEntityCommand tileentitycommand = (TileEntityCommand) tileentity;
+ boolean flag = world.isBlockIndirectlyPowered(blockposition);
boolean flag1 = tileentitycommand.f();
- boolean flag2 = tileentitycommand.h();
-
-- 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
++ // 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;
+
-+ if (eventRedstone.getNewCurrent() > 0 && !(eventRedstone.getOldCurrent() > 0)) { // CraftBukkit
- tileentitycommand.a(true);
- if (tileentitycommand.k() != TileEntityCommand.Type.SEQUENCE && !flag2) {
- boolean flag3 = !tileentitycommand.l() || this.e(world, blockposition, iblockdata);
-@@ -40,7 +51,7 @@
- this.c(world, blockposition);
- }
- }
-- } else if (!flag && flag1) {
-+ } else if (!(eventRedstone.getNewCurrent() > 0) && eventRedstone.getOldCurrent() > 0) { // CraftBukkit
- tileentitycommand.a(false);
- }
++ BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(bukkitBlock, old, current);
++ world.getServer().getPluginManager().callEvent(eventRedstone);
++ flag = eventRedstone.getNewCurrent() > 0;
++ // CraftBukkit end
+ tileentitycommand.a(flag);
+ if (!flag1 && !tileentitycommand.h() && tileentitycommand.l() != TileEntityCommand.Type.SEQUENCE) {