Skip to content

Commit

Permalink
Require empty hand to shift click open covers (#388)
Browse files Browse the repository at this point in the history
  • Loading branch information
ALongStringOfNumbers authored Dec 21, 2021
1 parent 6d477a4 commit 7bde516
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ public boolean onRightClick(EntityPlayer playerIn, EnumHand hand, EnumFacing fac
MetaTileEntityUIFactory.INSTANCE.openUI(getHolder(), (EntityPlayerMP) playerIn);
}
return true;
} else if (playerIn.isSneaking()) {
} else if (playerIn.isSneaking() && playerIn.getHeldItemMainhand().isEmpty()) {
EnumFacing hitFacing = hitResult.sideHit;

CoverBehavior coverBehavior = hitFacing == null ? null : getCoverAtSide(hitFacing);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/gregtech/api/pipenet/block/BlockPipe.java
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ public boolean onPipeActivated(World world, BlockPos pos, EntityPlayer entityPla

EnumActionResult result = coverBehavior.onRightClick(entityPlayer, hand, hit);
if (result == EnumActionResult.PASS) {
return entityPlayer.isSneaking() && coverBehavior.onScrewdriverClick(entityPlayer, hand, hit) != EnumActionResult.PASS;
return entityPlayer.isSneaking() && entityPlayer.getHeldItemMainhand().isEmpty() && coverBehavior.onScrewdriverClick(entityPlayer, hand, hit) != EnumActionResult.PASS;
} else if (result == EnumActionResult.SUCCESS) {
if (!world.isRemote)
GTTriggers.FIRST_COVER_PLACE.trigger((EntityPlayerMP) entityPlayer);
Expand Down

0 comments on commit 7bde516

Please sign in to comment.