BiomesOPlenty/src/minecraft/biomesoplenty/world/layer/BiomeLayerBiomes.java

51 lines
1.4 KiB
Java
Raw Normal View History

2013-05-08 20:00:23 +00:00
package biomesoplenty.world.layer;
2013-05-08 20:11:53 +00:00
import java.util.ArrayList;
import biomesoplenty.api.Biomes;
2013-05-08 20:00:23 +00:00
import net.minecraft.world.WorldType;
import net.minecraft.world.biome.BiomeGenBase;
public class BiomeLayerBiomes extends BiomeLayer
{
2013-05-08 20:31:57 +00:00
public static ArrayList<BiomeGenBase> AllowedBiomes = new ArrayList<BiomeGenBase>();
2013-05-08 20:00:23 +00:00
public BiomeLayerBiomes(long par1, BiomeLayer par3GenLayer, WorldType par4WorldType)
{
super(par1);
parent = par3GenLayer;
2013-05-09 07:00:09 +00:00
if (Biomes.promisedLandForest.isPresent())
2013-05-08 20:11:53 +00:00
{
2013-05-09 07:00:09 +00:00
AllowedBiomes.add(Biomes.promisedLandForest.get());
}
if (Biomes.promisedLandPlains.isPresent())
{
AllowedBiomes.add(Biomes.promisedLandPlains.get());
}
if (Biomes.promisedLandSwamp.isPresent())
{
AllowedBiomes.add(Biomes.promisedLandSwamp.get());
}
2013-05-08 20:00:23 +00:00
}
public int[] getInts(int par1, int par2, int par3, int par4)
{
int[] var5 = this.parent.getInts(par1, par2, par3, par4);
int[] var6 = LayerIntCache.getIntCache(par3 * par4);
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-08 20:31:57 +00:00
var6[var8 + var7 * par3] = AllowedBiomes.get(this.nextInt(AllowedBiomes.size())).biomeID;
2013-05-08 20:00:23 +00:00
}
}
return var6;
}
}