Fixed ocean generation.

Added new Terrain Gen option.
This commit is contained in:
Amnet 2013-10-26 18:44:05 +02:00
parent 05fc6e2f2e
commit 69cd689352
4 changed files with 28 additions and 20 deletions

View file

@ -26,6 +26,7 @@ public class BOPConfigurationTerrainGen
public static boolean burningBlossomGen;
public static int villageDistance;
public static int landmassPercentage;
// Village biomes
public static boolean alpsVillage;
@ -141,6 +142,8 @@ public class BOPConfigurationTerrainGen
villageDistance = 8;
}
landmassPercentage = config.get("Biomes O\' Plenty World Type Settings", "Landmass Percentage", 10, "In Vanilla it is set to 10. Takes values from 0 to 100.").getInt();
// Biomes with villages
alpsVillage = config.get("Allow Villages", "Alps", false).getBoolean(false);
arcticVillage = config.get("Allow Villages", "Arctic", true).getBoolean(false);

View file

@ -83,13 +83,6 @@ public class BiomeLayerBiomes extends BiomeLayer
netherBiomes.add(Biomes.netherBone.get());
}
}
if (Biomes.netherBlood.isPresent())
{
if (BOPConfigurationBiomeGen.bloodyHeapGen)
{
netherBiomes.add(Biomes.netherBlood.get());
}
}
if (Biomes.netherBiomes.size() > 0)
{
netherBiomes.addAll(Biomes.netherBiomes);
@ -116,7 +109,7 @@ public class BiomeLayerBiomes extends BiomeLayer
int[] var5 = this.parent.getInts(par1, par2, par3, par4);
int[] var6 = IntCache.getIntCache(par3 * par4);
boolean abyss = Biomes.oceanCoral.isPresent();
boolean abyss = Biomes.oceanAbyss.isPresent();
boolean coral = Biomes.oceanCoral.isPresent();
boolean kelp = Biomes.oceanKelp.isPresent();

View file

@ -3,9 +3,14 @@ package biomesoplenty.world.layer;
import net.minecraft.world.gen.layer.IntCache;
import biomesoplenty.api.Biomes;
import biomesoplenty.configuration.configfile.BOPConfigurationBiomeGen;
import biomesoplenty.configuration.configfile.BOPConfigurationTerrainGen;
public class BiomeLayerCreate extends BiomeLayer
{
final private int ABYSS_CHANCE = 2;
final private int CORAL_CHANCE = 5;
final private int KELP_CHANCE = 5;
public BiomeLayerCreate(long par1, boolean o)
{
super(par1);
@ -18,8 +23,8 @@ public class BiomeLayerCreate extends BiomeLayer
boolean ocean = BOPConfigurationBiomeGen.oceanGen;
boolean abyss = Biomes.oceanAbyss.isPresent();
boolean coral = Biomes.oceanCoral.isPresent();
boolean kelp = Biomes.oceanKelp.isPresent();
boolean coral = Biomes.oceanCoral.isPresent();
boolean kelp = Biomes.oceanKelp.isPresent();
for (int var6 = 0; var6 < par4; ++var6)
{
@ -28,10 +33,19 @@ public class BiomeLayerCreate extends BiomeLayer
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;}
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;
}
}
else
{
@ -40,12 +54,9 @@ public class BiomeLayerCreate extends BiomeLayer
}
}
if(ocean)
if (par1 > -par3 && par1 <= 0 && par2 > -par4 && par2 <= 0)
{
if (par1 > -par3 && par1 <= 0 && par2 > -par4 && par2 <= 0)
{
var5[-par1 + -par2 * par3] = 1;
}
var5[-par1 + -par2 * par3] = 1;
}
return var5;

View file

@ -1,5 +1,6 @@
package biomesoplenty.world.layer;
import biomesoplenty.api.Biomes;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.layer.IntCache;
@ -32,7 +33,7 @@ public class BiomeLayerRiverMix extends BiomeLayer
for (int var8 = 0; var8 < par3 * par4; ++var8)
{
if (var5[var8] == BiomeGenBase.ocean.biomeID)
if (var5[var8] == BiomeGenBase.ocean.biomeID || var5[var8] == Biomes.oceanAbyss.get().biomeID || var5[var8] == Biomes.oceanCoral.get().biomeID || var5[var8] == Biomes.oceanKelp.get().biomeID)
{
var7[var8] = var5[var8];
}