From 19850b49b531ea013b817b0140d88204e6132001 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Thu, 3 Aug 2017 08:31:29 +1000 Subject: [PATCH] SPIGOT-3486: Missing check in redstone placement By: md_5 --- paper-server/nms-patches/ItemRedstone.patch | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 paper-server/nms-patches/ItemRedstone.patch diff --git a/paper-server/nms-patches/ItemRedstone.patch b/paper-server/nms-patches/ItemRedstone.patch new file mode 100644 index 0000000000..62cf2e3555 --- /dev/null +++ b/paper-server/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);