• 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

29.63
/src/main/java/org/cyclops/integrateddynamics/block/BlockDelay.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.entity.LivingEntity;
7
import net.minecraft.world.item.ItemStack;
8
import net.minecraft.world.item.context.BlockPlaceContext;
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.EnumProperty;
19
import org.cyclops.cyclopscore.helper.IModHelpers;
20
import org.cyclops.integrateddynamics.RegistryEntries;
21
import org.cyclops.integrateddynamics.blockentity.BlockEntityDelay;
22
import org.cyclops.integrateddynamics.core.block.BlockWithEntityGuiCabled;
23

24
import javax.annotation.Nullable;
25

26
/**
27
 * A block that can delay variables.
28
 * @author rubensworks
29
 */
30
public class BlockDelay extends BlockWithEntityGuiCabled {
31

32
    public static final MapCodec<BlockDelay> CODEC = simpleCodec(BlockDelay::new);
3✔
33
    public static final EnumProperty<Direction> FACING = BlockStateProperties.HORIZONTAL_FACING;
3✔
34

35
    public BlockDelay(Properties properties) {
36
        super(properties, BlockEntityDelay::new);
4✔
37
        this.registerDefaultState(this.stateDefinition.any()
8✔
38
                .setValue(FACING, Direction.NORTH));
2✔
39
    }
1✔
40

41
    @Override
42
    protected MapCodec<? extends BaseEntityBlock> codec() {
43
        return CODEC;
×
44
    }
45

46
    @Override
47
    @Nullable
48
    public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState blockState, BlockEntityType<T> blockEntityType) {
49
        return level.isClientSide() ? null : createTickerHelper(blockEntityType, RegistryEntries.BLOCK_ENTITY_DELAY.get(), new BlockEntityDelay.Ticker());
×
50
    }
51

52
    @Override
53
    protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
54
        builder.add(FACING);
9✔
55
    }
1✔
56

57
    public BlockState getStateForPlacement(BlockPlaceContext context) {
58
        return this.defaultBlockState().setValue(FACING, context.getHorizontalDirection().getOpposite());
×
59
    }
60

61
    @Override
62
    public void setPlacedBy(Level world, BlockPos blockPos, BlockState state, LivingEntity placer, ItemStack itemStack) {
63
        if (!world.isClientSide()) {
×
64
            IModHelpers.get().getBlockEntityHelpers().get(world, blockPos, BlockEntityDelay.class)
×
65
                    .ifPresent(tile -> {
×
66
                        if (itemStack.has(RegistryEntries.DATACOMPONENT_PROXY_ID)) {
×
67
                            tile.setProxyId(itemStack.get(RegistryEntries.DATACOMPONENT_PROXY_ID));
×
68
                        } else {
69
                            tile.generateNewProxyId();
×
70
                        }
71
                        tile.setChanged();
×
72
                    });
×
73
        }
74
        super.setPlacedBy(world, blockPos, state, placer, itemStack);
×
75
    }
×
76
}
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