package net.minecraft.world.level.levelgen.feature; import com.mojang.serialization.Codec; import net.minecraft.core.BlockPos; import net.minecraft.tags.BlockTags; import net.minecraft.util.RandomSource; import net.minecraft.world.level.WorldGenLevel; import net.minecraft.world.level.block.ChorusFlowerBlock; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; public class ChorusPlantFeature extends Feature { public ChorusPlantFeature(final Codec codec) { super(codec); } @Override public boolean place(final FeaturePlaceContext context) { WorldGenLevel level = context.level(); BlockPos origin = context.origin(); RandomSource random = context.random(); if (level.isEmptyBlock(origin) && level.getBlockState(origin.below()).is(BlockTags.SUPPORTS_CHORUS_PLANT)) { ChorusFlowerBlock.generatePlant(level, origin, random, 8); return true; } else { return false; } } }