Fix right clicking the coffee maker being wonky

This commit is contained in:
Mrbysco 2024-03-09 17:51:11 +01:00
parent d4cc7b0737
commit 09673dd118

View file

@ -35,16 +35,17 @@ public class BlockCoffeeMachine extends DirectionalBlock.Container {
@Override @Override
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) { public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
if (!world.isClientSide) { if (world.isClientSide) {
return InteractionResult.SUCCESS;
} else {
TileEntityCoffeeMachine tile = (TileEntityCoffeeMachine) world.getBlockEntity(pos); TileEntityCoffeeMachine tile = (TileEntityCoffeeMachine) world.getBlockEntity(pos);
if (tile != null) { if (tile != null) {
if (!this.tryUseItemOnTank(player, hand, tile.tank)) { if (!this.tryUseItemOnTank(player, hand, tile.tank)) {
player.openMenu(tile, pos); player.openMenu(tile, pos);
} }
} }
return InteractionResult.PASS; return InteractionResult.CONSUME;
} }
return super.use(state, world, pos, player, hand, hit);
} }
@Nullable @Nullable