From 8a7388ab57551cfc286c0d05989f3b6db4374dd4 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 28 May 2020 14:47:25 +0200 Subject: [PATCH] Fixed pipes being openable with a non-empty hand Closes #23 --- src/main/java/de/ellpeck/prettypipes/pipe/PipeBlock.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/ellpeck/prettypipes/pipe/PipeBlock.java b/src/main/java/de/ellpeck/prettypipes/pipe/PipeBlock.java index 951a2c7..6e2d9df 100644 --- a/src/main/java/de/ellpeck/prettypipes/pipe/PipeBlock.java +++ b/src/main/java/de/ellpeck/prettypipes/pipe/PipeBlock.java @@ -83,10 +83,12 @@ public class PipeBlock extends ContainerBlock implements IPipeConnectable { stack.shrink(1); return ActionResultType.SUCCESS; } + } else if (handIn == Hand.MAIN_HAND && stack.isEmpty()) { + if (!worldIn.isRemote) + NetworkHooks.openGui((ServerPlayerEntity) player, tile, pos); + return ActionResultType.SUCCESS; } - if (!worldIn.isRemote) - NetworkHooks.openGui((ServerPlayerEntity) player, tile, pos); - return ActionResultType.SUCCESS; + return ActionResultType.PASS; } @Override