summaryrefslogtreecommitdiffstats
path: root/nms-patches
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2016-03-20 16:53:36 +1100
committermd_5 <git@md-5.net>2016-03-20 16:53:36 +1100
commitc91d092bcd5ed17990aca0583092c820a2cc0449 (patch)
tree43c594afdd12f91164deed706e9aac1c153fec9b /nms-patches
parent622014a3b45e09eb12d721387ad16809afc8d144 (diff)
downloadcraftbukkit-c91d092bcd5ed17990aca0583092c820a2cc0449.tar
craftbukkit-c91d092bcd5ed17990aca0583092c820a2cc0449.tar.gz
craftbukkit-c91d092bcd5ed17990aca0583092c820a2cc0449.tar.lz
craftbukkit-c91d092bcd5ed17990aca0583092c820a2cc0449.tar.xz
craftbukkit-c91d092bcd5ed17990aca0583092c820a2cc0449.zip
SPIGOT-1993: Move hand check to proper location
Diffstat (limited to 'nms-patches')
-rw-r--r--nms-patches/PlayerInteractManager.patch6
1 files changed, 2 insertions, 4 deletions
diff --git a/nms-patches/PlayerInteractManager.patch b/nms-patches/PlayerInteractManager.patch
index e72026f8..6db3d666 100644
--- a/nms-patches/PlayerInteractManager.patch
+++ b/nms-patches/PlayerInteractManager.patch
@@ -226,7 +226,7 @@
if (this.gamemode == WorldSettings.EnumGamemode.SPECTATOR) {
TileEntity tileentity = world.getTileEntity(blockposition);
-@@ -329,6 +464,74 @@
+@@ -329,6 +464,72 @@
return itemstack.placeItem(entityhuman, world, blockposition, enumhand, enumdirection, f, f1, f2);
}
}
@@ -239,8 +239,6 @@
+ if (this.gamemode == WorldSettings.EnumGamemode.SPECTATOR) {
+ TileEntity tileentity = world.getTileEntity(blockposition);
+ cancelledBlock = !(tileentity instanceof ITileInventory || tileentity instanceof IInventory);
-+ } else {
-+ cancelledBlock = !(!entityhuman.isSneaking() || entityhuman.getItemInMainHand() == null && entityhuman.getItemInOffHand() == null); // From above
+ }
+
+ if (!entityhuman.getBukkitEntity().isOp() && itemstack != null && Block.asBlock(itemstack.getItem()) instanceof BlockCommand) {
@@ -279,7 +277,7 @@
+ }
+
+ return EnumInteractionResult.PASS;
-+ } else if (!entityhuman.isSneaking() || itemstack == null) {
++ } else if (!entityhuman.isSneaking() || entityhuman.getItemInMainHand() == null && entityhuman.getItemInOffHand() == null) {
+ result = blockdata.getBlock().interact(world, blockposition, blockdata, entityhuman, enumhand, itemstack, enumdirection, f, f1, f2) ? EnumInteractionResult.SUCCESS : EnumInteractionResult.PASS;
+ }
+