Added Overgrown Greens biome

This commit is contained in:
Matt Caughey 2013-08-10 03:03:21 -04:00
parent 0a7b2058ce
commit 6a8893e75b
7 changed files with 340 additions and 0 deletions

View file

@ -78,6 +78,7 @@ public class Biomes
public static Optional<? extends BiomeGenBase> orchard = Optional.absent();
public static Optional<? extends BiomeGenBase> originValley = Optional.absent();
public static Optional<? extends BiomeGenBase> outback = Optional.absent();
public static Optional<? extends BiomeGenBase> overgrownGreens = Optional.absent();
public static Optional<? extends BiomeGenBase> pasture = Optional.absent();
public static Optional<? extends BiomeGenBase> pastureMeadow = Optional.absent();
public static Optional<? extends BiomeGenBase> pastureThin = Optional.absent();

View file

@ -0,0 +1,97 @@
package biomesoplenty.biomes;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.entity.passive.EntityHorse;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.SpawnListEntry;
import net.minecraft.world.gen.feature.WorldGenTallGrass;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.Blocks;
import biomesoplenty.worldgen.WorldGenIvy;
import biomesoplenty.worldgen.WorldGenOvergrownTree;
import biomesoplenty.worldgen.WorldGenLargeTree;
public class BiomeGenOvergrownGreens extends BiomeGenBase
{
private BiomeDecoratorBOP customBiomeDecorator;
public BiomeGenOvergrownGreens(int par1)
{
super(par1);
theBiomeDecorator = new BiomeDecoratorBOP(this);
customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
customBiomeDecorator.treesPerChunk = 1;
customBiomeDecorator.flowersPerChunk = -999;
customBiomeDecorator.grassPerChunk = 10;
customBiomeDecorator.highGrassPerChunk = 15;
}
@Override
public void decorate(World par1World, Random par2Random, int par3, int par4)
{
super.decorate(par1World, par2Random, par3, par4);
WorldGenIvy var5 = new WorldGenIvy();
int var55 = 12 + par2Random.nextInt(6);
for (int var66 = 0; var66 < var55; ++var66)
{
int var77 = par3 + par2Random.nextInt(16);
int var88 = par2Random.nextInt(28) + 4;
int var99 = par4 + par2Random.nextInt(16);
int var100 = par1World.getBlockId(var77, var88, var99);
if (var100 == Block.stone.blockID)
{
par1World.setBlock(var77, var88, var99, Blocks.amethystOre.get().blockID, 4, 2);
}
}
for (int var6 = 0; var6 < 50; ++var6)
{
int var7 = par3 + par2Random.nextInt(16) + 8;
byte var8 = 32;
int var9 = par4 + par2Random.nextInt(16) + 8;
var5.generate(par1World, par2Random, var7, var8, var9);
}
}
/**
* Gets a WorldGen appropriate for this biome.
*/
@Override
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
{
return par1Random.nextInt(4) == 0 ? new WorldGenOvergrownTree() : (par1Random.nextInt(2) == 0 ? new WorldGenLargeTree(false) : worldGeneratorTrees);
}
/**
* Gets a WorldGen appropriate for this biome.
*/
@Override
public WorldGenerator getRandomWorldGenForGrass(Random par1Random)
{
return new WorldGenTallGrass(Block.tallGrass.blockID, 1);
}
/**
* Provides the basic grass color based on the biome temperature and rainfall
*/
@Override
public int getBiomeGrassColor()
{
return 11992926;
}
/**
* Provides the basic foliage color based on the biome temperature and rainfall
*/
@Override
public int getBiomeFoliageColor()
{
return 9174870;
}
}

View file

@ -135,6 +135,7 @@ public class BOPBiomes {
Biomes.orchard = Optional.of((new BiomeGenOrchard(BOPConfiguration.IDs.orchardID)).setColor(9286496).setBiomeName("Orchard").setTemperatureRainfall(0.8F, 0.4F));
Biomes.originValley = Optional.of((new BiomeGenOriginValley(BOPConfiguration.IDs.originValleyID)).setColor(353825).setBiomeName("Origin Valley").func_76733_a(5159473).setTemperatureRainfall(0.7F, 0.8F).setMinMaxHeight(0.2F, 0.6F));
Biomes.outback = Optional.of((new BiomeGenOutback(BOPConfiguration.IDs.outbackID)).setColor(9286496).setBiomeName("Outback").setTemperatureRainfall(0.8F, 0.0F).setMinMaxHeight(0.3F, 0.4F));
Biomes.overgrownGreens = Optional.of((new BiomeGenOvergrownGreens(BOPConfiguration.IDs.overgrownGreensID)).setColor(353825).setBiomeName("Overgrown Greens").func_76733_a(5159473).setTemperatureRainfall(0.8F, 0.8F).setMinMaxHeight(0.3F, 0.4F));
Biomes.pasture = Optional.of((new BiomeGenPasture(BOPConfiguration.IDs.pastureID)).setColor(9286496).setBiomeName("Pasture").setTemperatureRainfall(0.8F, 0.4F).setMinMaxHeight(0.3F, 0.4F));
Biomes.pastureMeadow = Optional.of((new BiomeGenPastureMeadow(BOPConfiguration.IDs.pastureMeadowID)).setColor(9286496).setBiomeName("Pasture Meadow").setTemperatureRainfall(0.8F, 0.4F).setMinMaxHeight(0.3F, 0.4F));
Biomes.pastureThin = Optional.of((new BiomeGenPastureThin(BOPConfiguration.IDs.pastureThinID)).setColor(9286496).setBiomeName("Thinned Pasture").setTemperatureRainfall(0.8F, 0.4F).setMinMaxHeight(0.3F, 0.4F));
@ -269,6 +270,7 @@ public class BOPBiomes {
BiomeDictionary.registerBiomeType(Biomes.orchard.get(), Type.FOREST, Type.PLAINS);
BiomeDictionary.registerBiomeType(Biomes.outback.get(), Type.DESERT, Type.PLAINS);
BiomeDictionary.registerBiomeType(Biomes.overgrownGreens.get(), Type.JUNGLE, Type.PLAINS);
BiomeDictionary.registerBiomeType(Biomes.pasture.get(), Type.PLAINS);
BiomeDictionary.registerBiomeType(Biomes.pastureThin.get(), Type.PLAINS);
@ -443,6 +445,7 @@ public class BOPBiomes {
addVillageBiome(Biomes.oasis, BOPConfiguration.TerrainGen.oasisVillage);
addVillageBiome(Biomes.orchard, BOPConfiguration.TerrainGen.orchardVillage);
addVillageBiome(Biomes.outback, BOPConfiguration.TerrainGen.outbackVillage);
addVillageBiome(Biomes.overgrownGreens, BOPConfiguration.TerrainGen.overgrownGreensVillage);
addVillageBiome(Biomes.pasture, BOPConfiguration.TerrainGen.pastureVillage);
addVillageBiome(Biomes.polar, BOPConfiguration.TerrainGen.polarVillage);
addVillageBiome(Biomes.prairie, BOPConfiguration.TerrainGen.prairieVillage);
@ -525,6 +528,7 @@ public class BOPBiomes {
addStrongholdBiome(Biomes.ominousWoods);
addStrongholdBiome(Biomes.orchard);
addStrongholdBiome(Biomes.outback);
addStrongholdBiome(Biomes.overgrownGreens);
addStrongholdBiome(Biomes.pasture);
addStrongholdBiome(Biomes.polar);
addStrongholdBiome(Biomes.prairie);
@ -763,6 +767,10 @@ public class BOPBiomes {
if (BOPConfiguration.BiomeGen.outbackGen) {
registerBiome(Biomes.outback);
}
if (BOPConfiguration.BiomeGen.overgrownGreensGen) {
registerBiome(Biomes.overgrownGreens);
}
if (BOPConfiguration.BiomeGen.pastureGen) {
registerBiome(Biomes.pasture);
@ -1145,6 +1153,10 @@ public class BOPBiomes {
if (BOPConfiguration.BiomeGen.outbackGen) {
addBiomeToWorldTypes(getWorldTypes(), Biomes.outback);
}
if (BOPConfiguration.BiomeGen.overgrownGreensGen) {
addBiomeToWorldTypes(getWorldTypes(), Biomes.overgrownGreens);
}
if (BOPConfiguration.BiomeGen.pastureGen) {
addBiomeToWorldTypes(getWorldTypes(), Biomes.pasture);

View file

@ -125,6 +125,7 @@ public class BOPConfiguration
public static boolean orchardGen;
public static boolean originValleyGen;
public static boolean outbackGen;
public static boolean overgrownGreensGen;
public static boolean pastureGen;
public static boolean polarGen;
public static boolean prairieGen;
@ -232,6 +233,7 @@ public class BOPConfiguration
orchardGen = config.get("Biomes To Generate", "Orchard", true).getBoolean(false);
originValleyGen = config.get("Biomes To Generate", "OriginValley", true).getBoolean(false);
outbackGen = config.get("Biomes To Generate", "Outback", true).getBoolean(false);
overgrownGreensGen = config.get("Biomes To Generate", "OvergrownGreens", false).getBoolean(false);
pastureGen = config.get("Biomes To Generate", "Pasture", true).getBoolean(false);
polarGen = config.get("Biomes To Generate", "Polar", true).getBoolean(false);
prairieGen = config.get("Biomes To Generate", "Prairie", true).getBoolean(false);
@ -364,6 +366,7 @@ public class BOPConfiguration
public static boolean orchardVillage;
public static boolean originValleyVillage;
public static boolean outbackVillage;
public static boolean overgrownGreensVillage;
public static boolean pastureVillage;
public static boolean polarVillage;
public static boolean prairieVillage;
@ -376,6 +379,7 @@ public class BOPConfiguration
public static boolean seasonalForestVillage;
public static boolean shieldVillage;
public static boolean shrublandVillage;
public static boolean silkgladesVillage;
public static boolean sludgepitVillage;
public static boolean spruceWoodsVillage;
public static boolean steppeVillage;
@ -473,6 +477,7 @@ public class BOPConfiguration
orchardVillage = config.get("Allow Villages", "Orchard", false).getBoolean(false);
originValleyVillage = config.get("Allow Villages", "OriginValley", false).getBoolean(false);
outbackVillage = config.get("Allow Villages", "Outback", false).getBoolean(false);
overgrownGreensVillage = config.get("Allow Villages", "OvergrownGreens", true).getBoolean(false);
pastureVillage = config.get("Allow Villages", "Pasture", false).getBoolean(false);
polarVillage = config.get("Allow Villages", "Polar", false).getBoolean(false);
prairieVillage = config.get("Allow Villages", "Prairie", true).getBoolean(false);
@ -485,6 +490,7 @@ public class BOPConfiguration
seasonalForestVillage = config.get("Allow Villages", "SeasonalForest", false).getBoolean(false);
shieldVillage = config.get("Allow Villages", "Shield", true).getBoolean(false);
shrublandVillage = config.get("Allow Villages", "Shrubland", true).getBoolean(false);
silkgladesVillage = config.get("Allow Villages", "Silkgladess", false).getBoolean(false);
sludgepitVillage = config.get("Allow Villages", "Sludgepit", false).getBoolean(false);
spruceWoodsVillage = config.get("Allow Villages", "SpruceWoods", true).getBoolean(false);
steppeVillage = config.get("Allow Villages", "Steppe", true).getBoolean(false);
@ -737,6 +743,7 @@ public class BOPConfiguration
public static int orchardID;
public static int originValleyID;
public static int outbackID;
public static int overgrownGreensID;
public static int pastureID;
public static int pastureMeadowID;
public static int pastureThinID;
@ -970,6 +977,7 @@ public class BOPConfiguration
//23-79 ExtraBiomesXL
overgrownGreensID = config.get("Biome IDs", "Overgrown Greens ID", 34).getInt();
forestHillsNewID = config.get("Biome IDs", "Forest Hills (Sub-Biome) ID", 35).getInt();
taigaHillsNewID = config.get("Biome IDs", "Taiga Hills (Sub-Biome) ID", 36).getInt();
jungleHillsNewID = config.get("Biome IDs", "Jungle Hills (Sub-Biome) ID", 37).getInt();

View file

@ -213,6 +213,10 @@ public class WorldTypeBOP extends WorldType
{
addNewBiome(Biomes.outback);
}
if (BOPConfiguration.BiomeGen.overgrownGreensGen == true)
{
addNewBiome(Biomes.overgrownGreens);
}
if (BOPConfiguration.BiomeGen.pastureGen == true)
{
addNewBiome(Biomes.pasture);

View file

@ -0,0 +1,39 @@
package biomesoplenty.worldgen;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.util.Direction;
import net.minecraft.util.Facing;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.Blocks;
public class WorldGenIvy extends WorldGenerator
{
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
{
int l = par3;
for (int i1 = par5; par4 < 128; ++par4)
{
if (par1World.isAirBlock(par3, par4, par5))
{
for (int j1 = 2; j1 <= 5; ++j1)
{
if (Block.vine.canPlaceBlockOnSide(par1World, par3, par4, par5, j1))
{
par1World.setBlock(par3, par4, par5, Blocks.ivy.get().blockID, 1 << Direction.facingToDirection[Facing.oppositeSide[j1]], 2);
break;
}
}
}
else
{
par3 = l + par2Random.nextInt(4) - par2Random.nextInt(4);
par5 = i1 + par2Random.nextInt(4) - par2Random.nextInt(4);
}
}
return true;
}
}

View file

@ -0,0 +1,179 @@
package biomesoplenty.worldgen;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.Blocks;
public class WorldGenOvergrownTree extends WorldGenerator
{
@Override
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
{
int var6;
for (var6 = par2Random.nextInt(10) + 8; par1World.getBlockMaterial(par3, par4 - 1, par5) == Material.water; --par4)
{
;
}
boolean var7 = true;
if (par4 >= 1 && par4 + var6 + 1 <= 128)
{
int var8;
int var10;
int var11;
int var12;
for (var8 = par4; var8 <= par4 + 1 + var6; ++var8)
{
byte var9 = 1;
if (var8 == par4)
{
var9 = 0;
}
if (var8 >= par4 + 1 + var6 - 2)
{
var9 = 3;
}
for (var10 = par3 - var9; var10 <= par3 + var9 && var7; ++var10)
{
for (var11 = par5 - var9; var11 <= par5 + var9 && var7; ++var11)
{
if (var8 >= 0 && var8 < 128)
{
var12 = par1World.getBlockId(var10, var8, var11);
if (var12 != 0 && var12 != Block.leaves.blockID)
{
if (var12 != Block.waterStill.blockID && var12 != Block.waterMoving.blockID)
{
var7 = false;
}
else if (var8 > par4)
{
var7 = false;
}
}
}
else
{
var7 = false;
}
}
}
}
if (!var7)
return false;
else
{
var8 = par1World.getBlockId(par3, par4 - 1, par5);
if ((var8 == Block.grass.blockID || var8 == Block.dirt.blockID) && par4 < 128 - var6 - 1)
{
this.setBlock(par1World, par3, par4 - 1, par5, Block.dirt.blockID);
int var13;
int var16;
for (var16 = par4 - 3 + var6; var16 <= par4 + var6; ++var16)
{
var10 = var16 - (par4 + var6);
var11 = 2 - var10 / 2;
for (var12 = par3 - var11; var12 <= par3 + var11; ++var12)
{
var13 = var12 - par3;
for (int var14 = par5 - var11; var14 <= par5 + var11; ++var14)
{
int var15 = var14 - par5;
if ((Math.abs(var13) != var11 || Math.abs(var15) != var11 || par2Random.nextInt(2) != 0 && var10 != 0) && !Block.opaqueCubeLookup[par1World.getBlockId(var12, var16, var14)])
{
this.setBlockAndMetadata(par1World, var12, var16, var14, Block.leaves.blockID, 0);
}
}
}
}
for (var16 = 0; var16 < var6; ++var16)
{
var10 = par1World.getBlockId(par3, par4 + var16, par5);
if (var10 == 0 || var10 == Block.leaves.blockID || var10 == Block.waterMoving.blockID || var10 == Block.waterStill.blockID)
{
this.setBlockAndMetadata(par1World, par3, par4 + var16, par5, Block.wood.blockID, 0);
}
}
for (var16 = par4 - 3 + var6; var16 <= par4 + var6; ++var16)
{
var10 = var16 - (par4 + var6);
var11 = 2 - var10 / 2;
for (var12 = par3 - var11; var12 <= par3 + var11; ++var12)
{
for (var13 = par5 - var11; var13 <= par5 + var11; ++var13)
{
if (par1World.getBlockId(var12, var16, var13) == Block.leaves.blockID)
{
if (par2Random.nextInt(3) == 0 && par1World.getBlockId(var12 - 1, var16, var13) == 0)
{
this.generateVines(par1World, var12 - 1, var16, var13, 8);
}
if (par2Random.nextInt(3) == 0 && par1World.getBlockId(var12 + 1, var16, var13) == 0)
{
this.generateVines(par1World, var12 + 1, var16, var13, 2);
}
if (par2Random.nextInt(3) == 0 && par1World.getBlockId(var12, var16, var13 - 1) == 0)
{
this.generateVines(par1World, var12, var16, var13 - 1, 1);
}
if (par2Random.nextInt(3) == 0 && par1World.getBlockId(var12, var16, var13 + 1) == 0)
{
this.generateVines(par1World, var12, var16, var13 + 1, 4);
}
}
}
}
}
return true;
} else
return false;
}
} else
return false;
}
/**
* Generates vines at the given position until it hits a block.
*/
private void generateVines(World par1World, int par2, int par3, int par4, int par5)
{
this.setBlockAndMetadata(par1World, par2, par3, par4, Block.leaves.blockID, 0);
int var6 = 6;
while (true)
{
--par3;
if (par1World.getBlockId(par2, par3, par4) != 0 || var6 <= 0)
return;
this.setBlockAndMetadata(par1World, par2, par3, par4, Block.leaves.blockID, 0);
--var6;
}
}
}