2013-05-07 18:33:31 +00:00
|
|
|
package biomesoplenty.world.layer;
|
|
|
|
|
2013-05-26 12:17:58 +00:00
|
|
|
import net.minecraft.world.gen.layer.IntCache;
|
2013-09-06 21:09:54 +00:00
|
|
|
import biomesoplenty.api.Biomes;
|
2013-09-14 23:01:07 +00:00
|
|
|
import biomesoplenty.configuration.configfile.BOPConfigurationBiomeGen;
|
2013-10-26 16:44:05 +00:00
|
|
|
import biomesoplenty.configuration.configfile.BOPConfigurationTerrainGen;
|
2013-05-26 12:17:58 +00:00
|
|
|
|
2013-05-07 18:33:31 +00:00
|
|
|
public class BiomeLayerCreate extends BiomeLayer
|
|
|
|
{
|
2013-10-26 16:44:05 +00:00
|
|
|
final private int ABYSS_CHANCE = 2;
|
|
|
|
final private int CORAL_CHANCE = 5;
|
|
|
|
final private int KELP_CHANCE = 5;
|
|
|
|
|
2013-05-31 10:34:02 +00:00
|
|
|
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);
|
|
|
|
|
2013-09-14 10:16:39 +00:00
|
|
|
boolean ocean = BOPConfigurationBiomeGen.oceanGen;
|
2013-09-13 02:27:32 +00:00
|
|
|
boolean abyss = Biomes.oceanAbyss.isPresent();
|
2013-10-26 16:44:05 +00:00
|
|
|
boolean coral = Biomes.oceanCoral.isPresent();
|
|
|
|
boolean kelp = Biomes.oceanKelp.isPresent();
|
2013-05-31 10:34:02 +00:00
|
|
|
|
|
|
|
for (int var6 = 0; var6 < par4; ++var6)
|
|
|
|
{
|
|
|
|
for (int var7 = 0; var7 < par3; ++var7)
|
|
|
|
{
|
|
|
|
this.initChunkSeed(par1 + var7, par2 + var6);
|
|
|
|
if(ocean)
|
|
|
|
{
|
2013-10-26 16:44:05 +00:00
|
|
|
if (this.nextInt(100) < BOPConfigurationTerrainGen.landmassPercentage)
|
|
|
|
{
|
|
|
|
var5[var7 + var6 * par3] = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int oceanType = 0;
|
|
|
|
if (abyss && this.nextInt(100) < ABYSS_CHANCE) oceanType = Biomes.oceanAbyss.get().biomeID;
|
|
|
|
else if (coral && this.nextInt(100) < CORAL_CHANCE) oceanType = Biomes.oceanCoral.get().biomeID;
|
|
|
|
else if (kelp && this.nextInt(100) < KELP_CHANCE) oceanType = Biomes.oceanKelp.get().biomeID;
|
|
|
|
|
|
|
|
var5[var7 + var6 * par3] = oceanType;
|
|
|
|
}
|
2013-05-31 10:34:02 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
var5[var7 + var6 * par3] = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-10-26 16:44:05 +00:00
|
|
|
if (par1 > -par3 && par1 <= 0 && par2 > -par4 && par2 <= 0)
|
2013-05-31 10:34:02 +00:00
|
|
|
{
|
2013-10-26 16:44:05 +00:00
|
|
|
var5[-par1 + -par2 * par3] = 1;
|
2013-05-31 10:34:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return var5;
|
|
|
|
}
|
2013-05-07 18:33:31 +00:00
|
|
|
}
|