Improvements to the Tropics and Grassland biomes

This commit is contained in:
Forstride 2020-07-16 09:18:00 -04:00
parent ed4257fb70
commit 0b54837832
5 changed files with 104 additions and 12 deletions

View File

@ -51,13 +51,12 @@ public class GrasslandBiome extends BiomeBOP
DefaultBiomeFeatures.addDefaultMonsterRoom(this);
DefaultBiomeFeatures.addDefaultUndergroundVariety(this);
DefaultBiomeFeatures.addDefaultOres(this);
DefaultBiomeFeatures.addDefaultSoftDisks(this);
////////////////////////////////////////////////////////////
// Vegetation
this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, new StandardGrassFeature(NoFeatureConfig.CODEC).configured(IFeatureConfig.NONE).decorated(Placement.COUNT_HEIGHTMAP_DOUBLE.configured(new FrequencyConfig(4))));
this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, Feature.RANDOM_PATCH.configured(BiomeFeatureHelper.createClusterConfigurationDoubleWater(BOPBlocks.reed.defaultBlockState())).decorated(Placement.COUNT_HEIGHTMAP_DOUBLE.configured(new FrequencyConfig(10))));
this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, Feature.RANDOM_PATCH.configured(BiomeFeatureHelper.createClusterConfigurationDoubleWater(BOPBlocks.reed.defaultBlockState())).decorated(Placement.COUNT_HEIGHTMAP_DOUBLE.configured(new FrequencyConfig(5))));
this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, Feature.RANDOM_PATCH.configured(DefaultBiomeFeatures.SUGAR_CANE_CONFIG).decorated(Placement.COUNT_HEIGHTMAP_DOUBLE.configured(new FrequencyConfig(45))));
////////////////////////////////////////////////////////////

View File

@ -23,13 +23,8 @@ import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.IFeatureConfig;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import net.minecraft.world.gen.feature.SingleRandomFeature;
import net.minecraft.world.gen.feature.structure.BuriedTreasureConfig;
import net.minecraft.world.gen.feature.structure.MineshaftConfig;
import net.minecraft.world.gen.feature.structure.MineshaftStructure;
import net.minecraft.world.gen.feature.structure.ShipwreckConfig;
import net.minecraft.world.gen.placement.*;
import net.minecraft.world.gen.surfacebuilders.ConfiguredSurfaceBuilder;
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@ -37,7 +32,7 @@ public class TropicBeachBiome extends BiomeBOP
{
public TropicBeachBiome()
{
super((new Biome.Builder()).surfaceBuilder(new ConfiguredSurfaceBuilder(SurfaceBuilder.DEFAULT, BOPBiomeFeatures.WHITE_SAND_SURFACE)).precipitation(Biome.RainType.RAIN).biomeCategory(Biome.Category.BEACH).depth(0.0F).scale(0.025F).temperature(0.95F).downfall(1.0F).specialEffects((new BiomeAmbience.Builder()).waterColor(4445678).waterFogColor(270131).fogColor(12638463).ambientMoodSound(MoodSoundAmbience.LEGACY_CAVE_SETTINGS).build()).parent((String)null));
super((new Biome.Builder()).surfaceBuilder(new ConfiguredSurfaceBuilder(BOPBiomeFeatures.TROPICS_SURFACE_BUILDER, BOPBiomeFeatures.WHITE_SAND_SURFACE)).precipitation(Biome.RainType.RAIN).biomeCategory(Biome.Category.BEACH).depth(0.0F).scale(0.025F).temperature(0.95F).downfall(1.0F).specialEffects((new BiomeAmbience.Builder()).waterColor(4445678).waterFogColor(270131).fogColor(0xB2EDFF).ambientMoodSound(MoodSoundAmbience.LEGACY_CAVE_SETTINGS).build()).parent((String)null));
// Structures

View File

@ -25,8 +25,6 @@ import net.minecraft.world.biome.DefaultBiomeFeatures;
import net.minecraft.world.biome.MoodSoundAmbience;
import net.minecraft.world.gen.GenerationStage;
import net.minecraft.world.gen.feature.*;
import net.minecraft.world.gen.feature.structure.MineshaftConfig;
import net.minecraft.world.gen.feature.structure.MineshaftStructure;
import net.minecraft.world.gen.placement.AtSurfaceWithExtraConfig;
import net.minecraft.world.gen.placement.FrequencyConfig;
import net.minecraft.world.gen.placement.Placement;
@ -39,7 +37,7 @@ public class TropicsBiome extends BiomeBOP
{
public TropicsBiome()
{
super((new Biome.Builder()).surfaceBuilder(new ConfiguredSurfaceBuilder(SurfaceBuilder.DEFAULT, SurfaceBuilder.CONFIG_GRASS)).precipitation(Biome.RainType.RAIN).biomeCategory(Biome.Category.NONE).depth(0.25F).scale(0.4F).temperature(0.95F).downfall(1.0F).specialEffects((new BiomeAmbience.Builder()).waterColor(4445678).waterFogColor(270131).fogColor(12638463).ambientMoodSound(MoodSoundAmbience.LEGACY_CAVE_SETTINGS).build()).parent((String)null));
super((new Biome.Builder()).surfaceBuilder(new ConfiguredSurfaceBuilder(BOPBiomeFeatures.TROPICS_SURFACE_BUILDER, SurfaceBuilder.CONFIG_GRASS)).precipitation(Biome.RainType.RAIN).biomeCategory(Biome.Category.NONE).depth(0.25F).scale(0.4F).temperature(0.95F).downfall(1.0F).specialEffects((new BiomeAmbience.Builder()).waterColor(4445678).waterFogColor(270131).fogColor(0xB2EDFF).ambientMoodSound(MoodSoundAmbience.LEGACY_CAVE_SETTINGS).build()).parent((String)null));
// Structures
DefaultBiomeFeatures.addDefaultOverworldLandStructures(this);

View File

@ -13,7 +13,6 @@ import net.minecraft.block.Blocks;
import net.minecraft.block.LeavesBlock;
import net.minecraft.block.SaplingBlock;
import net.minecraft.util.Direction;
import net.minecraft.world.gen.carver.CaveWorldCarver;
import net.minecraft.world.gen.carver.WorldCarver;
import net.minecraft.world.gen.feature.*;
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder;
@ -178,6 +177,7 @@ public class BOPBiomeFeatures
public static final SurfaceBuilder<SurfaceBuilderConfig> WITHERED_ABYSS_SURFACE_BUILDER = new WitheredAbyssSurfaceBuilder(SurfaceBuilderConfig.CODEC);
public static final SurfaceBuilder<SurfaceBuilderConfig> FLESH_SURFACE_BUILDER = new FleshSurfaceBuilder(SurfaceBuilderConfig.CODEC);
public static final SurfaceBuilder<SurfaceBuilderConfig> ORIGIN_HILLS_SURFACE_BUILDER = new OriginHillsSurfaceBuilder(SurfaceBuilderConfig.CODEC);
public static final SurfaceBuilder<SurfaceBuilderConfig> TROPICS_SURFACE_BUILDER = new TropicsSurfaceBuilder(SurfaceBuilderConfig.CODEC);
public static final SurfaceBuilderConfig BLACKSTONE_SURFACE = new SurfaceBuilderConfig(Blocks.BLACKSTONE.defaultBlockState(), Blocks.BLACKSTONE.defaultBlockState(), Blocks.BLACKSTONE.defaultBlockState());
public static final SurfaceBuilderConfig BASALT_SURFACE = new SurfaceBuilderConfig(Blocks.BASALT.defaultBlockState(), Blocks.BASALT.defaultBlockState(), Blocks.GRAVEL.defaultBlockState());

View File

@ -0,0 +1,100 @@
package biomesoplenty.common.world.gen.feature;
import biomesoplenty.api.block.BOPBlocks;
import com.mojang.serialization.Codec;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.chunk.IChunk;
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder;
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilderConfig;
import java.util.Random;
public class TropicsSurfaceBuilder extends SurfaceBuilder<SurfaceBuilderConfig> {
public TropicsSurfaceBuilder(Codec<SurfaceBuilderConfig> p_i232124_1_) {
super(p_i232124_1_);
}
public void apply(Random random, IChunk chunkIn, Biome biomeIn, int x, int z, int startHeight, double noise, BlockState defaultBlock, BlockState defaultFluid, int seaLevel, long seed, SurfaceBuilderConfig config) {
this.apply(random, chunkIn, biomeIn, x, z, startHeight, noise, defaultBlock, defaultFluid, config.getTopMaterial(), config.getUnderMaterial(), config.getUnderwaterMaterial(), seaLevel);
}
protected void apply(Random random, IChunk chunkIn, Biome biomeIn, int x, int z, int startHeight, double noise, BlockState defaultBlock, BlockState defaultFluid, BlockState top, BlockState middle, BlockState bottom, int sealevel) {
BlockState blockstate = top;
BlockState blockstate1 = middle;
BlockPos.Mutable blockpos$mutable = new BlockPos.Mutable();
int i = -1;
int j = (int)(noise / 3.0D + 3.0D + random.nextDouble() * 0.25D);
int k = x & 15;
int l = z & 15;
for(int i1 = startHeight; i1 >= 0; --i1)
{
blockpos$mutable.set(k, i1, l);
BlockState blockstate2 = chunkIn.getBlockState(blockpos$mutable);
if (blockstate2.isAir())
{
i = -1;
}
else if (blockstate2.is(defaultBlock.getBlock()))
{
if (i == -1)
{
if (j <= 0)
{
blockstate = Blocks.AIR.defaultBlockState();
blockstate1 = defaultBlock;
}
else if (i1 >= sealevel - 4 && i1 <= sealevel + 1)
{
blockstate = BOPBlocks.white_sand.defaultBlockState();
blockstate1 = BOPBlocks.white_sand.defaultBlockState();
}
if (i1 < sealevel && (blockstate == null || blockstate.isAir()))
{
if (biomeIn.getTemperature(blockpos$mutable.set(x, i1, z)) < 0.15F)
{
blockstate = Blocks.ICE.defaultBlockState();
}
else
{
blockstate = defaultFluid;
}
blockpos$mutable.set(k, i1, l);
}
i = j;
if (i1 >= sealevel - 1)
{
chunkIn.setBlockState(blockpos$mutable, blockstate, false);
}
else if (i1 < sealevel - 7 - j)
{
blockstate = Blocks.AIR.defaultBlockState();
blockstate1 = defaultBlock;
chunkIn.setBlockState(blockpos$mutable, bottom, false);
}
else
{
chunkIn.setBlockState(blockpos$mutable, blockstate1, false);
}
}
else if (i > 0)
{
--i;
chunkIn.setBlockState(blockpos$mutable, blockstate1, false);
if (i == 0 && blockstate1.is(BOPBlocks.white_sand) && j > 1)
{
i = random.nextInt(4) + Math.max(0, i1 - 63);
blockstate1 = BOPBlocks.white_sandstone.defaultBlockState();
}
}
}
}
}
}