Fixed pipes being openable with a non-empty hand

Closes #23
This commit is contained in:
Ellpeck 2020-05-28 14:47:25 +02:00
parent 6de652761a
commit 8a7388ab57

View file

@ -83,11 +83,13 @@ public class PipeBlock extends ContainerBlock implements IPipeConnectable {
stack.shrink(1); stack.shrink(1);
return ActionResultType.SUCCESS; return ActionResultType.SUCCESS;
} }
} } else if (handIn == Hand.MAIN_HAND && stack.isEmpty()) {
if (!worldIn.isRemote) if (!worldIn.isRemote)
NetworkHooks.openGui((ServerPlayerEntity) player, tile, pos); NetworkHooks.openGui((ServerPlayerEntity) player, tile, pos);
return ActionResultType.SUCCESS; return ActionResultType.SUCCESS;
} }
return ActionResultType.PASS;
}
@Override @Override
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) { protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {