• 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

50.0
/src/main/java/org/cyclops/integrateddynamics/block/BlockCoalGenerator.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.BooleanProperty;
19
import net.minecraft.world.level.block.state.properties.EnumProperty;
20
import org.cyclops.cyclopscore.helper.IModHelpers;
21
import org.cyclops.integrateddynamics.RegistryEntries;
22
import org.cyclops.integrateddynamics.blockentity.BlockEntityCoalGenerator;
23
import org.cyclops.integrateddynamics.core.block.BlockWithEntityGuiCabled;
24

25
import javax.annotation.Nullable;
26

27
/**
28
 * A block that can generate energy from coal.
29
 * @author rubensworks
30
 */
31
public class BlockCoalGenerator extends BlockWithEntityGuiCabled {
32

33
    public static final MapCodec<BlockCoalGenerator> CODEC = simpleCodec(BlockCoalGenerator::new);
3✔
34
    public static final EnumProperty<Direction> FACING = BlockStateProperties.HORIZONTAL_FACING;
2✔
35
    public static final BooleanProperty LIT = BlockStateProperties.LIT;
3✔
36

37
    public BlockCoalGenerator(Properties properties) {
38
        super(properties, BlockEntityCoalGenerator::new);
4✔
39

40
        this.registerDefaultState(this.stateDefinition.any()
8✔
41
                .setValue(FACING, Direction.NORTH)
4✔
42
                .setValue(LIT, false));
3✔
43
    }
1✔
44

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

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

56
    @Override
57
    protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
58
        builder.add(FACING, LIT);
13✔
59
    }
1✔
60

61
    @Override
62
    public BlockState getStateForPlacement(BlockPlaceContext context) {
63
        return this.defaultBlockState().setValue(FACING, context.getHorizontalDirection().getOpposite());
×
64
    }
65

66
    @Override
67
    public void setPlacedBy(Level world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack) {
68
        super.setPlacedBy(world, pos, state, placer, itemStack);
×
69
        IModHelpers.get().getBlockEntityHelpers().get(world, pos, BlockEntityCoalGenerator.class)
×
70
                .ifPresent(BlockEntityCoalGenerator::updateBlockState);
×
71
    }
×
72

73
    @Override
74
    protected boolean isPickBlockPersistData() {
75
        return true;
×
76
    }
77
}
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