2013-05-03 13:00:44 +00:00
|
|
|
package biomesoplenty.biomes;
|
|
|
|
|
|
|
|
import java.awt.Color;
|
2013-05-24 14:36:00 +00:00
|
|
|
import java.util.Random;
|
|
|
|
|
2013-05-03 13:00:44 +00:00
|
|
|
import net.minecraft.world.biome.BiomeGenBase;
|
2013-05-24 14:36:00 +00:00
|
|
|
import net.minecraft.world.gen.feature.WorldGenerator;
|
2013-05-29 01:05:27 +00:00
|
|
|
import biomesoplenty.api.Blocks;
|
2013-09-14 10:16:39 +00:00
|
|
|
import biomesoplenty.configuration.configfile.BOPConfigurationMisc;
|
2013-07-30 23:10:47 +00:00
|
|
|
import biomesoplenty.worldgen.WorldGenWasteland;
|
|
|
|
import biomesoplenty.worldgen.WorldGenWasteland2;
|
2013-09-14 10:16:39 +00:00
|
|
|
import biomesoplenty.worldgen.tree.WorldGenDeadTree3;
|
2013-05-03 13:00:44 +00:00
|
|
|
|
|
|
|
public class BiomeGenWasteland extends BiomeGenBase
|
|
|
|
{
|
2013-05-31 10:34:02 +00:00
|
|
|
private BiomeDecoratorBOP customBiomeDecorator;
|
2013-05-03 13:00:44 +00:00
|
|
|
|
2013-05-31 10:34:02 +00:00
|
|
|
public BiomeGenWasteland(int par1)
|
|
|
|
{
|
|
|
|
super(par1);
|
|
|
|
topBlock = (byte)Blocks.driedDirt.get().blockID;
|
|
|
|
fillerBlock = (byte)Blocks.driedDirt.get().blockID;
|
|
|
|
theBiomeDecorator = new BiomeDecoratorBOP(this);
|
|
|
|
customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
|
2013-07-30 23:10:47 +00:00
|
|
|
customBiomeDecorator.treesPerChunk = 1;
|
2013-05-31 10:34:02 +00:00
|
|
|
customBiomeDecorator.deadGrassPerChunk = 14;
|
|
|
|
customBiomeDecorator.poisonWaterPerChunk = 10;
|
|
|
|
waterColorMultiplier = 15073024;
|
|
|
|
spawnableCreatureList.clear();
|
|
|
|
spawnableWaterCreatureList.clear();
|
|
|
|
}
|
2013-05-03 13:00:44 +00:00
|
|
|
|
2013-05-31 10:34:02 +00:00
|
|
|
/**
|
|
|
|
* Gets a WorldGen appropriate for this biome.
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
|
|
|
|
{
|
2013-09-28 03:37:16 +00:00
|
|
|
return par1Random.nextInt(4) == 0 ? new WorldGenWasteland() : (par1Random.nextInt(4) == 0 ? new WorldGenWasteland2() : new WorldGenDeadTree3(false));
|
2013-05-31 10:34:02 +00:00
|
|
|
}
|
2013-05-03 13:00:44 +00:00
|
|
|
|
2013-05-31 10:34:02 +00:00
|
|
|
/**
|
|
|
|
* Provides the basic grass color based on the biome temperature and rainfall
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
public int getBiomeGrassColor()
|
|
|
|
{
|
|
|
|
return 10330232;
|
|
|
|
}
|
2013-05-03 13:00:44 +00:00
|
|
|
|
2013-05-31 10:34:02 +00:00
|
|
|
/**
|
|
|
|
* Provides the basic foliage color based on the biome temperature and rainfall
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
public int getBiomeFoliageColor()
|
|
|
|
{
|
|
|
|
return 10067541;
|
|
|
|
}
|
2013-05-03 13:00:44 +00:00
|
|
|
|
2013-05-31 10:34:02 +00:00
|
|
|
/**
|
|
|
|
* takes temperature, returns color
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
public int getSkyColorByTemp(float par1)
|
|
|
|
{
|
2013-09-14 10:16:39 +00:00
|
|
|
if (BOPConfigurationMisc.skyColors)
|
2013-05-31 10:34:02 +00:00
|
|
|
return 10465942;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
par1 /= 3.0F;
|
2013-05-03 13:00:44 +00:00
|
|
|
|
2013-05-31 10:34:02 +00:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
}
|
2013-05-03 13:00:44 +00:00
|
|
|
}
|