2013-05-08 20:00:23 +00:00
|
|
|
package biomesoplenty.world.layer;
|
|
|
|
|
2013-05-08 20:11:53 +00:00
|
|
|
import java.util.ArrayList;
|
|
|
|
|
2013-05-08 20:00:23 +00:00
|
|
|
import net.minecraft.world.WorldType;
|
|
|
|
import net.minecraft.world.biome.BiomeGenBase;
|
2013-05-26 12:17:58 +00:00
|
|
|
import net.minecraft.world.gen.layer.IntCache;
|
2013-05-29 01:05:27 +00:00
|
|
|
import biomesoplenty.api.Biomes;
|
2013-09-14 10:16:39 +00:00
|
|
|
import biomesoplenty.configuration.configfile.BOPConfigurationBiomeGen;
|
2013-05-08 20:00:23 +00:00
|
|
|
|
|
|
|
public class BiomeLayerBiomes extends BiomeLayer
|
|
|
|
{
|
2013-05-31 11:42:57 +00:00
|
|
|
private int dimension = 0;
|
|
|
|
|
2013-05-18 15:06:30 +00:00
|
|
|
private BiomeGenBase[] surfaceBiomes;
|
2013-05-26 12:17:58 +00:00
|
|
|
private static ArrayList<BiomeGenBase> oceanBiomes = new ArrayList<BiomeGenBase>();
|
2013-05-18 15:06:30 +00:00
|
|
|
private static ArrayList<BiomeGenBase> netherBiomes = new ArrayList<BiomeGenBase>();
|
|
|
|
private static ArrayList<BiomeGenBase> promisedBiomes = new ArrayList<BiomeGenBase>();
|
2013-05-31 11:42:57 +00:00
|
|
|
|
|
|
|
public BiomeLayerBiomes(long par1, BiomeLayer par3GenLayer, WorldType par4WorldType, int dim)
|
|
|
|
{
|
|
|
|
super(par1);
|
2013-05-08 20:00:23 +00:00
|
|
|
parent = par3GenLayer;
|
2013-05-18 15:06:30 +00:00
|
|
|
dimension = dim;
|
2013-05-31 11:42:57 +00:00
|
|
|
|
2013-05-18 15:06:30 +00:00
|
|
|
//SURFACE BIOMES
|
|
|
|
surfaceBiomes = par4WorldType.getBiomesForWorldType();
|
2013-05-31 11:42:57 +00:00
|
|
|
|
2013-05-26 12:17:58 +00:00
|
|
|
//OCEAN BIOMES
|
|
|
|
oceanBiomes.add(BiomeGenBase.ocean);
|
2013-09-13 02:27:32 +00:00
|
|
|
if (Biomes.oceanAbyss.isPresent())
|
|
|
|
{
|
2013-09-21 13:57:55 +00:00
|
|
|
if (BOPConfigurationBiomeGen.oceanicAbyssGen)
|
|
|
|
{
|
|
|
|
oceanBiomes.add(Biomes.oceanAbyss.get());
|
|
|
|
}
|
2013-09-13 02:27:32 +00:00
|
|
|
}
|
2013-09-08 16:06:12 +00:00
|
|
|
if (Biomes.oceanCoral.isPresent())
|
2013-05-26 12:17:58 +00:00
|
|
|
{
|
2013-09-21 13:57:55 +00:00
|
|
|
if (BOPConfigurationBiomeGen.coralReefGen)
|
|
|
|
{
|
|
|
|
oceanBiomes.add(Biomes.oceanCoral.get());
|
|
|
|
}
|
2013-05-26 12:17:58 +00:00
|
|
|
}
|
|
|
|
if (Biomes.oceanKelp.isPresent())
|
|
|
|
{
|
2013-09-21 13:57:55 +00:00
|
|
|
if (BOPConfigurationBiomeGen.kelpForestGen)
|
|
|
|
{
|
|
|
|
oceanBiomes.add(Biomes.oceanKelp.get());
|
|
|
|
}
|
2013-09-08 16:06:12 +00:00
|
|
|
}
|
2013-05-18 15:06:30 +00:00
|
|
|
|
|
|
|
//NETHER BIOMES
|
2013-05-24 14:36:00 +00:00
|
|
|
if (Biomes.netherBase.isPresent())
|
|
|
|
{
|
|
|
|
netherBiomes.add(Biomes.netherBase.get());
|
|
|
|
}
|
2013-05-18 15:06:30 +00:00
|
|
|
if (Biomes.netherGarden.isPresent())
|
|
|
|
{
|
2013-09-21 13:57:55 +00:00
|
|
|
if (BOPConfigurationBiomeGen.undergardenGen)
|
2013-06-04 03:14:31 +00:00
|
|
|
{
|
|
|
|
netherBiomes.add(Biomes.netherGarden.get());
|
|
|
|
}
|
2013-05-18 15:06:30 +00:00
|
|
|
}
|
|
|
|
if (Biomes.netherDesert.isPresent())
|
|
|
|
{
|
2013-09-21 13:57:55 +00:00
|
|
|
if (BOPConfigurationBiomeGen.corruptedSandsGen)
|
2013-06-04 03:14:31 +00:00
|
|
|
{
|
|
|
|
netherBiomes.add(Biomes.netherDesert.get());
|
|
|
|
}
|
2013-05-18 15:06:30 +00:00
|
|
|
}
|
|
|
|
if (Biomes.netherLava.isPresent())
|
|
|
|
{
|
2013-09-21 13:57:55 +00:00
|
|
|
if (BOPConfigurationBiomeGen.phantasmagoricInfernoGen)
|
2013-06-04 03:14:31 +00:00
|
|
|
{
|
|
|
|
netherBiomes.add(Biomes.netherLava.get());
|
|
|
|
}
|
2013-05-18 15:06:30 +00:00
|
|
|
}
|
2013-05-23 20:22:58 +00:00
|
|
|
if (Biomes.netherBone.isPresent())
|
2013-05-08 20:11:53 +00:00
|
|
|
{
|
2013-09-21 13:57:55 +00:00
|
|
|
if (BOPConfigurationBiomeGen.boneyardGen)
|
2013-06-04 03:14:31 +00:00
|
|
|
{
|
|
|
|
netherBiomes.add(Biomes.netherBone.get());
|
|
|
|
}
|
2013-05-09 07:00:09 +00:00
|
|
|
}
|
2013-10-26 20:42:11 +00:00
|
|
|
if (Biomes.netherBlood.isPresent())
|
|
|
|
{
|
|
|
|
if (BOPConfigurationBiomeGen.bloodyHeapGen)
|
|
|
|
{
|
|
|
|
netherBiomes.add(Biomes.netherBlood.get());
|
|
|
|
}
|
|
|
|
}
|
2013-05-31 11:42:57 +00:00
|
|
|
if (Biomes.netherBiomes.size() > 0)
|
|
|
|
{
|
|
|
|
netherBiomes.addAll(Biomes.netherBiomes);
|
|
|
|
}
|
|
|
|
|
2013-05-18 15:06:30 +00:00
|
|
|
//PROMISED BIOMES
|
|
|
|
if (Biomes.promisedLandForest.isPresent())
|
|
|
|
{
|
|
|
|
promisedBiomes.add(Biomes.promisedLandForest.get());
|
|
|
|
}
|
2013-05-09 07:00:09 +00:00
|
|
|
if (Biomes.promisedLandPlains.isPresent())
|
|
|
|
{
|
2013-05-18 15:06:30 +00:00
|
|
|
promisedBiomes.add(Biomes.promisedLandPlains.get());
|
2013-05-09 07:00:09 +00:00
|
|
|
}
|
|
|
|
if (Biomes.promisedLandSwamp.isPresent())
|
|
|
|
{
|
2013-05-18 15:06:30 +00:00
|
|
|
promisedBiomes.add(Biomes.promisedLandSwamp.get());
|
2013-05-09 07:00:09 +00:00
|
|
|
}
|
2013-05-31 11:42:57 +00:00
|
|
|
}
|
2013-05-31 10:34:02 +00:00
|
|
|
|
2013-07-01 00:31:34 +00:00
|
|
|
@Override
|
|
|
|
public int[] getInts(int par1, int par2, int par3, int par4)
|
2013-05-31 11:42:57 +00:00
|
|
|
{
|
|
|
|
int[] var5 = this.parent.getInts(par1, par2, par3, par4);
|
|
|
|
int[] var6 = IntCache.getIntCache(par3 * par4);
|
|
|
|
|
2013-10-26 16:44:05 +00:00
|
|
|
boolean abyss = Biomes.oceanAbyss.isPresent();
|
2013-05-31 11:42:57 +00:00
|
|
|
boolean coral = Biomes.oceanCoral.isPresent();
|
|
|
|
boolean kelp = Biomes.oceanKelp.isPresent();
|
|
|
|
|
|
|
|
for (int var7 = 0; var7 < par4; ++var7)
|
|
|
|
{
|
|
|
|
for (int var8 = 0; var8 < par3; ++var8)
|
|
|
|
{
|
|
|
|
this.initChunkSeed((long)(var8 + par1), (long)(var7 + par2));
|
|
|
|
int var9 = var5[var8 + var7 * par3];
|
2013-05-26 12:17:58 +00:00
|
|
|
if(dimension == 0) //SURFACE BIOMES
|
|
|
|
{
|
|
|
|
if (var9 == 0)
|
|
|
|
{
|
|
|
|
var6[var8 + var7 * par3] = 0;
|
|
|
|
}
|
2013-05-31 11:42:57 +00:00
|
|
|
else
|
2013-05-26 12:17:58 +00:00
|
|
|
{
|
|
|
|
var6[var8 + var7 * par3] = surfaceBiomes[this.nextInt(surfaceBiomes.length)].biomeID;
|
|
|
|
}
|
2013-05-31 11:42:57 +00:00
|
|
|
|
2013-09-13 02:27:32 +00:00
|
|
|
if (abyss)
|
|
|
|
{
|
|
|
|
if(var9 == Biomes.oceanAbyss.get().biomeID)
|
|
|
|
{
|
|
|
|
var6[var8 + var7 * par3] = oceanBiomes.get(this.nextInt(oceanBiomes.size())).biomeID;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-09-08 16:06:12 +00:00
|
|
|
if (coral)
|
2013-05-26 12:17:58 +00:00
|
|
|
{
|
|
|
|
if(var9 == Biomes.oceanCoral.get().biomeID)
|
|
|
|
{
|
|
|
|
var6[var8 + var7 * par3] = oceanBiomes.get(this.nextInt(oceanBiomes.size())).biomeID;
|
|
|
|
}
|
|
|
|
}
|
2013-05-31 11:42:57 +00:00
|
|
|
|
2013-05-26 12:17:58 +00:00
|
|
|
if (kelp)
|
|
|
|
{
|
|
|
|
if(var9 == Biomes.oceanKelp.get().biomeID)
|
|
|
|
{
|
|
|
|
var6[var8 + var7 * par3] = oceanBiomes.get(this.nextInt(oceanBiomes.size())).biomeID;
|
|
|
|
}
|
2013-09-08 16:06:12 +00:00
|
|
|
}
|
2013-05-26 12:17:58 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
else if(dimension == 1) //HELL BIOMES
|
2013-05-18 15:06:30 +00:00
|
|
|
{
|
|
|
|
var6[var8 + var7 * par3] = netherBiomes.get(this.nextInt(netherBiomes.size())).biomeID;
|
|
|
|
}
|
|
|
|
else if(dimension == 2) //PROMISED BIOMES
|
|
|
|
{
|
|
|
|
var6[var8 + var7 * par3] = promisedBiomes.get(this.nextInt(promisedBiomes.size())).biomeID;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
var6[var8 + var7 * par3] = surfaceBiomes[this.nextInt(surfaceBiomes.length)].biomeID;
|
|
|
|
}
|
2013-05-31 11:42:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return var6;
|
|
|
|
}
|
2013-05-08 20:00:23 +00:00
|
|
|
}
|