BiomesOPlenty/common/biomesoplenty/biomes/BiomeGenMysticGrove.java

143 lines
3.8 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;
2013-11-06 07:51:06 +00:00
import worldcore.interfaces.IWCFog;
2013-11-04 21:45:35 +00:00
import biomesoplenty.api.Blocks;
2013-09-14 10:16:39 +00:00
import biomesoplenty.configuration.configfile.BOPConfigurationMain;
import biomesoplenty.configuration.configfile.BOPConfigurationMisc;
import biomesoplenty.worldgen.realtree.WorldGenRealMagic;
import biomesoplenty.worldgen.tree.WorldGenJacaranda;
2013-09-14 10:16:39 +00:00
import biomesoplenty.worldgen.tree.WorldGenMystic2;
import biomesoplenty.worldgen.tree.WorldGenSwampTall;
2013-05-03 13:00:44 +00:00
2013-11-06 07:51:06 +00:00
public class BiomeGenMysticGrove 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 BiomeGenMysticGrove(int par1)
2013-05-31 10:34:02 +00:00
{
super(par1);
theBiomeDecorator = new BiomeDecoratorBOP(this);
customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
2013-09-14 10:16:39 +00:00
if (BOPConfigurationMain.realisticTrees)
2013-07-13 08:53:58 +00:00
{
customBiomeDecorator.treesPerChunk = 1;
}
else
{
2013-11-04 21:45:35 +00:00
customBiomeDecorator.treesPerChunk = 9;
2013-07-13 08:53:58 +00:00
}
2013-11-04 21:45:35 +00:00
customBiomeDecorator.grassPerChunk = 15;
customBiomeDecorator.wheatGrassPerChunk = 3;
2013-05-31 10:34:02 +00:00
customBiomeDecorator.flowersPerChunk = 8;
2013-11-04 21:45:35 +00:00
customBiomeDecorator.pinkFlowersPerChunk = 9;
customBiomeDecorator.glowFlowersPerChunk = 10;
2013-05-31 10:34:02 +00:00
customBiomeDecorator.rosesPerChunk = 8;
customBiomeDecorator.sandPerChunk = -999;
customBiomeDecorator.sandPerChunk2 = -999;
2013-11-04 21:45:35 +00:00
customBiomeDecorator.sproutsPerChunk = 1;
customBiomeDecorator.hydrangeasPerChunk = 6;
customBiomeDecorator.blueMilksPerChunk = 1;
2013-05-31 10:34:02 +00:00
customBiomeDecorator.lilyflowersPerChunk = 3;
customBiomeDecorator.poisonWaterPerChunk = 1;
2013-11-09 09:02:22 +00:00
waterColorMultiplier = 16715898;
2013-05-31 10:34:02 +00:00
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-09-14 10:16:39 +00:00
if (BOPConfigurationMain.realisticTrees)
2013-07-13 08:53:58 +00:00
{
return new WorldGenRealMagic();
}
return par1Random.nextInt(4) == 0 ? new WorldGenMystic2(false) : (par1Random.nextInt(3) == 0 ? new WorldGenJacaranda(false) : ((par1Random.nextInt(3) == 0 ? this.worldGeneratorBigTree : ((par1Random.nextInt(8) == 0 ? new WorldGenSwampTall() : this.worldGeneratorTrees)))));
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)
{
2013-11-04 21:45:35 +00:00
return (par1Random.nextInt(5) == 0 ? new WorldGenTallGrass(Blocks.foliage.get().blockID, 1) : (par1Random.nextInt(3) == 0 ? new WorldGenTallGrass(Blocks.foliage.get().blockID, 2) : new WorldGenTallGrass(Block.tallGrass.blockID, 1)));
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()
{
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-11-04 19:39:23 +00:00
return 7397529;
2013-05-31 10:34:02 +00:00
}
2013-11-03 22:22:44 +00:00
/**
* Fog Color
*/
@Override
public int getFogColour()
{
return 16755401;
}
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-11-03 22:22:44 +00:00
return 8972496;
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 1.0F;
}
2013-05-03 13:00:44 +00:00
}