99 lines
5.1 KiB
Java
99 lines
5.1 KiB
Java
/*******************************************************************************
|
|
* Copyright 2015-2016, 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.biome.BOPBiomes;
|
|
import biomesoplenty.api.block.BlockQueries;
|
|
import biomesoplenty.api.enums.BOPClimates;
|
|
import biomesoplenty.api.enums.BOPFoliage;
|
|
import biomesoplenty.api.enums.BOPPlants;
|
|
import biomesoplenty.api.generation.GeneratorStage;
|
|
import biomesoplenty.common.block.BlockBOPDoublePlant;
|
|
import biomesoplenty.common.block.BlockBOPFlatPlant;
|
|
import biomesoplenty.common.block.BlockBOPMushroom;
|
|
import biomesoplenty.common.world.generator.GeneratorDoubleFlora;
|
|
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
import biomesoplenty.common.world.generator.GeneratorWaterside;
|
|
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
import biomesoplenty.common.world.generator.tree.GeneratorBasicTree;
|
|
import net.minecraft.block.BlockDoublePlant;
|
|
import net.minecraft.block.BlockFlower;
|
|
import net.minecraft.block.BlockTallGrass;
|
|
import net.minecraft.init.Blocks;
|
|
import net.minecraft.util.math.BlockPos;
|
|
|
|
public class BiomeGenWoodland extends BOPOverworldBiome
|
|
{
|
|
|
|
public BiomeGenWoodland()
|
|
{
|
|
super("woodland", new PropsBuilder("Woodland").withGuiColour(0x84A92D).withTemperature(0.8F).withRainfall(0.5F));
|
|
|
|
// terrain
|
|
this.terrainSettings.avgHeight(64).heightVariation(6, 25);
|
|
|
|
this.canGenerateVillages = true;
|
|
|
|
this.addWeight(BOPClimates.WARM_TEMPERATE, 5);
|
|
|
|
if (BOPBiomes.gravel_beach.isPresent())
|
|
{
|
|
this.beachBiomeLocation = ((BOPOverworldBiome)BOPBiomes.gravel_beach.get()).getResourceLocation();
|
|
}
|
|
|
|
// sand
|
|
this.addGenerator("sand", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(3).maxRadius(7).with(Blocks.SAND.getDefaultState()).create());
|
|
|
|
// trees
|
|
GeneratorWeighted treeGenerator = new GeneratorWeighted(10);
|
|
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
treeGenerator.add("oak", 9, (new GeneratorBasicTree.Builder()).minHeight(5).maxHeight(8).create());
|
|
|
|
// grasses
|
|
GeneratorWeighted grassGenerator = new GeneratorWeighted(1.4F);
|
|
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
grassGenerator.add("shortgrass", 1, (new GeneratorGrass.Builder()).with(BOPFoliage.SHORTGRASS).create());
|
|
grassGenerator.add("tallgrass", 2, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
|
|
// gravel
|
|
this.addGenerator("gravel", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(4).maxRadius(7).with(Blocks.GRAVEL.getDefaultState()).create());
|
|
|
|
// flowers
|
|
GeneratorWeighted flowerGenerator = new GeneratorWeighted(0.4F);
|
|
this.addGenerator("flowers", GeneratorStage.FLOWERS, flowerGenerator);
|
|
flowerGenerator.add("rose", 1, (new GeneratorDoubleFlora.Builder()).with(BlockDoublePlant.EnumPlantType.ROSE).create());
|
|
flowerGenerator.add("oxeye_daisy", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.OXEYE_DAISY).create()));
|
|
flowerGenerator.add("dandelion", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.DANDELION).create()));
|
|
flowerGenerator.add("poppy", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.POPPY).create()));
|
|
|
|
// other plants
|
|
this.addGenerator("berry_bushes", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPFoliage.BERRYBUSH).create());
|
|
this.addGenerator("dead_leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).placeOn(BlockQueries.darkFertile).with(BlockBOPFlatPlant.PlantType.DEADLEAFPILE).generationAttempts(64).create());
|
|
this.addGenerator("flax", GeneratorStage.FLOWERS, (new GeneratorDoubleFlora.Builder()).amountPerChunk(0.1F).with(BlockBOPDoublePlant.DoublePlantType.FLAX).create());
|
|
|
|
// water plants
|
|
this.addGenerator("water_reeds", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.8F).with(BOPPlants.REED).generationAttempts(32).create());
|
|
|
|
// shrooms
|
|
this.addGenerator("toadstools", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.3F).generationAttempts(16).with(BlockBOPMushroom.MushroomType.TOADSTOOL).create());
|
|
}
|
|
|
|
@Override
|
|
public int getGrassColorAtPos(BlockPos pos)
|
|
{
|
|
return getModdedBiomeGrassColor(0x8DC047);
|
|
}
|
|
|
|
@Override
|
|
public int getFoliageColorAtPos(BlockPos pos)
|
|
{
|
|
return getModdedBiomeFoliageColor(0x72AF1A);
|
|
}
|
|
} |