diff --git a/src/main/java/biomesoplenty/api/biome/BOPBiomes.java b/src/main/java/biomesoplenty/api/biome/BOPBiomes.java index 7cf99da42..b6f964b5a 100644 --- a/src/main/java/biomesoplenty/api/biome/BOPBiomes.java +++ b/src/main/java/biomesoplenty/api/biome/BOPBiomes.java @@ -20,6 +20,7 @@ public class BOPBiomes public static Optional chaparral = Optional.absent(); public static Optional denseForest = Optional.absent(); public static Optional flowerField = Optional.absent(); + public static Optional grassland = Optional.absent(); public static Optional highland = Optional.absent(); public static Optional lavenderFields = Optional.absent(); public static Optional marsh = Optional.absent(); diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenGrassland.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenGrassland.java new file mode 100644 index 000000000..e9974e361 --- /dev/null +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenGrassland.java @@ -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()); + + + } + +} diff --git a/src/main/java/biomesoplenty/common/init/ModBiomes.java b/src/main/java/biomesoplenty/common/init/ModBiomes.java index 071a17564..3e0ec69ae 100644 --- a/src/main/java/biomesoplenty/common/init/ModBiomes.java +++ b/src/main/java/biomesoplenty/common/init/ModBiomes.java @@ -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"); diff --git a/src/main/java/biomesoplenty/common/world/feature/GeneratorGrass.java b/src/main/java/biomesoplenty/common/world/feature/GeneratorGrass.java index cf48c989d..570cabf99 100644 --- a/src/main/java/biomesoplenty/common/world/feature/GeneratorGrass.java +++ b/src/main/java/biomesoplenty/common/world/feature/GeneratorGrass.java @@ -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;}