Merged Dead Swamp and Bog into a single biome

This commit is contained in:
Forstride 2019-05-03 13:44:08 -04:00
parent 55a938e8b6
commit 0cbed91d11
7 changed files with 140 additions and 16 deletions

View File

@ -14,9 +14,9 @@ import java.util.Optional;
public class BOPBiomes
{
public static Optional<Biome> alps = Optional.empty();
public static Optional<Biome> bog = Optional.empty();
public static Optional<Biome> cherry_blossom_grove = Optional.empty();
public static Optional<Biome> coniferous_forest = Optional.empty();
public static Optional<Biome> dead_swamp = Optional.empty();
public static Optional<Biome> grassland = Optional.empty();
public static Optional<Biome> lavender_fields = Optional.empty();
public static Optional<Biome> lush_swamp = Optional.empty();

View File

@ -47,11 +47,11 @@ import net.minecraft.world.gen.surfacebuilders.CompositeSurfaceBuilder;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
public class DeadSwampBiome extends BiomeBOP
public class BogBiome extends BiomeBOP
{
public DeadSwampBiome()
public BogBiome()
{
super((new Biome.BiomeBuilder()).surfaceBuilder(new CompositeSurfaceBuilder(DEFAULT_SURFACE_BUILDER, BOPBiomeFeatures.LOAMY_GRASS_DIRT_GRAVEL_SURFACE)).precipitation(Biome.RainType.RAIN).category(Biome.Category.SWAMP).depth(-0.15F).scale(0.05F).temperature(0.6F).downfall(0.9F).waterColor(0x354762).waterFogColor(0x040511).parent((String)null));
super((new Biome.BiomeBuilder()).surfaceBuilder(new CompositeSurfaceBuilder(BOPBiomeFeatures.BOG_SURFACE_BUILDER, BOPBiomeFeatures.LOAMY_GRASS_DIRT_GRAVEL_SURFACE)).precipitation(Biome.RainType.RAIN).category(Biome.Category.SWAMP).depth(-0.1F).scale(0.05F).temperature(0.55F).downfall(0.9F).waterColor(0x354762).waterFogColor(0x040511).parent((String)null));
// Mineshafts and Strongholds
this.addStructure(Feature.SWAMP_HUT, new SwampHutConfig());
@ -86,10 +86,12 @@ public class DeadSwampBiome extends BiomeBOP
this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, createCompositeFeature(Feature.SPHERE_REPLACE, new SphereReplaceConfig(Blocks.CLAY, 4, 1, Lists.newArrayList(BOPBlocks.loamy_dirt, Blocks.CLAY)), TOP_SOLID, new FrequencyConfig(1)));
// Vegetation
this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createCompositeFeature(Feature.RANDOM_FEATURE_LIST, new RandomDefaultFeatureListConfig(new Feature[]{BOPBiomeFeatures.DEAD_TREE}, new IFeatureConfig[]{IFeatureConfig.NO_FEATURE_CONFIG}, new float[]{0.2F}, BOPBiomeFeatures.DYING_TREE, IFeatureConfig.NO_FEATURE_CONFIG), AT_SURFACE_WITH_EXTRA, new AtSurfaceWithExtraConfig(1, 0.2F, 1)));
this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createCompositeFeature(Feature.RANDOM_FEATURE_LIST, new RandomDefaultFeatureListConfig(new Feature[]{BOPBiomeFeatures.DARK_OAK_TWIGLET_TREE, BOPBiomeFeatures.TALL_TWIGLET_TREE, BOPBiomeFeatures.DEAD_TREE}, new IFeatureConfig[]{IFeatureConfig.NO_FEATURE_CONFIG, IFeatureConfig.NO_FEATURE_CONFIG, IFeatureConfig.NO_FEATURE_CONFIG}, new float[]{0.8F, 0.4F, 0.1F}, BOPBiomeFeatures.DYING_TREE, IFeatureConfig.NO_FEATURE_CONFIG), AT_SURFACE_WITH_EXTRA, new AtSurfaceWithExtraConfig(4, 0.2F, 1)));
this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createCompositeFeature(Feature.BIG_BROWN_MUSHROOM, IFeatureConfig.NO_FEATURE_CONFIG, AT_SURFACE_WITH_EXTRA, new AtSurfaceWithExtraConfig((int)0.75F, 0.1F, 1)));
this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createCompositeFeature(new StandardGrassFeature(), IFeatureConfig.NO_FEATURE_CONFIG, TWICE_SURFACE, new FrequencyConfig(5)));
this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createCompositeFeature(Feature.BUSH, new BushConfig(Blocks.BROWN_MUSHROOM), TWICE_SURFACE_WITH_CHANCE, new ChanceConfig(4)));
this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createCompositeFeature(Feature.BUSH, new BushConfig(Blocks.BROWN_MUSHROOM), TWICE_SURFACE_WITH_CHANCE, new ChanceConfig(15)));
this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createCompositeFeature(Feature.BUSH, new BushConfig(Blocks.RED_MUSHROOM), TWICE_SURFACE_WITH_CHANCE, new ChanceConfig(8)));
this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createCompositeFeature(Feature.BUSH, new BushConfig(BOPBlocks.toadstool), TWICE_SURFACE_WITH_CHANCE, new ChanceConfig(4)));
this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createCompositeFeature(Feature.PUMPKIN, IFeatureConfig.NO_FEATURE_CONFIG, TWICE_SURFACE_WITH_CHANCE, new ChanceConfig(32)));
this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createCompositeFeature(Feature.SEA_GRASS, new SeaGrassConfig(64, 0.6D), TOP_SOLID_ONCE, IPlacementConfig.NO_PLACEMENT_CONFIG));
this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createCompositeFeature(Feature.LIQUIDS, new LiquidsConfig(Fluids.WATER), HEIGHT_BIASED_RANGE, new CountRangeConfig(50, 8, 8, 256)));

View File

@ -7,13 +7,20 @@
******************************************************************************/
package biomesoplenty.common.block;
import java.util.Random;
import biomesoplenty.api.block.BOPBlocks;
import net.minecraft.block.Block;
import net.minecraft.block.BlockGrass;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.tags.FluidTags;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.IWorldReaderBase;
import net.minecraft.world.World;
public class BlockGrassBOP extends BlockGrass
{
@ -22,6 +29,76 @@ public class BlockGrassBOP extends BlockGrass
super(properties);
}
private static boolean func_196383_a(IWorldReaderBase p_196383_0_, BlockPos p_196383_1_)
{
BlockPos blockpos = p_196383_1_.up();
return p_196383_0_.getLight(blockpos) >= 4 || p_196383_0_.getBlockState(blockpos).getOpacity(p_196383_0_, blockpos) < p_196383_0_.getMaxLightLevel();
}
private static boolean func_196384_b(IWorldReaderBase p_196384_0_, BlockPos p_196384_1_)
{
BlockPos blockpos = p_196384_1_.up();
return p_196384_0_.getLight(blockpos) >= 4 && p_196384_0_.getBlockState(blockpos).getOpacity(p_196384_0_, blockpos) < p_196384_0_.getMaxLightLevel() && !p_196384_0_.getFluidState(blockpos).isTagged(FluidTags.WATER);
}
@Override
public void tick(IBlockState state, World worldIn, BlockPos pos, Random random)
{
if (!worldIn.isRemote)
{
if (!worldIn.isAreaLoaded(pos, 3))
{
return; // Forge: prevent loading unloaded chunks when checking neighbor's light and spreading
}
if (!func_196383_a(worldIn, pos))
{
if (this == BOPBlocks.loamy_grass_block)
{
worldIn.setBlockState(pos, BOPBlocks.loamy_dirt.getDefaultState());
}
if (this == BOPBlocks.silty_grass_block)
{
worldIn.setBlockState(pos, BOPBlocks.silty_dirt.getDefaultState());
}
if (this == BOPBlocks.sandy_grass_block)
{
worldIn.setBlockState(pos, BOPBlocks.sandy_dirt.getDefaultState());
}
}
else
{
if (worldIn.getLight(pos.up()) >= 9)
{
for(int i = 0; i < 4; ++i)
{
BlockPos blockpos = pos.add(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1);
if (!worldIn.isBlockPresent(blockpos))
{
return;
}
if ((worldIn.getBlockState(blockpos).getBlock() == Blocks.DIRT) && func_196384_b(worldIn, blockpos))
{
worldIn.setBlockState(blockpos, Blocks.GRASS_BLOCK.getDefaultState());
}
if ((worldIn.getBlockState(blockpos).getBlock() == BOPBlocks.loamy_dirt) && func_196384_b(worldIn, blockpos))
{
worldIn.setBlockState(blockpos, BOPBlocks.loamy_grass_block.getDefaultState());
}
if ((worldIn.getBlockState(blockpos).getBlock() == BOPBlocks.silty_dirt) && func_196384_b(worldIn, blockpos))
{
worldIn.setBlockState(blockpos, BOPBlocks.silty_grass_block.getDefaultState());
}
if ((worldIn.getBlockState(blockpos).getBlock() == BOPBlocks.sandy_dirt) && func_196384_b(worldIn, blockpos))
{
worldIn.setBlockState(blockpos, BOPBlocks.sandy_grass_block.getDefaultState());
}
}
}
}
}
}
@Override
public boolean canSustainPlant(IBlockState state, IBlockReader world, BlockPos pos, EnumFacing facing, net.minecraftforge.common.IPlantable plantable) {
net.minecraftforge.common.EnumPlantType type = plantable.getPlantType(world, pos.offset(facing));

View File

@ -16,11 +16,13 @@ import biomesoplenty.common.world.gen.feature.tree.BushTreeFeature;
import biomesoplenty.common.world.gen.feature.tree.MahoganyTreeFeature;
import biomesoplenty.common.world.gen.feature.tree.RedwoodTreeFeature;
import biomesoplenty.common.world.gen.feature.tree.TaigaTreeFeature;
import net.minecraft.block.material.Material;
import biomesoplenty.common.world.gen.feature.tree.TwigletTreeFeature;
import net.minecraft.init.Blocks;
import net.minecraft.world.gen.feature.AbstractFlowersFeature;
import net.minecraft.world.gen.feature.AbstractTreeFeature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import net.minecraft.world.gen.surfacebuilders.ExtremeHillsSurfaceBuilder;
import net.minecraft.world.gen.surfacebuilders.ISurfaceBuilder;
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilderConfig;
public class BOPBiomeFeatures
@ -43,6 +45,9 @@ public class BOPBiomeFeatures
public static final AbstractTreeFeature<NoFeatureConfig> WHITE_CHERRY_TREE = new BasicTreeFeature.Builder().log(BOPBlocks.cherry_log.getDefaultState()).leaves(BOPBlocks.white_cherry_leaves.getDefaultState()).create();
public static final AbstractTreeFeature<NoFeatureConfig> BIG_PINK_CHERRY_TREE = new BigTreeFeature.Builder().log(BOPBlocks.cherry_log.getDefaultState()).leaves(BOPBlocks.pink_cherry_leaves.getDefaultState()).create();
public static final AbstractTreeFeature<NoFeatureConfig> BIG_WHITE_CHERRY_TREE = new BigTreeFeature.Builder().log(BOPBlocks.cherry_log.getDefaultState()).leaves(BOPBlocks.white_cherry_leaves.getDefaultState()).create();
public static final AbstractTreeFeature<NoFeatureConfig> TWIGLET_TREE = new TwigletTreeFeature.Builder().create();
public static final AbstractTreeFeature<NoFeatureConfig> DARK_OAK_TWIGLET_TREE = new TwigletTreeFeature.Builder().log(Blocks.DARK_OAK_LOG.getDefaultState()).leaves(Blocks.DARK_OAK_LEAVES.getDefaultState()).minHeight(1).maxHeight(2).create();
public static final AbstractTreeFeature<NoFeatureConfig> TALL_TWIGLET_TREE = new TwigletTreeFeature.Builder().minHeight(2).maxHeight(4).create();
public static final AbstractTreeFeature<NoFeatureConfig> BAYOU_TREE = new BayouTreeFeature.Builder().create();
public static final AbstractTreeFeature<NoFeatureConfig> BULB_TREE = new BulbTreeFeature.Builder().create();
public static final AbstractTreeFeature<NoFeatureConfig> MAHOGANY_TREE = new MahoganyTreeFeature.Builder().create();
@ -65,9 +70,12 @@ public class BOPBiomeFeatures
public static final AbstractFlowersFeature WASTELAND_FLOWERS = new WastelandFlowersFeature();
public static final AbstractFlowersFeature WETLAND_FLOWERS = new WetlandFlowersFeature();
public static final ISurfaceBuilder<SurfaceBuilderConfig> BOG_SURFACE_BUILDER = new BogSurfaceBuilder();
public static final SurfaceBuilderConfig LOAMY_GRASS_DIRT_GRAVEL_SURFACE = new SurfaceBuilderConfig(BOPBlocks.loamy_grass_block.getDefaultState(), BOPBlocks.loamy_dirt.getDefaultState(), Blocks.GRAVEL.getDefaultState());
public static final SurfaceBuilderConfig SILTY_GRASS_DIRT_GRAVEL_SURFACE = new SurfaceBuilderConfig(BOPBlocks.silty_grass_block.getDefaultState(), BOPBlocks.silty_dirt.getDefaultState(), Blocks.GRAVEL.getDefaultState());
public static final SurfaceBuilderConfig SANDY_GRASS_DIRT_GRAVEL_SURFACE = new SurfaceBuilderConfig(BOPBlocks.sandy_grass_block.getDefaultState(), BOPBlocks.sandy_dirt.getDefaultState(), Blocks.GRAVEL.getDefaultState());
public static final SurfaceBuilderConfig COARSE_LOAMY_DIRT_GRAVEL_SURFACE = new SurfaceBuilderConfig(BOPBlocks.coarse_loamy_dirt.getDefaultState(), BOPBlocks.coarse_loamy_dirt.getDefaultState(), Blocks.GRAVEL.getDefaultState());
public static final SurfaceBuilderConfig SNOW_SNOW_GRAVEL_SURFACE = new SurfaceBuilderConfig(Blocks.SNOW_BLOCK.getDefaultState(), Blocks.SNOW_BLOCK.getDefaultState(), Blocks.GRAVEL.getDefaultState());
public static final SurfaceBuilderConfig DRIED_SAND_GRAVEL_SURFACE = new SurfaceBuilderConfig(BOPBlocks.dried_sand.getDefaultState(), BOPBlocks.dried_sand.getDefaultState(), Blocks.GRAVEL.getDefaultState());
}

View File

@ -0,0 +1,39 @@
/*******************************************************************************
* 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.world.gen.feature;
import java.util.Random;
import biomesoplenty.api.block.BOPBlocks;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.tags.BlockTags;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.IWorld;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.chunk.IChunk;
import net.minecraft.world.gen.IChunkGenSettings;
import net.minecraft.world.gen.IChunkGenerator;
import net.minecraft.world.gen.feature.AbstractFlowersFeature;
import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import net.minecraft.world.gen.surfacebuilders.ISurfaceBuilder;
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilderConfig;
public class BogSurfaceBuilder implements ISurfaceBuilder<SurfaceBuilderConfig> {
public void buildSurface(Random random, IChunk chunkIn, Biome biomeIn, int x, int z, int startHeight, double noise, IBlockState defaultBlock, IBlockState defaultFluid, int seaLevel, long seed, SurfaceBuilderConfig config) {
if (noise > 1.9D) {
Biome.DEFAULT_SURFACE_BUILDER.buildSurface(random, chunkIn, biomeIn, x, z, startHeight, noise, defaultBlock, defaultFluid, seaLevel, seed, BOPBiomeFeatures.COARSE_LOAMY_DIRT_GRAVEL_SURFACE);
} else {
Biome.DEFAULT_SURFACE_BUILDER.buildSurface(random, chunkIn, biomeIn, x, z, startHeight, noise, defaultBlock, defaultFluid, seaLevel, seed, BOPBiomeFeatures.LOAMY_GRASS_DIRT_GRAVEL_SURFACE);
}
}
}

View File

@ -14,7 +14,7 @@ import biomesoplenty.common.biome.BiomeBOP;
import biomesoplenty.common.biome.overworld.AlpsBiome;
import biomesoplenty.common.biome.overworld.CherryBlossomGroveBiome;
import biomesoplenty.common.biome.overworld.ConiferousForestBiome;
import biomesoplenty.common.biome.overworld.DeadSwampBiome;
import biomesoplenty.common.biome.overworld.BogBiome;
import biomesoplenty.common.biome.overworld.GrasslandBiome;
import biomesoplenty.common.biome.overworld.LavenderFieldsBiome;
import biomesoplenty.common.biome.overworld.LushSwampBiome;
@ -52,9 +52,9 @@ public class ModBiomes
private static void registerBiomes()
{
alps = registerBiome(new AlpsBiome(), "alps");
bog = registerBiome(new BogBiome(), "bog");
cherry_blossom_grove = registerBiome(new CherryBlossomGroveBiome(), "cherry_blossom_grove");
coniferous_forest = registerBiome(new ConiferousForestBiome(), "coniferous_forest");
dead_swamp = registerBiome(new DeadSwampBiome(), "dead_swamp");
grassland = registerBiome(new GrasslandBiome(), "grassland");
lavender_fields = registerBiome(new LavenderFieldsBiome(), "lavender_fields");
lush_swamp = registerBiome(new LushSwampBiome(), "lush_swamp");

View File

@ -21,8 +21,10 @@
"biome.biomesoplenty.alps": "Alps",
"biome.biomesoplenty.alps_foothills": "Alps Foothills",
"biome.biomesoplenty.ashlands": "Ashlands",
"biome.biomesoplenty.bayou": "Bayou",
"biome.biomesoplenty.bog": "Bog",
"biome.biomesoplenty.bog_mire": "Bog Mire",
"biome.biomesoplenty.boreal_forest": "Boreal Forest",
"biome.biomesoplenty.brushland": "Brushland",
"biome.biomesoplenty.chaparral": "Chaparral",
@ -33,8 +35,6 @@
"biome.biomesoplenty.crag": "Crag",
"biome.biomesoplenty.dead_forest": "Dead Forest",
"biome.biomesoplenty.dead_plains": "Dead Plains",
"biome.biomesoplenty.dead_swamp": "Dead Swamp",
"biome.biomesoplenty.fen": "Fen",
"biome.biomesoplenty.floodplains": "Floodplains",
"biome.biomesoplenty.flower_meadow": "Flower Meadow",
"biome.biomesoplenty.frosted_tundra": "Frosted Tundra",
@ -51,17 +51,15 @@
"biome.biomesoplenty.maple_woods": "Maple Woods",
"biome.biomesoplenty.marsh": "Marsh",
"biome.biomesoplenty.meadow": "Meadow",
"biome.biomesoplenty.mire": "Mire",
"biome.biomesoplenty.mystic_grove": "Mystic Grove",
"biome.biomesoplenty.oasis": "Oasis",
"biome.biomesoplenty.ominous_woods": "Ominous Woods",
"biome.biomesoplenty.orchard": "Orchard",
"biome.biomesoplenty.origin_beach": "Origin Beach",
"biome.biomesoplenty.origin_island": "Origin Island",
"biome.biomesoplenty.origin_hills": "Origin Hills",
"biome.biomesoplenty.outback": "Outback",
"biome.biomesoplenty.overgrown_cliffs": "Overgrown Cliffs",
"biome.biomesoplenty.pasture": "Pasture",
"biome.biomesoplenty.phantasmagoric_inferno": "Phantasmagoric Inferno",
"biome.biomesoplenty.prairie": "Prairie",
"biome.biomesoplenty.rainforest": "Rainforest",
"biome.biomesoplenty.redwood_forest": "Redwood Forest",
@ -74,12 +72,12 @@
"biome.biomesoplenty.snowy_forest": "Snowy Forest",
"biome.biomesoplenty.steppe": "Steppe",
"biome.biomesoplenty.temperate_rainforest": "Temperate Rainforest",
"biome.biomesoplenty.tropical_island": "Tropical Island",
"biome.biomesoplenty.tropical_rainforest": "Tropical Rainforest",
"biome.biomesoplenty.tropics": "Tropics",
"biome.biomesoplenty.tundra": "Tundra",
"biome.biomesoplenty.undergarden": "Undergarden",
"biome.biomesoplenty.visceral_heap": "Visceral Heap",
"biome.biomesoplenty.volcanic_island": "Volcanic Island",
"biome.biomesoplenty.volcano": "Volcano",
"biome.biomesoplenty.wasteland": "Wasteland",
"biome.biomesoplenty.wetland": "Wetland",
"biome.biomesoplenty.white_beach": "White Beach",