• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

CyclopsMC / IntegratedDynamics / 20210191346

14 Dec 2025 03:32PM UTC coverage: 19.514% (-33.5%) from 53.061%
20210191346

push

github

rubensworks
Remove deprecations

663 of 8728 branches covered (7.6%)

Branch coverage included in aggregate %.

6786 of 29445 relevant lines covered (23.05%)

1.09 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

26.67
/src/main/java/org/cyclops/integrateddynamics/block/BlockMechanicalSqueezer.java
1
package org.cyclops.integrateddynamics.block;
2

3
import com.mojang.serialization.MapCodec;
4
import net.minecraft.core.BlockPos;
5
import net.minecraft.world.InteractionResult;
6
import net.minecraft.world.entity.LivingEntity;
7
import net.minecraft.world.entity.player.Player;
8
import net.minecraft.world.item.ItemStack;
9
import net.minecraft.world.level.Level;
10
import net.minecraft.world.level.block.BaseEntityBlock;
11
import net.minecraft.world.level.block.Block;
12
import net.minecraft.world.level.block.entity.BlockEntity;
13
import net.minecraft.world.level.block.entity.BlockEntityTicker;
14
import net.minecraft.world.level.block.entity.BlockEntityType;
15
import net.minecraft.world.level.block.state.BlockState;
16
import net.minecraft.world.level.block.state.StateDefinition;
17
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
18
import net.minecraft.world.level.block.state.properties.BooleanProperty;
19
import net.minecraft.world.phys.BlockHitResult;
20
import net.neoforged.neoforge.transfer.fluid.FluidUtil;
21
import org.cyclops.cyclopscore.helper.IModHelpers;
22
import org.cyclops.integrateddynamics.RegistryEntries;
23
import org.cyclops.integrateddynamics.blockentity.BlockEntityMechanicalSqueezer;
24
import org.cyclops.integrateddynamics.core.block.BlockMechanicalMachine;
25

26
import javax.annotation.Nullable;
27

28
/**
29
 * A block that can expose variables.
30
 * @author rubensworks
31
 */
32
public class BlockMechanicalSqueezer extends BlockMechanicalMachine {
33

34
    public static final MapCodec<BlockMechanicalSqueezer> CODEC = simpleCodec(BlockMechanicalSqueezer::new);
3✔
35

36
    public static final String NBT_TANK = "tank";
37

38
    public static final BooleanProperty LIT = BlockStateProperties.LIT;
3✔
39

40
    public BlockMechanicalSqueezer(Properties properties) {
41
        super(properties, BlockEntityMechanicalSqueezer::new);
4✔
42

43
        this.registerDefaultState(this.stateDefinition.any()
8✔
44
                .setValue(LIT, false));
3✔
45
    }
1✔
46

47
    @Override
48
    protected MapCodec<? extends BaseEntityBlock> codec() {
49
        return CODEC;
×
50
    }
51

52
    @Override
53
    @Nullable
54
    public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState blockState, BlockEntityType<T> blockEntityType) {
55
        return level.isClientSide() ? null : createTickerHelper(blockEntityType, RegistryEntries.BLOCK_ENTITY_MECHANICAL_SQUEEZER.get(), new BlockEntityMechanicalSqueezer.Ticker());
×
56
    }
57

58
    @Override
59
    protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
60
        builder.add(LIT);
9✔
61
    }
1✔
62

63
    @Override
64
    public InteractionResult useWithoutItem(BlockState blockState, Level world, BlockPos blockPos, Player player, BlockHitResult rayTraceResult) {
65
        if (FluidUtil.interactWithFluidHandler(player, player.getUsedItemHand(), world, blockPos, rayTraceResult.getDirection())) {
×
66
            return InteractionResult.SUCCESS;
×
67
        }
68
        return super.useWithoutItem(blockState, world, blockPos, player, rayTraceResult);
×
69
    }
70

71
    @Override
72
    public void setPlacedBy(Level world, BlockPos blockPos, BlockState state, LivingEntity placer, ItemStack itemStack) {
73
        if (!world.isClientSide()) {
×
74
            IModHelpers.get().getBlockEntityHelpers().get(world, blockPos, BlockEntityMechanicalSqueezer.class)
×
75
                    .ifPresent(tile -> {
×
76
                        if (itemStack.has(org.cyclops.cyclopscore.RegistryEntries.COMPONENT_FLUID_CONTENT)) {
×
77
                            tile.getTank().setFluidInTank(0, itemStack.get(org.cyclops.cyclopscore.RegistryEntries.COMPONENT_FLUID_CONTENT).copy());
×
78
                        }
79
                    });
×
80
        }
81
        super.setPlacedBy(world, blockPos, state, placer, itemStack);
×
82
    }
×
83

84
    @Override
85
    protected boolean isPickBlockPersistData() {
86
        return true;
×
87
    }
88
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc