2013-05-03 13:00:44 +00:00
|
|
|
package biomesoplenty.biomes;
|
|
|
|
|
|
|
|
import java.awt.Color;
|
|
|
|
import java.util.Random;
|
|
|
|
|
2013-05-07 04:41:56 +00:00
|
|
|
import net.minecraft.block.Block;
|
2013-05-03 13:00:44 +00:00
|
|
|
import net.minecraft.entity.passive.EntityMooshroom;
|
|
|
|
import net.minecraft.world.World;
|
|
|
|
import net.minecraft.world.biome.BiomeGenBase;
|
|
|
|
import net.minecraft.world.biome.SpawnListEntry;
|
2013-05-07 04:41:56 +00:00
|
|
|
import net.minecraft.world.gen.feature.WorldGenTallGrass;
|
2013-05-03 13:00:44 +00:00
|
|
|
import net.minecraft.world.gen.feature.WorldGenerator;
|
2013-05-29 01:05:27 +00:00
|
|
|
import biomesoplenty.api.Blocks;
|
|
|
|
import biomesoplenty.configuration.BOPConfiguration;
|
|
|
|
import biomesoplenty.worldgen.WorldGenMoss;
|
|
|
|
import biomesoplenty.worldgen.WorldGenPrairie;
|
|
|
|
import biomesoplenty.worldgen.WorldGenSwampTall;
|
2013-06-26 21:50:08 +00:00
|
|
|
import biomesoplenty.worldgen.WorldGenThickTree2;
|
2013-05-29 01:05:27 +00:00
|
|
|
import biomesoplenty.worldgen.WorldGenWillow;
|
2013-05-03 13:00:44 +00:00
|
|
|
|
|
|
|
public class BiomeGenFungiForest extends BiomeGenBase
|
|
|
|
{
|
2013-05-31 10:34:02 +00:00
|
|
|
private BiomeDecoratorBOP customBiomeDecorator;
|
2013-05-03 13:00:44 +00:00
|
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
|
public BiomeGenFungiForest(int par1)
|
2013-05-31 10:34:02 +00:00
|
|
|
{
|
|
|
|
super(par1);
|
|
|
|
theBiomeDecorator = new BiomeDecoratorBOP(this);
|
|
|
|
customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
|
|
|
|
customBiomeDecorator.treesPerChunk = 8;
|
|
|
|
customBiomeDecorator.grassPerChunk = 6;
|
|
|
|
customBiomeDecorator.sproutsPerChunk = 2;
|
|
|
|
customBiomeDecorator.bushesPerChunk = 2;
|
|
|
|
customBiomeDecorator.highGrassPerChunk = 1;
|
|
|
|
customBiomeDecorator.mushroomsPerChunk = 8;
|
|
|
|
customBiomeDecorator.bigMushroomsPerChunk = 8;
|
|
|
|
customBiomeDecorator.toadstoolsPerChunk = 5;
|
|
|
|
customBiomeDecorator.portobellosPerChunk = 7;
|
|
|
|
customBiomeDecorator.blueMilksPerChunk = 4;
|
|
|
|
customBiomeDecorator.glowshroomsPerChunk = 2;
|
|
|
|
customBiomeDecorator.blueFlowersPerChunk = 3;
|
|
|
|
customBiomeDecorator.cattailsPerChunk = 1;
|
|
|
|
customBiomeDecorator.highCattailsPerChunk = 2;
|
|
|
|
customBiomeDecorator.reedsBOPPerChunk = 1;
|
|
|
|
customBiomeDecorator.lilyflowersPerChunk = 2;
|
|
|
|
customBiomeDecorator.generateMycelium = true;
|
|
|
|
customBiomeDecorator.generatePumpkins = true;
|
|
|
|
waterColorMultiplier = 65326;
|
|
|
|
spawnableCreatureList.clear();
|
|
|
|
spawnableWaterCreatureList.clear();
|
|
|
|
spawnableCreatureList.add(new SpawnListEntry(EntityMooshroom.class, 3, 4, 8));
|
|
|
|
}
|
2013-05-03 13:00:44 +00:00
|
|
|
|
2013-05-31 10:34:02 +00:00
|
|
|
@Override
|
|
|
|
public void decorate(World par1World, Random par2Random, int par3, int par4)
|
|
|
|
{
|
|
|
|
super.decorate(par1World, par2Random, par3, par4);
|
|
|
|
WorldGenMoss var5 = new WorldGenMoss();
|
2013-05-03 13:00:44 +00:00
|
|
|
|
2013-05-31 10:34:02 +00:00
|
|
|
for (int var6 = 0; var6 < 20; ++var6)
|
|
|
|
{
|
|
|
|
int var7 = par3 + par2Random.nextInt(16) + 8;
|
|
|
|
byte var8 = 58;
|
|
|
|
int var9 = par4 + par2Random.nextInt(16) + 8;
|
|
|
|
var5.generate(par1World, par2Random, var7, var8, var9);
|
|
|
|
}
|
|
|
|
}
|
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-06-26 21:50:08 +00:00
|
|
|
return par1Random.nextInt(2) == 0 ? new WorldGenThickTree2(false) : (par1Random.nextInt(5) == 0 ? new WorldGenWillow() : (par1Random.nextInt(3) == 0 ? new WorldGenPrairie(false) : new WorldGenSwampTall()));
|
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(3) == 0 ? new WorldGenTallGrass(Block.tallGrass.blockID, 1) : (par1Random.nextInt(4) == 0 ? new WorldGenTallGrass(Block.tallGrass.blockID, 2) : (par1Random.nextInt(2) == 0 ? new WorldGenTallGrass(Blocks.foliage.get().blockID, 2) : new WorldGenTallGrass(Blocks.foliage.get().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()
|
|
|
|
{
|
|
|
|
return 5359235;
|
|
|
|
}
|
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 5359235;
|
|
|
|
}
|
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)
|
|
|
|
{
|
|
|
|
if (BOPConfiguration.skyColors = true)
|
|
|
|
return 5888980;
|
|
|
|
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-03 13:00:44 +00:00
|
|
|
}
|