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;
|
2013-09-14 10:16:39 +00:00
|
|
|
import biomesoplenty.configuration.configfile.BOPConfigurationMisc;
|
2013-11-04 00:40:43 +00:00
|
|
|
import biomesoplenty.interfaces.IBOPFog;
|
2013-05-29 01:05:27 +00:00
|
|
|
import biomesoplenty.worldgen.WorldGenMoss;
|
2013-11-03 22:22:44 +00:00
|
|
|
import biomesoplenty.worldgen.tree.WorldGenSequoia;
|
2013-05-03 13:00:44 +00:00
|
|
|
|
2013-11-04 00:40:43 +00:00
|
|
|
public class BiomeGenFungiForest extends BiomeGenBase implements IBOPFog
|
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
|
|
|
|
|
|
|
@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;
|
2013-10-20 18:05:23 +00:00
|
|
|
customBiomeDecorator.grassPerChunk = 4;
|
2013-05-31 10:34:02 +00:00
|
|
|
customBiomeDecorator.sproutsPerChunk = 2;
|
2013-10-20 18:05:23 +00:00
|
|
|
customBiomeDecorator.bushesPerChunk = 1;
|
2013-05-31 10:34:02 +00:00
|
|
|
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;
|
2013-07-10 12:51:30 +00:00
|
|
|
customBiomeDecorator.carrotsPerChunk = 1;
|
2013-09-20 21:47:49 +00:00
|
|
|
customBiomeDecorator.wheatGrassPerChunk = 3;
|
2013-10-20 18:05:23 +00:00
|
|
|
customBiomeDecorator.shrubsPerChunk = 2;
|
|
|
|
customBiomeDecorator.koruPerChunk = 1;
|
2013-05-31 10:34:02 +00:00
|
|
|
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-11-03 22:22:44 +00:00
|
|
|
return new WorldGenSequoia(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(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-11-03 22:22:44 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Fog Color
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
public int getFogColour()
|
|
|
|
{
|
|
|
|
return 7985325;
|
|
|
|
}
|
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 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-11-04 00:40:43 +00:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public float getFogCloseness()
|
|
|
|
{
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
return 0;
|
|
|
|
}
|
2013-05-03 13:00:44 +00:00
|
|
|
}
|