BiomesOPlenty/common/biomesoplenty/biomes/BiomeGenDeadlands.java

118 lines
3 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 net.minecraft.block.Block;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.passive.EntityBat;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.SpawnListEntry;
import net.minecraft.world.gen.feature.WorldGenMinable;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.Blocks;
2013-09-14 10:16:39 +00:00
import biomesoplenty.configuration.configfile.BOPConfigurationMisc;
import biomesoplenty.interfaces.IBOPFog;
2013-05-03 13:00:44 +00:00
import biomesoplenty.worldgen.WorldGenDeadlands;
public class BiomeGenDeadlands extends BiomeGenBase implements IBOPFog
2013-05-03 13:00:44 +00:00
{
private WorldGenerator theWorldGenerator;
private BiomeDecoratorBOP customBiomeDecorator;
@SuppressWarnings("unchecked")
public BiomeGenDeadlands(int par1)
2013-05-31 10:34:02 +00:00
{
super(par1);
topBlock = (byte)Blocks.ash.get().blockID;
fillerBlock = (byte)Blocks.ash.get().blockID;
theBiomeDecorator = new BiomeDecoratorBOP(this);
customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
customBiomeDecorator.treesPerChunk = -999;
customBiomeDecorator.grassPerChunk = 15;
customBiomeDecorator.flowersPerChunk = -999;
customBiomeDecorator.mushroomsPerChunk = -999;
customBiomeDecorator.sandPerChunk = -999;
customBiomeDecorator.sandPerChunk2 = -999;
customBiomeDecorator.lavaLakesPerChunk = 25;
customBiomeDecorator.smolderingGrassPerChunk = 5;
customBiomeDecorator.generatePits = true;
waterColorMultiplier = 16711680;
spawnableCreatureList.clear();
spawnableWaterCreatureList.clear();
spawnableCreatureList.add(new SpawnListEntry(EntityCreeper.class, 30, 1, 7));
spawnableCaveCreatureList.add(new SpawnListEntry(EntityBat.class, 10, 8, 8));
theWorldGenerator = new WorldGenMinable(Block.silverfish.blockID, 8);
}
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 getRandomWorldGenForGrass(Random par1Random)
{
return new WorldGenDeadlands();
}
@Override
public void decorate(World par1World, Random par2Random, int par3, int par4)
{
super.decorate(par1World, par2Random, par3, par4);
int var5 = 3 + par2Random.nextInt(6);
int var6;
int var7;
int var8;
for (var5 = 0; var5 < 7; ++var5)
2013-05-03 13:00:44 +00:00
{
2013-05-31 10:34:02 +00:00
var6 = par3 + par2Random.nextInt(16);
var7 = par2Random.nextInt(64);
var8 = par4 + par2Random.nextInt(16);
theWorldGenerator.generate(par1World, par2Random, var6, var7, var8);
}
}
2013-11-03 22:22:44 +00:00
/**
* Fog Color
*/
@Override
public int getFogColour()
{
return 9849675;
}
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 4464929;
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;
}
2013-05-03 13:00:44 +00:00
2013-05-31 10:34:02 +00:00
if (par1 > 1.0F)
{
par1 = 1.0F;
}
return Color.getHSBColor(0.62222224F - par1 * 0.05F, 0.5F + par1 * 0.1F, 1.0F).getRGB();
}
}
@Override
public float getFogCloseness()
{
// TODO Auto-generated method stub
2013-11-04 01:07:54 +00:00
return 1.0F;
}
2013-05-03 13:00:44 +00:00
}