BiomesOPlenty/common/biomesoplenty/world/layer/BiomeLayerCreate.java
2013-09-13 16:44:22 +10:00

53 lines
No EOL
1.4 KiB
Java

package biomesoplenty.world.layer;
import net.minecraft.world.gen.layer.IntCache;
import biomesoplenty.configuration.BOPConfiguration;
import biomesoplenty.api.Biomes;
public class BiomeLayerCreate extends BiomeLayer
{
public BiomeLayerCreate(long par1, boolean o)
{
super(par1);
}
@Override
public int[] getInts(int par1, int par2, int par3, int par4)
{
int[] var5 = IntCache.getIntCache(par3 * par4);
boolean ocean = BOPConfiguration.BiomeGen.oceanGen;
boolean abyss = Biomes.oceanAbyss.isPresent();
boolean coral = Biomes.oceanCoral.isPresent();
boolean kelp = Biomes.oceanKelp.isPresent();
for (int var6 = 0; var6 < par4; ++var6)
{
for (int var7 = 0; var7 < par3; ++var7)
{
this.initChunkSeed(par1 + var7, par2 + var6);
if(ocean)
{
if(abyss) { var5[var7 + var6 * par3] = this.nextInt(50) == 0 ? 1 : Biomes.oceanAbyss.get().biomeID; }
else if(coral) { var5[var7 + var6 * par3] = this.nextInt(20) == 0 ? 1 : Biomes.oceanCoral.get().biomeID; }
else if(kelp) { var5[var7 + var6 * par3] = this.nextInt(20) == 0 ? 1 : Biomes.oceanKelp.get().biomeID; }
else { var5[var7 + var6 * par3] = this.nextInt(10) == 0 ? 1 : 0;}
}
else
{
var5[var7 + var6 * par3] = 1;
}
}
}
if(ocean)
{
if (par1 > -par3 && par1 <= 0 && par2 > -par4 && par2 <= 0)
{
var5[-par1 + -par2 * par3] = 1;
}
}
return var5;
}
}