• 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

22.86
/src/main/java/org/cyclops/integrateddynamics/block/BlockMechanicalDryingBasin.java
1
package org.cyclops.integrateddynamics.block;
2

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

30
import javax.annotation.Nullable;
31

32
/**
33
 * A block that can expose variables.
34
 * @author rubensworks
35
 */
36
public class BlockMechanicalDryingBasin extends BlockMechanicalMachine {
37

38
    public static final MapCodec<BlockMechanicalDryingBasin> CODEC = simpleCodec(BlockMechanicalDryingBasin::new);
3✔
39

40
    public static final BooleanProperty LIT = BlockStateProperties.LIT;
3✔
41

42
    public BlockMechanicalDryingBasin(Properties properties) {
43
        super(properties, BlockEntityMechanicalDryingBasin::new);
4✔
44

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

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

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

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

65
    @Override
66
    public InteractionResult useWithoutItem(BlockState blockState, Level world, BlockPos blockPos, Player player, BlockHitResult rayTraceResult) {
67
        if (FluidUtil.interactWithFluidHandler(player, player.getUsedItemHand(), world, blockPos, Direction.UP)
×
68
                || FluidUtil.interactWithFluidHandler(player, player.getUsedItemHand(), world, blockPos, Direction.DOWN)) {
×
69
            return InteractionResult.SUCCESS;
×
70
        }
71
        return super.useWithoutItem(blockState, world, blockPos, player, rayTraceResult);
×
72
    }
73

74
    @Override
75
    public void setPlacedBy(Level world, BlockPos blockPos, BlockState state, LivingEntity placer, ItemStack itemStack) {
76
        if (!world.isClientSide()) {
×
77
            IModHelpers.get().getBlockEntityHelpers().get(world, blockPos, BlockEntityMechanicalDryingBasin.class)
×
78
                    .ifPresent(tile -> {
×
79
                        if (itemStack.has(RegistryEntries.DATACOMPONENT_FLUID_CONTENT_IN_OUT)) {
×
80
                            Pair<SimpleFluidContent, SimpleFluidContent> tanks = itemStack.get(RegistryEntries.DATACOMPONENT_FLUID_CONTENT_IN_OUT);
×
81
                            tile.getTankInput().setFluid(tanks.getLeft().copy());
×
82
                            tile.getTankOutput().setFluid(tanks.getLeft().copy());
×
83
                        }
84
                    });
×
85
        }
86
        super.setPlacedBy(world, blockPos, state, placer, itemStack);
×
87
    }
×
88

89
    @Override
90
    protected boolean isPickBlockPersistData() {
91
        return true;
×
92
    }
93
}
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