diff options
author | md_5 <git@md-5.net> | 2016-03-20 13:48:21 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2016-03-20 13:48:21 +1100 |
commit | 622014a3b45e09eb12d721387ad16809afc8d144 (patch) | |
tree | 2ab832b20e6faecd3278c4ea27c956137363804b /nms-patches | |
parent | 6cac62c64d8f851e0ed7c4c989cfe21cc46e7050 (diff) | |
download | craftbukkit-622014a3b45e09eb12d721387ad16809afc8d144.tar craftbukkit-622014a3b45e09eb12d721387ad16809afc8d144.tar.gz craftbukkit-622014a3b45e09eb12d721387ad16809afc8d144.tar.lz craftbukkit-622014a3b45e09eb12d721387ad16809afc8d144.tar.xz craftbukkit-622014a3b45e09eb12d721387ad16809afc8d144.zip |
SPIGOT-1984: Fix default interact state when sneaking
Diffstat (limited to 'nms-patches')
-rw-r--r-- | nms-patches/PlayerInteractManager.patch | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/nms-patches/PlayerInteractManager.patch b/nms-patches/PlayerInteractManager.patch index 7572d5f6..e72026f8 100644 --- a/nms-patches/PlayerInteractManager.patch +++ b/nms-patches/PlayerInteractManager.patch @@ -226,11 +226,11 @@ if (this.gamemode == WorldSettings.EnumGamemode.SPECTATOR) { TileEntity tileentity = world.getTileEntity(blockposition); -@@ -329,6 +464,72 @@ +@@ -329,6 +464,74 @@ return itemstack.placeItem(entityhuman, world, blockposition, enumhand, enumdirection, f, f1, f2); } } -+ // Interract event */ ++ // Interact event */ + IBlockData blockdata = world.getType(blockposition); + EnumInteractionResult result = EnumInteractionResult.FAIL; + if (blockdata.getBlock() != Blocks.AIR) { @@ -239,6 +239,8 @@ + 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) { |