net.minecraft.world.gen.feature.FeatureConfig Java Examples

The following examples show how to use net.minecraft.world.gen.feature.FeatureConfig. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PumpkinPatchBiome.java    From the-hallow with MIT License 6 votes vote down vote up
public PumpkinPatchBiome() {
	super(new Settings().surfaceBuilder(SURFACE_BUILDER).precipitation(Precipitation.NONE).category(Category.PLAINS).depth(0.125f).scale(0.07f).temperature(0.7f).downfall(0.8f).waterColor(0x3F76E4).waterFogColor(0x050533));
	
	GRASS_COLOR = 0xC9C92A;
	FOLIAGE_COLOR = 0xC9C92A;
	
	this.addStructureFeature(Feature.MINESHAFT.configure(new MineshaftFeatureConfig(0.004D, MineshaftFeature.Type.NORMAL)));
	
	HallowedBiomeFeatures.addGrass(this);
	HallowedBiomeFeatures.addLakes(this);
	//is not the same as other biome pumpkins, do not use HallowedBiomeFeatures pumpkins
	this.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, HallowedBiomeFeatures.configureFeature(HallowedFeatures.COLORED_PUMPKIN, FeatureConfig.DEFAULT, Decorator.COUNT_HEIGHTMAP_DOUBLE, new CountDecoratorConfig(10)));
	HallowedBiomeFeatures.addDefaultHallowedTrees(this);
	
	this.addSpawn(EntityCategory.CREATURE, new SpawnEntry(HallowedEntities.PUMPCOWN, 8, 4, 8));
}
 
Example #2
Source File: GhastlyDesert.java    From the-hallow with MIT License 5 votes vote down vote up
public GhastlyDesert() {
	super(new Settings().surfaceBuilder(DESERT_SURFACE_BUILDER).precipitation(Precipitation.NONE).category(Category.DESERT).precipitation(Biome.Precipitation.NONE).category(Biome.Category.DESERT).depth(0.125F).scale(0.05F).temperature(2.0F).downfall(0.0F).waterColor(0x3F76E4).waterFogColor(0x050533));
	
	this.addStructureFeature(Feature.MINESHAFT.configure(new MineshaftFeatureConfig(0.004D, MineshaftFeature.Type.NORMAL)));
	
	this.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, HallowedBiomeFeatures.configureFeature(HallowedFeatures.DEADER_BUSH, FeatureConfig.DEFAULT, Decorator.COUNT_HEIGHTMAP_DOUBLE, new CountDecoratorConfig(2)));
	this.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, HallowedBiomeFeatures.configureFeature(HallowedFeatures.RESTLESS_CACTUS, FeatureConfig.DEFAULT, Decorator.COUNT_HEIGHTMAP_DOUBLE, new CountDecoratorConfig(10)));
}
 
Example #3
Source File: FeatureGenerator.java    From fabric-carpet with MIT License 5 votes vote down vote up
private static Thing setupCustomStructure(StructureFeature structure, FeatureConfig conf, Biome biome, boolean wireOnly)
    {
    //if (1+2==3)
    //    throw new RuntimeException("rebuild me");
    return (w, p) -> {
        ChunkGenerator chunkgen = new OverworldChunkGenerator(w, w.getChunkManager().getChunkGenerator().getBiomeSource(), new OverworldChunkGeneratorConfig()) //  BiomeSourceType.VANILLA_LAYERED.applyConfig((BiomeSourceType.VANILLA_LAYERED.getConfig())), ChunkGeneratorType.SURFACE.createSettings())
        {
            @Override
            public <C extends FeatureConfig> C getStructureConfig(Biome biome_1, StructureFeature<C> structureFeature_1)
            {
                return (C)conf;
            }

            @Override
            public BiomeSource getBiomeSource()
            {
                return new VanillaLayeredBiomeSource(new VanillaLayeredBiomeSourceConfig(w.getLevelProperties()))
                {
                    @Override
                    public Biome getBiomeForNoiseGen(int i, int j, int k)
                    {
                        return biome;
                    }

                    @Override
                    public Set<Biome> getBiomesInArea(int int_1, int int_2, int int_3, int int_4)
                    {
                        return Sets.newHashSet(biome);
                    }
                };
            }
        };


        return ((StructureFeatureInterface)structure).plopAnywhere(w, p, chunkgen, wireOnly);
    };
}
 
Example #4
Source File: ChunkGeneratorMixin.java    From fabric-carpet with MIT License 5 votes vote down vote up
@Inject(method = "hasStructure", at = @At("HEAD"), cancellable = true)
private void skipGenerationBiomeChecks(Biome biome_1, StructureFeature<? extends FeatureConfig> structureFeature_1, CallbackInfoReturnable<Boolean> cir)
{
    if (CarpetSettings.skipGenerationChecks)
    {
        cir.setReturnValue(true);
        cir.cancel();
    }
}
 
Example #5
Source File: HallowedBiomeFeatures.java    From the-hallow with MIT License 4 votes vote down vote up
public static <F extends FeatureConfig, D extends DecoratorConfig> ConfiguredFeature<?, ?> configureFeature(Feature<F> feature, F featureConfig, Decorator<D> decorator, D decoratorConfig) {
	Feature<DecoratedFeatureConfig> feature2 = feature instanceof FlowerFeature ? Feature.DECORATED_FLOWER : Feature.DECORATED;
	return new ConfiguredFeature(feature2, new DecoratedFeatureConfig(feature.configure(featureConfig), decorator.configure(decoratorConfig)));
}
 
Example #6
Source File: HallowedBiomeFeatures.java    From the-hallow with MIT License 4 votes vote down vote up
public static void addDefaultUplandsGeneration(Biome biome) {
	biome.addFeature(GenerationStep.Feature.SURFACE_STRUCTURES, configureFeature(HallowedFeatures.STONE_CIRCLE, FeatureConfig.DEFAULT, Decorator.CHANCE_HEIGHTMAP, new ChanceDecoratorConfig(160)));
}
 
Example #7
Source File: HallowedBiomeFeatures.java    From the-hallow with MIT License 4 votes vote down vote up
public static void addWells(Biome biome) {
	biome.addFeature(GenerationStep.Feature.SURFACE_STRUCTURES, configureFeature(HallowedFeatures.WITCH_WELL, FeatureConfig.DEFAULT, Decorator.CHANCE_HEIGHTMAP, new ChanceDecoratorConfig(300)));
}
 
Example #8
Source File: HallowedBiomeFeatures.java    From the-hallow with MIT License 4 votes vote down vote up
public static void addLairs(Biome biome) {
	biome.addFeature(GenerationStep.Feature.SURFACE_STRUCTURES, configureFeature(HallowedFeatures.SPIDER_LAIR, FeatureConfig.DEFAULT, Decorator.CHANCE_HEIGHTMAP, new ChanceDecoratorConfig(230)));
}
 
Example #9
Source File: HallowedBiomeFeatures.java    From the-hallow with MIT License 4 votes vote down vote up
public static void addBarrows(Biome biome) {
	biome.addFeature(GenerationStep.Feature.TOP_LAYER_MODIFICATION, configureFeature(HallowedFeatures.BARROW, FeatureConfig.DEFAULT, Decorator.COUNT_EXTRA_HEIGHTMAP, new CountExtraChanceDecoratorConfig(0, 0.35f, 1)));
}
 
Example #10
Source File: HallowedBiomeFeatures.java    From the-hallow with MIT License 4 votes vote down vote up
public static void addColoredPumpkins(Biome biome) {
	biome.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, configureFeature(HallowedFeatures.COLORED_PUMPKIN, FeatureConfig.DEFAULT, Decorator.CHANCE_HEIGHTMAP_DOUBLE, new ChanceDecoratorConfig(32)));
}
 
Example #11
Source File: FeatureGenerator.java    From fabric-carpet with MIT License 4 votes vote down vote up
private static Thing simplePlop(Feature<DefaultFeatureConfig> feature)
{
    return simplePlop(feature.configure(FeatureConfig.DEFAULT));
}
 
Example #12
Source File: FeatureGenerator.java    From fabric-carpet with MIT License 4 votes vote down vote up
private static Thing spawnCustomStructure(StructureFeature structure, FeatureConfig conf, Biome biome)
{
    return setupCustomStructure(structure, conf, biome, false);
}
 
Example #13
Source File: FeatureGenerator.java    From fabric-carpet with MIT License 4 votes vote down vote up
private static Thing gridCustomStructure(StructureFeature structure, FeatureConfig conf, Biome biome)
{
    return setupCustomStructure(structure, conf, biome, true);
}
 
Example #14
Source File: HallowedBiomeFeatures.java    From the-hallow with MIT License 2 votes vote down vote up
public static void addDecoration(Biome biome) {
	
	biome.addFeature(GenerationStep.Feature.VEGETAL_DECORATION, configureFeature(HallowedFeatures.BRAMBLES, FeatureConfig.DEFAULT, Decorator.COUNT_HEIGHTMAP_DOUBLE, new CountDecoratorConfig(2)));
}