BiomesOPlenty/common/biomesoplenty/biomes/BiomeGenMysticGrove.java

125 lines
3.2 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.EntityWitch;
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;
import biomesoplenty.configuration.BOPConfiguration;
2013-07-05 05:21:10 +00:00
import biomesoplenty.worldgen.WorldGenMystic1;
import biomesoplenty.worldgen.WorldGenMystic2;
2013-07-13 08:53:58 +00:00
import biomesoplenty.worldgen.WorldGenRealMagic;
2013-07-05 05:21:10 +00:00
import biomesoplenty.worldgen.WorldGenSwampTall;
2013-05-03 13:00:44 +00:00
public class BiomeGenMysticGrove 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
@SuppressWarnings("unchecked")
2013-05-03 13:00:44 +00:00
public BiomeGenMysticGrove(int par1)
2013-05-31 10:34:02 +00:00
{
super(par1);
theBiomeDecorator = new BiomeDecoratorBOP(this);
customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
2013-08-03 00:07:43 +00:00
if (BOPConfiguration.Main.realisticTrees)
2013-07-13 08:53:58 +00:00
{
customBiomeDecorator.treesPerChunk = 1;
}
else
{
customBiomeDecorator.treesPerChunk = 8;
}
2013-05-31 10:34:02 +00:00
customBiomeDecorator.grassPerChunk = 7;
customBiomeDecorator.flowersPerChunk = 8;
customBiomeDecorator.pinkFlowersPerChunk = 6;
customBiomeDecorator.glowFlowersPerChunk = 15;
customBiomeDecorator.rosesPerChunk = 8;
customBiomeDecorator.sandPerChunk = -999;
customBiomeDecorator.sandPerChunk2 = -999;
customBiomeDecorator.sproutsPerChunk = 3;
customBiomeDecorator.hydrangeasPerChunk = 3;
customBiomeDecorator.blueMilksPerChunk = 4;
customBiomeDecorator.glowshroomsPerChunk = 2;
customBiomeDecorator.lilyflowersPerChunk = 3;
customBiomeDecorator.hotSpringsPerChunk = 2;
customBiomeDecorator.poisonWaterPerChunk = 1;
2013-05-31 10:34:02 +00:00
waterColorMultiplier = 15349914;
spawnableMonsterList.clear();
spawnableCreatureList.clear();
spawnableWaterCreatureList.clear();
spawnableMonsterList.add(new SpawnListEntry(EntityWitch.class, 10, 4, 4));
}
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-08-03 00:07:43 +00:00
if (BOPConfiguration.Main.realisticTrees)
2013-07-13 08:53:58 +00:00
{
return new WorldGenRealMagic();
}
2013-07-05 05:21:10 +00:00
return par1Random.nextInt(5) == 0 ? new WorldGenMystic2(false) : (par1Random.nextInt(7) == 0 ? new WorldGenSwampTall() : new WorldGenMystic1(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
/**
* Gets a WorldGen appropriate for this biome.
*/
@Override
public WorldGenerator getRandomWorldGenForGrass(Random par1Random)
{
return par1Random.nextInt(2) == 0 ? new WorldGenTallGrass(Block.tallGrass.blockID, 2) : new WorldGenTallGrass(Block.tallGrass.blockID, 1);
}
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()
{
2013-07-05 05:21:10 +00:00
return 6934491;
2013-05-31 10:34:02 +00:00
}
/**
* Provides the basic foliage color based on the biome temperature and rainfall
*/
@Override
public int getBiomeFoliageColor()
{
2013-07-05 05:21:10 +00:00
return 7332553;
2013-05-31 10:34:02 +00:00
}
/**
* takes temperature, returns color
*/
@Override
public int getSkyColorByTemp(float par1)
{
2013-08-03 00:07:43 +00:00
if (BOPConfiguration.Misc.skyColors)
2013-05-31 10:34:02 +00:00
return 16751558;
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
}
2013-05-03 13:00:44 +00:00
}