summaryrefslogtreecommitdiffstats
path: root/nms-patches/ItemRedstone.patch
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2017-08-03 08:31:29 +1000
committermd_5 <git@md-5.net>2017-08-03 08:31:29 +1000
commit57c323aad171cd38445976ed0748b78b0358600b (patch)
tree84d68798bf10504a7e8e9b947aa0ee7ea6fb6d17 /nms-patches/ItemRedstone.patch
parentb5dc294d32b43514929d35e86e4a45b807d543ca (diff)
downloadcraftbukkit-57c323aad171cd38445976ed0748b78b0358600b.tar
craftbukkit-57c323aad171cd38445976ed0748b78b0358600b.tar.gz
craftbukkit-57c323aad171cd38445976ed0748b78b0358600b.tar.lz
craftbukkit-57c323aad171cd38445976ed0748b78b0358600b.tar.xz
craftbukkit-57c323aad171cd38445976ed0748b78b0358600b.zip
SPIGOT-3486: Missing check in redstone placement
Diffstat (limited to 'nms-patches/ItemRedstone.patch')
-rw-r--r--nms-patches/ItemRedstone.patch11
1 files changed, 11 insertions, 0 deletions
diff --git a/nms-patches/ItemRedstone.patch b/nms-patches/ItemRedstone.patch
new file mode 100644
index 00000000..62cf2e35
--- /dev/null
+++ b/nms-patches/ItemRedstone.patch
@@ -0,0 +1,11 @@
+--- a/net/minecraft/server/ItemRedstone.java
++++ b/net/minecraft/server/ItemRedstone.java
+@@ -11,7 +11,7 @@
+ BlockPosition blockposition1 = flag ? blockposition : blockposition.shift(enumdirection);
+ ItemStack itemstack = entityhuman.b(enumhand);
+
+- if (entityhuman.a(blockposition1, enumdirection, itemstack) && world.a(world.getType(blockposition1).getBlock(), blockposition1, false, enumdirection, (Entity) null) && Blocks.REDSTONE_WIRE.canPlace(world, blockposition1)) {
++ if (!itemstack.isEmpty() && entityhuman.a(blockposition1, enumdirection, itemstack) && world.a(world.getType(blockposition1).getBlock(), blockposition1, false, enumdirection, (Entity) null) && Blocks.REDSTONE_WIRE.canPlace(world, blockposition1)) { // CraftBukkit
+ world.setTypeUpdate(blockposition1, Blocks.REDSTONE_WIRE.getBlockData());
+ if (entityhuman instanceof EntityPlayer) {
+ CriterionTriggers.x.a((EntityPlayer) entityhuman, blockposition1, itemstack);