Add grassland biome

This commit is contained in:
Cheeserolls 2015-06-01 19:51:55 +01:00
parent f8db6d03c1
commit 2297888ec4
4 changed files with 92 additions and 1 deletions

View file

@ -20,6 +20,7 @@ public class BOPBiomes
public static Optional<BiomeGenBase> chaparral = Optional.absent();
public static Optional<BiomeGenBase> denseForest = Optional.absent();
public static Optional<BiomeGenBase> flowerField = Optional.absent();
public static Optional<BiomeGenBase> grassland = Optional.absent();
public static Optional<BiomeGenBase> highland = Optional.absent();
public static Optional<BiomeGenBase> lavenderFields = Optional.absent();
public static Optional<BiomeGenBase> marsh = Optional.absent();

View file

@ -0,0 +1,89 @@
/*******************************************************************************
* Copyright 2015, 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 net.minecraft.block.BlockTallGrass;
import net.minecraft.block.BlockFlower.EnumFlowerType;
import net.minecraft.block.material.Material;
import net.minecraft.entity.passive.EntityHorse;
import net.minecraft.init.Blocks;
import net.minecraftforge.common.BiomeManager.BiomeType;
import biomesoplenty.api.biome.BOPBiome;
import biomesoplenty.api.biome.generation.GeneratorStage;
import biomesoplenty.api.biome.generation.GeneratorWeighted;
import biomesoplenty.common.block.BlockBOPDoublePlant;
import biomesoplenty.common.block.BlockBOPMushroom;
import biomesoplenty.common.block.BlockBOPPlant;
import biomesoplenty.common.enums.BOPGems;
import biomesoplenty.common.enums.BOPPlants;
import biomesoplenty.common.util.block.BlockQueryUtils.BlockPosQueryAll;
import biomesoplenty.common.util.block.BlockQueryUtils.BlockPosQueryAny;
import biomesoplenty.common.util.block.BlockQueryUtils.BlockQueryMaterial;
import biomesoplenty.common.util.block.BlockQueryUtils.BlockPosQueryHasWater;
import biomesoplenty.common.util.block.BlockQueryUtils.IBlockPosQuery;
import biomesoplenty.common.world.feature.GeneratorColumns;
import biomesoplenty.common.world.feature.GeneratorDoubleFlora;
import biomesoplenty.common.world.feature.GeneratorFlora;
import biomesoplenty.common.world.feature.GeneratorGrass;
import biomesoplenty.common.world.feature.GeneratorLakes;
import biomesoplenty.common.world.feature.GeneratorOreSingle;
import biomesoplenty.common.world.feature.GeneratorWaterside;
public class BiomeGenGrassland extends BOPBiome {
private static final Height biomeHeight = new Height(0.1F, 0.2F);
public BiomeGenGrassland() {
this.setHeight(biomeHeight);
this.setColor(0x7FDB7D);
this.setTemperatureRainfall(0.6F, 0.7F);
this.addWeight(BiomeType.COOL, 10);
this.spawnableCreatureList.add(new SpawnListEntry(EntityHorse.class, 5, 2, 6));
// lakes
this.addGenerator("lakes", GeneratorStage.SAND, (new GeneratorLakes.Builder()).amountPerChunk(0.2F).waterLakeForBiome(this).create());
// gravel
this.addGenerator("gravel", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(4).maxRadius(7).to(Blocks.gravel.getDefaultState()).create());
// other plants
IBlockPosQuery canPlaceRiverCane = new BlockPosQueryAll(new BlockPosQueryHasWater(), new BlockPosQueryAny(new BlockQueryMaterial(Material.ground), new BlockQueryMaterial(Material.grass)));
this.addGenerator("river_cane", GeneratorStage.FLOWERS,(new GeneratorColumns.Builder()).amountPerChunk(1.0F).generationAttempts(24).placeOn(canPlaceRiverCane).to(BlockBOPPlant.paging.getVariantState(BOPPlants.RIVERCANE)).minHeight(1).maxHeight(3).create());
IBlockPosQuery canPlaceSugarCane = new BlockPosQueryAll(new BlockPosQueryHasWater(), new BlockPosQueryAny(new BlockQueryMaterial(Material.ground), new BlockQueryMaterial(Material.grass), new BlockQueryMaterial(Material.sand)));
this.addGenerator("sugar_cane", GeneratorStage.FLOWERS,(new GeneratorColumns.Builder()).amountPerChunk(4.0F).generationAttempts(24).placeOn(canPlaceSugarCane).to(Blocks.reeds.getDefaultState()).minHeight(1).maxHeight(3).create());
this.addGenerator("flax", GeneratorStage.FLOWERS,(new GeneratorDoubleFlora.Builder()).amountPerChunk(0.1F).flora(BlockBOPDoublePlant.DoublePlantType.FLAX).generationAttempts(6).create());
// water plants
this.addGenerator("water_reeds", GeneratorStage.LILYPAD,(new GeneratorFlora.Builder()).amountPerChunk(0.3F).flora(BOPPlants.REED).generationAttempts(32).create());
// flowers
this.addGenerator("flowers", GeneratorStage.FLOWERS, (new GeneratorFlora.Builder()).amountPerChunk(0.5F).flora(EnumFlowerType.ALLIUM).create());
// shrooms
this.addGenerator("portobellos", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.3F).flora(BlockBOPMushroom.MushroomType.PORTOBELLO).create());
// grasses
GeneratorWeighted grassGenerator = new GeneratorWeighted(0.6F);
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
grassGenerator.add("shortgrass", 1, (new GeneratorGrass.Builder()).grass(BOPPlants.SHORTGRASS).create());
grassGenerator.add("mediumgrass", 1, (new GeneratorGrass.Builder()).grass(BOPPlants.MEDIUMGRASS).create());
grassGenerator.add("wheatgrass", 2, (new GeneratorGrass.Builder()).grass(BOPPlants.WHEATGRASS).create());
grassGenerator.add("dampgrass", 2, (new GeneratorGrass.Builder()).grass(BOPPlants.DAMPGRASS).create());
grassGenerator.add("tallgrass", 4, (new GeneratorGrass.Builder()).grass(BlockTallGrass.EnumType.GRASS).create());
// gem
this.addGenerator("peridot", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).gemOre(BOPGems.PERIDOT).create());
}
}

View file

@ -78,6 +78,7 @@ public class ModBiomes
chaparral = registerBOPBiome(new BiomeGenChaparral(), "Chaparral");
denseForest = registerBOPBiome(new BiomeGenDenseForest(), "Dense Forest");
flowerField = registerBOPBiome(new BiomeGenFlowerField(), "Flower Field");
grassland = registerBOPBiome(new BiomeGenGrassland(), "Grassland");
highland = registerBOPBiome(new BiomeGenHighland(), "Highland");
lavenderFields = registerBOPBiome(new BiomeGenLavenderFields(), "Lavender Fields");
marsh = registerBOPBiome(new BiomeGenMarsh(), "Marsh");

View file

@ -28,7 +28,7 @@ public class GeneratorGrass extends GeneratorFlora
{
protected float amountPerChunk = 1.0F;
protected IBlockState grass = Blocks.tallgrass.getDefaultState();
protected int generationAttempts = 40;
protected int generationAttempts = 64;
public Builder amountPerChunk(float a) {this.amountPerChunk = a; return this;}
public Builder grass(IBlockState a) {this.grass = a; return this;}