Search in sources :

Example 1 with CropBlockImpl

use of com.almuradev.content.type.block.type.crop.CropBlockImpl in project Almura by AlmuraDev.

the class IngameFarmersAlmanac method getBlockStateDefinition.

private static Optional<CropBlockStateDefinition> getBlockStateDefinition(IBlockState blockState) {
    final Block block = blockState.getBlock();
    if (block instanceof CropBlockImpl) {
        final CropBlockImpl cropBlockImpl = (CropBlockImpl) block;
        final int age = blockState.getValue(cropBlockImpl.getAgeProperty());
        return Optional.of(cropBlockImpl.state(age));
    }
    return Optional.empty();
}
Also used : CropBlockImpl(com.almuradev.content.type.block.type.crop.CropBlockImpl) Block(net.minecraft.block.Block) EnumSkyBlock(net.minecraft.world.EnumSkyBlock)

Aggregations

CropBlockImpl (com.almuradev.content.type.block.type.crop.CropBlockImpl)1 Block (net.minecraft.block.Block)1 EnumSkyBlock (net.minecraft.world.EnumSkyBlock)1