BiomesOPlenty/src/minecraft/biomesoplenty/biomes/BiomeGenTropics.java

73 lines
2.0 KiB
Java
Raw Normal View History

2013-05-03 13:00:44 +00:00
package biomesoplenty.biomes;
import java.awt.Color;
import java.util.Random;
import biomesoplenty.configuration.BOPConfiguration;
import biomesoplenty.mobs.EntityJungleSpider;
import biomesoplenty.worldgen.WorldGenPalmTree1;
import biomesoplenty.worldgen.WorldGenPalmTree3;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.SpawnListEntry;
import net.minecraft.world.gen.feature.WorldGenerator;
public class BiomeGenTropics extends BiomeGenBase
{
private BiomeDecoratorBOP customBiomeDecorator;
@SuppressWarnings("unchecked")
public BiomeGenTropics(int par1)
{
super(par1);
this.theBiomeDecorator = new BiomeDecoratorBOP(this);
this.customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
this.customBiomeDecorator.treesPerChunk = 8;
this.customBiomeDecorator.grassPerChunk = 7;
this.customBiomeDecorator.flowersPerChunk = 10;
this.customBiomeDecorator.sandPerChunk = 50;
this.customBiomeDecorator.sandPerChunk2 = 50;
this.customBiomeDecorator.orangeFlowersPerChunk = 10;
this.customBiomeDecorator.whiteFlowersPerChunk = 4;
2013-05-14 14:17:00 +00:00
this.customBiomeDecorator.sunflowersPerChunk = 2;
2013-05-03 13:00:44 +00:00
this.customBiomeDecorator.generatePumpkins = false;
this.spawnableMonsterList.add(new SpawnListEntry(EntityJungleSpider.class, 12, 6, 6));
this.spawnableCreatureList.clear();
}
/**
* Gets a WorldGen appropriate for this biome.
*/
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
{
return (WorldGenerator)(par1Random.nextInt(3) == 0 ? new WorldGenPalmTree1() : new WorldGenPalmTree3());
}
/**
* takes temperature, returns color
*/
public int getSkyColorByTemp(float par1)
{
if (BOPConfiguration.skyColors = true)
{
return 3333631;
}
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();
}
}
}