use of net.minecraft.world.level.levelgen.feature.blockplacers.DoublePlantPlacer in project Tropicraft by Tropicraft.
the class TropicraftBiomes method onBiomeLoad.
@SubscribeEvent
public static void onBiomeLoad(BiomeLoadingEvent event) {
ResourceLocation name = event.getName();
if (name != null && name.getNamespace().equals(Constants.MODID)) {
return;
}
Biome.BiomeCategory category = event.getCategory();
Biome.Precipitation precipitation = event.getClimate().precipitation;
if (precipitation == Biome.Precipitation.SNOW) {
return;
}
BiomeGenerationSettingsBuilder generation = event.getGeneration();
if (category == Biome.BiomeCategory.BEACH) {
generation.addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, TropicraftFeatures.NORMAL_PALM_TREE.get().configured(NoneFeatureConfiguration.INSTANCE).decorated(Features.Decorators.HEIGHTMAP_SQUARE).decorated(FeatureDecorator.COUNT_EXTRA.configured(new FrequencyWithExtraChanceDecoratorConfiguration(0, 0.08F, 1))));
generation.addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, TropicraftFeatures.CURVED_PALM_TREE.get().configured(NoneFeatureConfiguration.INSTANCE).decorated(Features.Decorators.HEIGHTMAP_SQUARE).decorated(FeatureDecorator.COUNT_EXTRA.configured(new FrequencyWithExtraChanceDecoratorConfiguration(0, 0.08F, 1))));
generation.addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, TropicraftFeatures.LARGE_PALM_TREE.get().configured(NoneFeatureConfiguration.INSTANCE).decorated(Features.Decorators.HEIGHTMAP_SQUARE).decorated(FeatureDecorator.COUNT_EXTRA.configured(new FrequencyWithExtraChanceDecoratorConfiguration(0, 0.08F, 1))));
} else if (category == Biome.BiomeCategory.JUNGLE) {
SimpleStateProvider state = new SimpleStateProvider(TropicraftBlocks.PINEAPPLE.get().defaultBlockState());
generation.addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, Feature.RANDOM_PATCH.configured(new RandomPatchConfiguration.GrassConfigurationBuilder(state, new DoublePlantPlacer()).tries(6).canReplace().build()).decorated(Features.Decorators.HEIGHTMAP_DOUBLE_SQUARE));
}
}
Aggregations