mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-24 17:22:55 +01:00
SPIGOT-1984: Fix default interact state when sneaking
By: md_5 <git@md-5.net>
This commit is contained in:
parent
ed3feb34bd
commit
817347613d
1 changed files with 4 additions and 2 deletions
|
@ -226,11 +226,11 @@
|
||||||
if (this.gamemode == WorldSettings.EnumGamemode.SPECTATOR) {
|
if (this.gamemode == WorldSettings.EnumGamemode.SPECTATOR) {
|
||||||
TileEntity tileentity = world.getTileEntity(blockposition);
|
TileEntity tileentity = world.getTileEntity(blockposition);
|
||||||
|
|
||||||
@@ -329,6 +464,72 @@
|
@@ -329,6 +464,74 @@
|
||||||
return itemstack.placeItem(entityhuman, world, blockposition, enumhand, enumdirection, f, f1, f2);
|
return itemstack.placeItem(entityhuman, world, blockposition, enumhand, enumdirection, f, f1, f2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+ // Interract event */
|
+ // Interact event */
|
||||||
+ IBlockData blockdata = world.getType(blockposition);
|
+ IBlockData blockdata = world.getType(blockposition);
|
||||||
+ EnumInteractionResult result = EnumInteractionResult.FAIL;
|
+ EnumInteractionResult result = EnumInteractionResult.FAIL;
|
||||||
+ if (blockdata.getBlock() != Blocks.AIR) {
|
+ if (blockdata.getBlock() != Blocks.AIR) {
|
||||||
|
@ -239,6 +239,8 @@
|
||||||
+ if (this.gamemode == WorldSettings.EnumGamemode.SPECTATOR) {
|
+ if (this.gamemode == WorldSettings.EnumGamemode.SPECTATOR) {
|
||||||
+ TileEntity tileentity = world.getTileEntity(blockposition);
|
+ TileEntity tileentity = world.getTileEntity(blockposition);
|
||||||
+ cancelledBlock = !(tileentity instanceof ITileInventory || tileentity instanceof IInventory);
|
+ 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) {
|
+ if (!entityhuman.getBukkitEntity().isOp() && itemstack != null && Block.asBlock(itemstack.getItem()) instanceof BlockCommand) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue