BiomesOPlenty/common/biomesoplenty/biomes/BiomeGenOminousWoods.java

130 lines
3.6 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.EntityCaveSpider;
import net.minecraft.entity.monster.EntityEnderman;
import net.minecraft.entity.passive.EntityBat;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.SpawnListEntry;
import net.minecraft.world.gen.feature.WorldGenTallGrass;
import net.minecraft.world.gen.feature.WorldGenerator;
2013-11-06 07:51:06 +00:00
import worldcore.interfaces.IWCFog;
2013-09-14 10:16:39 +00:00
import biomesoplenty.configuration.configfile.BOPConfigurationMisc;
2013-11-04 19:39:23 +00:00
import biomesoplenty.worldgen.tree.WorldGenDeadTree3;
2013-09-14 10:16:39 +00:00
import biomesoplenty.worldgen.tree.WorldGenOminous1;
import biomesoplenty.worldgen.tree.WorldGenOminous2;
2013-05-03 13:00:44 +00:00
2013-11-06 07:51:06 +00:00
public class BiomeGenOminousWoods extends BiomeGenBase implements IWCFog
2013-05-03 13:00:44 +00:00
{
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
@SuppressWarnings("unchecked")
2013-05-03 13:00:44 +00:00
public BiomeGenOminousWoods(int par1)
2013-05-31 10:34:02 +00:00
{
super(par1);
theBiomeDecorator = new BiomeDecoratorBOP(this);
customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
2013-11-04 19:39:23 +00:00
customBiomeDecorator.treesPerChunk = 8;
2013-05-31 10:34:02 +00:00
customBiomeDecorator.grassPerChunk = 1;
2013-09-20 23:16:51 +00:00
customBiomeDecorator.wheatGrassPerChunk = 1;
2013-05-31 10:34:02 +00:00
customBiomeDecorator.flowersPerChunk = -999;
customBiomeDecorator.deathbloomsPerChunk = 1;
customBiomeDecorator.mushroomsPerChunk = 8;
customBiomeDecorator.reedsPerChunk = -999;
customBiomeDecorator.sandPerChunk = -999;
customBiomeDecorator.sandPerChunk2 = -999;
customBiomeDecorator.thornsPerChunk = 9;
customBiomeDecorator.poisonIvyPerChunk = 3;
customBiomeDecorator.poisonWaterPerChunk = 15;
waterColorMultiplier = 1973030;
spawnableMonsterList.clear();
spawnableCreatureList.clear();
spawnableWaterCreatureList.clear();
spawnableMonsterList.add(new SpawnListEntry(EntityCaveSpider.class, 5, 1, 2));
spawnableMonsterList.add(new SpawnListEntry(EntityEnderman.class, 10, 1, 4));
spawnableCaveCreatureList.add(new SpawnListEntry(EntityBat.class, 10, 8, 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 getRandomWorldGenForTrees(Random par1Random)
{
2013-05-03 13:00:44 +00:00
//return (WorldGenerator)(par1Random.nextInt(3) == 0 ? new WorldGenWillow2() : (par1Random.nextInt(7) == 0 ? new WorldGenDarkTree1() : (par1Random.nextInt(5) == 0 ? new WorldGenWillow1() : new WorldGenDarkTree2())));
2013-11-04 19:39:23 +00:00
return par1Random.nextInt(2) == 0 ? new WorldGenOminous1(false) : (par1Random.nextInt(6) == 0 ? new WorldGenDeadTree3(false) : new WorldGenOminous2());
2013-05-31 10:34:02 +00:00
}
/**
* Gets a WorldGen appropriate for this biome.
*/
@Override
public WorldGenerator getRandomWorldGenForGrass(Random par1Random)
{
return par1Random.nextInt(6) == 0 ? new WorldGenTallGrass(Block.tallGrass.blockID, 0) : new WorldGenTallGrass(Block.tallGrass.blockID, 1);
}
/**
* Provides the basic grass color based on the biome temperature and rainfall
*/
@Override
public int getBiomeGrassColor()
{
return 4145489;
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 4145489;
}
2013-11-03 22:22:44 +00:00
/**
* Fog Color
*/
@Override
public int getFogColour()
{
return 3420989;
}
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 5069168;
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();
}
2013-05-31 10:34:02 +00:00
}
@Override
public float getFogCloseness()
{
// TODO Auto-generated method stub
2013-11-04 01:07:54 +00:00
return 0.2F;
}
2013-05-03 13:00:44 +00:00
}