BiomesOPlenty/src/main/java/biomesoplenty/common/biome/overworld/WastelandBiome.java

94 lines
4.6 KiB
Java
Raw Normal View History

2019-05-02 17:06:37 +00:00
/*******************************************************************************
* Copyright 2014-2019, the Biomes O' Plenty Team
*
* This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License.
*
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
******************************************************************************/
package biomesoplenty.common.biome.overworld;
import biomesoplenty.api.enums.BOPClimates;
2020-08-20 10:18:53 +00:00
import biomesoplenty.common.biome.BiomeTemplate;
2019-05-02 17:06:37 +00:00
import biomesoplenty.common.world.gen.feature.BOPBiomeFeatures;
import biomesoplenty.common.world.gen.feature.WastelandGrassFeature;
2019-12-26 03:31:52 +00:00
import com.google.common.collect.ImmutableList;
2019-06-13 05:08:11 +00:00
import net.minecraft.entity.EntityClassification;
2019-06-13 06:07:49 +00:00
import net.minecraft.entity.EntityType;
2020-07-03 16:47:52 +00:00
import net.minecraft.world.biome.*;
2019-05-02 17:06:37 +00:00
import net.minecraft.world.gen.GenerationStage;
2019-08-28 11:30:51 +00:00
import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.IFeatureConfig;
import net.minecraft.world.gen.feature.MultipleRandomFeatureConfig;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import net.minecraft.world.gen.placement.AtSurfaceWithExtraConfig;
import net.minecraft.world.gen.placement.FrequencyConfig;
import net.minecraft.world.gen.placement.Placement;
2019-06-13 07:31:07 +00:00
import net.minecraft.world.gen.surfacebuilders.ConfiguredSurfaceBuilder;
2019-06-25 06:47:04 +00:00
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder;
2019-05-02 17:06:37 +00:00
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
2020-08-20 10:18:53 +00:00
public class WastelandBiome extends BiomeTemplate
2019-05-02 17:06:37 +00:00
{
public WastelandBiome()
{
2020-07-03 17:13:54 +00:00
super((new Biome.Builder()).surfaceBuilder(new ConfiguredSurfaceBuilder(SurfaceBuilder.DEFAULT, BOPBiomeFeatures.DRIED_SALT_SURFACE)).precipitation(Biome.RainType.NONE).biomeCategory(Biome.Category.DESERT).depth(-0.05F).scale(-0.05F).temperature(2.0F).downfall(0.0F).specialEffects((new BiomeAmbience.Builder()).waterColor(0x433721).waterFogColor(0x0C0C03).fogColor(0xDBDDC1).ambientMoodSound(MoodSoundAmbience.LEGACY_CAVE_SETTINGS).build()).parent((String)null));
2019-05-02 17:06:37 +00:00
// Structures
2020-07-03 16:47:52 +00:00
DefaultBiomeFeatures.addDefaultOverworldLandStructures(this);
this.addStructureStart(DefaultBiomeFeatures.RUINED_PORTAL_JUNGLE);
2019-05-02 17:06:37 +00:00
// Underground
2019-12-25 08:38:59 +00:00
DefaultBiomeFeatures.addDefaultCarvers(this);
DefaultBiomeFeatures.addDefaultLakes(this);
DefaultBiomeFeatures.addDefaultMonsterRoom(this);
DefaultBiomeFeatures.addDefaultUndergroundVariety(this);
DefaultBiomeFeatures.addDefaultOres(this);
2019-05-02 17:06:37 +00:00
////////////////////////////////////////////////////////////
2019-05-02 17:06:37 +00:00
// Vegetation
this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, Feature.RANDOM_SELECTOR.configured(new MultipleRandomFeatureConfig(ImmutableList.of(BOPBiomeFeatures.DEAD_TREE_WASTELAND.configured(DefaultBiomeFeatures.NORMAL_TREE_CONFIG).weighted(0.2F)), BOPBiomeFeatures.DYING_TREE_WASTELAND.configured(DefaultBiomeFeatures.NORMAL_TREE_CONFIG))).decorated(Placement.COUNT_EXTRA_HEIGHTMAP.configured(new AtSurfaceWithExtraConfig((int)0.75F, 0.1F, 1))));
2019-12-26 03:31:52 +00:00
2019-12-31 07:27:53 +00:00
this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, BOPBiomeFeatures.WASTELAND_FLOWERS.configured(IFeatureConfig.NONE).decorated(Placement.COUNT_HEIGHTMAP_32.configured(new FrequencyConfig(1))));
2020-07-03 13:49:05 +00:00
this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, new WastelandGrassFeature(NoFeatureConfig.CODEC).configured(IFeatureConfig.NONE).decorated(Placement.COUNT_HEIGHTMAP_DOUBLE.configured(new FrequencyConfig(2))));
2019-05-02 17:06:37 +00:00
////////////////////////////////////////////////////////////
// Other Features
2019-12-25 08:38:59 +00:00
DefaultBiomeFeatures.addDefaultSprings(this);
DefaultBiomeFeatures.addSurfaceFreezing(this);
// Entities
this.addSpawn(EntityClassification.MONSTER, new Biome.SpawnListEntry(EntityType.HUSK, 80, 4, 4));
2019-06-13 05:08:11 +00:00
this.addSpawn(EntityClassification.MONSTER, new Biome.SpawnListEntry(EntityType.SKELETON, 100, 4, 4));
this.addSpawn(EntityClassification.MONSTER, new Biome.SpawnListEntry(EntityType.SLIME, 100, 4, 4));
this.addSpawn(EntityClassification.MONSTER, new Biome.SpawnListEntry(EntityType.ENDERMAN, 10, 1, 4));
2019-05-02 17:06:37 +00:00
this.addWeight(BOPClimates.WASTELAND, 10);
this.setBeachBiome((Biome)null);
this.setRiverBiome((Biome)null);
2019-05-02 17:06:37 +00:00
}
2019-06-04 17:36:28 +00:00
@OnlyIn(Dist.CLIENT)
@Override
2019-12-26 04:58:02 +00:00
public int getSkyColor()
2019-06-04 17:36:28 +00:00
{
return 0x70ADEF;
}
2019-05-02 17:06:37 +00:00
@OnlyIn(Dist.CLIENT)
@Override
2019-12-25 08:38:59 +00:00
public int getGrassColor(double x, double z)
2019-05-02 17:06:37 +00:00
{
return 0xAD9364;
2019-05-02 17:06:37 +00:00
}
@OnlyIn(Dist.CLIENT)
@Override
2019-12-25 08:38:59 +00:00
public int getFoliageColor()
2019-05-02 17:06:37 +00:00
{
2019-06-04 17:36:28 +00:00
return 0xB5A76C;
2019-05-02 17:06:37 +00:00
}
}