BiomesOPlenty/common/biomesoplenty/biomes/BiomeGenOriginValley.java
2013-11-06 10:52:04 -05:00

83 lines
1.8 KiB
Java

package biomesoplenty.biomes;
import java.awt.Color;
import java.util.Random;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.Blocks;
import biomesoplenty.configuration.configfile.BOPConfigurationMisc;
import biomesoplenty.worldgen.tree.WorldGenOriginTree;
public class BiomeGenOriginValley extends BiomeGenBase
{
private BiomeDecoratorBOP customBiomeDecorator;
public BiomeGenOriginValley(int par1)
{
super(par1);
theBiomeDecorator = new BiomeDecoratorBOP(this);
customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
topBlock = (byte)Blocks.originGrass.get().blockID;
customBiomeDecorator.treesPerChunk = 4;
customBiomeDecorator.grassPerChunk = -999;
customBiomeDecorator.generatePumpkins = false;
customBiomeDecorator.sandPerChunk = 0;
customBiomeDecorator.sandPerChunk2 = 0;
customBiomeDecorator.clayPerChunk = 0;
customBiomeDecorator.rootsPerChunk = -999;
}
/**
* Gets a WorldGen appropriate for this biome.
*/
@Override
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
{
return new WorldGenOriginTree(false);
}
/**
* Provides the basic grass color based on the biome temperature and rainfall
*/
@Override
public int getBiomeGrassColor()
{
return 10682207;
}
/**
* Provides the basic foliage color based on the biome temperature and rainfall
*/
@Override
public int getBiomeFoliageColor()
{
return 3866368;
}
/**
* takes temperature, returns color
*/
@Override
public int getSkyColorByTemp(float par1)
{
if (BOPConfigurationMisc.skyColors)
return 8441086;
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();
}
}
}