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

41 lines
1.1 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-08 20:11:53 +00:00
if (Biomes.promisedLand.isPresent())
{
2013-05-08 20:31:57 +00:00
AllowedBiomes.add(Biomes.promisedLand.get());
2013-05-08 20:11:53 +00:00
}
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;
}
}