2013-05-03 13:00:44 +00:00
|
|
|
package biomesoplenty.biomes;
|
|
|
|
|
|
|
|
import java.awt.Color;
|
|
|
|
import java.util.Random;
|
|
|
|
|
2013-05-12 22:22:17 +00:00
|
|
|
import cpw.mods.fml.common.Loader;
|
|
|
|
|
2013-05-03 13:00:44 +00:00
|
|
|
import biomesoplenty.api.Blocks;
|
|
|
|
import biomesoplenty.configuration.BOPBlocks;
|
|
|
|
import biomesoplenty.configuration.BOPConfiguration;
|
2013-05-09 13:38:48 +00:00
|
|
|
import biomesoplenty.worldgen.WorldGenPromisedBush;
|
2013-05-03 13:00:44 +00:00
|
|
|
import biomesoplenty.worldgen.WorldGenPromisedShrub;
|
|
|
|
import biomesoplenty.worldgen.WorldGenPromisedTree;
|
|
|
|
import biomesoplenty.worldgen.WorldGenPromisedTree2;
|
|
|
|
import biomesoplenty.worldgen.WorldGenPromisedTree3;
|
2013-05-09 13:38:48 +00:00
|
|
|
import biomesoplenty.worldgen.WorldGenWaterSpring;
|
2013-05-03 13:00:44 +00:00
|
|
|
|
|
|
|
import net.minecraft.block.Block;
|
2013-05-12 22:22:17 +00:00
|
|
|
import net.minecraft.entity.passive.EntityCow;
|
2013-05-03 13:00:44 +00:00
|
|
|
import net.minecraft.world.World;
|
|
|
|
import net.minecraft.world.biome.BiomeGenBase;
|
2013-05-12 22:22:17 +00:00
|
|
|
import net.minecraft.world.biome.SpawnListEntry;
|
2013-05-03 13:00:44 +00:00
|
|
|
import net.minecraft.world.gen.feature.WorldGenMinable;
|
|
|
|
import net.minecraft.world.gen.feature.WorldGenerator;
|
|
|
|
|
2013-05-09 07:00:09 +00:00
|
|
|
public class BiomeGenPromisedLandPlains extends BiomeGenBase
|
2013-05-03 13:00:44 +00:00
|
|
|
{
|
|
|
|
private WorldGenerator theWorldGenerator;
|
|
|
|
private BiomeDecoratorBOP customBiomeDecorator;
|
|
|
|
|
2013-05-09 07:00:09 +00:00
|
|
|
public BiomeGenPromisedLandPlains(int par1)
|
2013-05-03 13:00:44 +00:00
|
|
|
{
|
|
|
|
super(par1);
|
|
|
|
this.theBiomeDecorator = new BiomeDecoratorBOP(this);
|
|
|
|
this.customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
|
|
|
|
this.topBlock = (byte)Blocks.holyGrass.get().blockID;
|
2013-05-09 13:38:48 +00:00
|
|
|
this.fillerBlock = (byte)Blocks.holyDirt.get().blockID;
|
|
|
|
this.customBiomeDecorator.treesPerChunk = 4;
|
2013-05-03 13:00:44 +00:00
|
|
|
this.customBiomeDecorator.grassPerChunk = -999;
|
2013-05-09 07:00:09 +00:00
|
|
|
this.customBiomeDecorator.holyTallGrassPerChunk = 999;
|
2013-05-09 13:38:48 +00:00
|
|
|
this.customBiomeDecorator.promisedWillowPerChunk = 80;
|
2013-05-08 17:18:51 +00:00
|
|
|
this.customBiomeDecorator.generateLakes = false;
|
2013-05-09 10:09:58 +00:00
|
|
|
this.customBiomeDecorator.pondsPerChunk = -100;
|
2013-05-10 18:50:44 +00:00
|
|
|
this.customBiomeDecorator.waterLakesPerChunk = 6;
|
|
|
|
this.customBiomeDecorator.crystalsPerChunk = 25;
|
|
|
|
this.customBiomeDecorator.crystals2PerChunk = 50;
|
2013-05-03 13:00:44 +00:00
|
|
|
this.spawnableCreatureList.clear();
|
|
|
|
this.spawnableWaterCreatureList.clear();
|
|
|
|
this.spawnableMonsterList.clear();
|
|
|
|
this.spawnableCaveCreatureList.clear();
|
|
|
|
this.customBiomeDecorator.generatePumpkins = false;
|
2013-05-17 11:10:39 +00:00
|
|
|
//this.customBiomeDecorator.generateClouds = true;
|
2013-05-08 07:53:28 +00:00
|
|
|
//this.customBiomeDecorator.generateLakes = false;
|
2013-05-09 13:38:48 +00:00
|
|
|
this.theWorldGenerator = new WorldGenWaterSpring(Block.waterMoving.blockID, 8);
|
2013-05-12 22:22:17 +00:00
|
|
|
|
2013-05-15 20:09:24 +00:00
|
|
|
/*if (Loader.isModLoaded("TwilightForest"))
|
2013-05-12 22:22:17 +00:00
|
|
|
{
|
|
|
|
try {
|
|
|
|
this.spawnableMonsterList.add(new SpawnListEntry(Class.forName("twilightforest.entity.passive.EntityTFBird"), 2, 1, 3));
|
|
|
|
this.spawnableMonsterList.add(new SpawnListEntry(Class.forName("twilightforest.entity.passive.EntityTFBunny"), 4, 1, 3));
|
|
|
|
this.spawnableMonsterList.add(new SpawnListEntry(Class.forName("twilightforest.entity.passive.EntityTFSquirrel"), 4, 1, 2));
|
|
|
|
} catch (ClassNotFoundException e) {
|
|
|
|
System.out.println("[BiomesOPlenty] There was an error while integrating Twilight Forest with Biomes O' Plenty!");
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
2013-05-15 20:09:24 +00:00
|
|
|
}*/
|
2013-05-09 13:38:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets a WorldGen appropriate for this biome.
|
|
|
|
*/
|
|
|
|
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
|
|
|
|
{
|
|
|
|
return new WorldGenPromisedBush();
|
2013-05-03 13:00:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Provides the basic foliage color based on the biome temperature and rainfall
|
|
|
|
*/
|
|
|
|
public int getBiomeFoliageColor()
|
|
|
|
{
|
2013-05-10 18:50:44 +00:00
|
|
|
return 11266663;
|
2013-05-03 13:00:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public void decorate(World par1World, Random par2Random, int par3, int par4)
|
|
|
|
{
|
|
|
|
super.decorate(par1World, par2Random, par3, par4);
|
|
|
|
int var5 = 100;
|
|
|
|
int var6;
|
|
|
|
int var7;
|
|
|
|
int var8;
|
|
|
|
|
2013-05-09 13:38:48 +00:00
|
|
|
for (var5 = 0; var5 < 10; ++var5)
|
2013-05-03 13:00:44 +00:00
|
|
|
{
|
|
|
|
var6 = par3 + par2Random.nextInt(16);
|
|
|
|
var7 = par2Random.nextInt(60);
|
|
|
|
var8 = par4 + par2Random.nextInt(16);
|
|
|
|
this.theWorldGenerator.generate(par1World, par2Random, var6, var7, var8);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* takes temperature, returns color
|
|
|
|
*/
|
|
|
|
public int getSkyColorByTemp(float par1)
|
|
|
|
{
|
|
|
|
if (BOPConfiguration.skyColors = true)
|
|
|
|
{
|
2013-05-12 09:55:44 +00:00
|
|
|
return BOPConfiguration.promisedLandSkyColor;
|
2013-05-03 13:00:44 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
par1 /= 3.0F;
|
|
|
|
|
|
|
|
if (par1 < -1.0F)
|
|
|
|
{
|
|
|
|
par1 = -1.0F;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (par1 > 1.0F)
|
|
|
|
{
|
|
|
|
par1 = 1.0F;
|
|
|
|
}
|
|
|
|
|
|
|
|
return Color.getHSBColor(0.62222224F - par1 * 0.05F, 0.5F + par1 * 0.1F, 1.0F).getRGB();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|