use of com.almuradev.almura.feature.complex.item.almanac.asm.interfaces.IMixinBlockCrops in project Almura by AlmuraDev.
the class IngameFarmersAlmanac method getGrowthStage.
private static Optional<Tuple<Integer, Integer>> getGrowthStage(IBlockState blockState) {
final Block block = blockState.getBlock();
if (block instanceof IMixinBlockCrops) {
final BlockCrops blockCrops = (BlockCrops) block;
final PropertyInteger ageProperty = ((IMixinBlockCrops) block).getAgePropertyDirect();
if (blockState.getProperties().containsKey(ageProperty)) {
return Optional.of(Tuple.of((blockState.getValue(ageProperty)), blockCrops.getMaxAge()));
}
}
return Optional.empty();
}
Aggregations