Made some special case biomes configurable

This commit is contained in:
Adubbz 2014-01-17 21:37:51 +11:00
parent c6036c840f
commit d7dc2db2f3
4 changed files with 38 additions and 11 deletions

View File

@ -9,7 +9,7 @@ import net.minecraft.world.biome.BiomeGenBase;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.text.WordUtils;
import biomesoplenty.common.world.GenLayerBiomeBOP;
import biomesoplenty.common.world.layer.GenLayerBiomeBOP;
public class BOPBiomeHelper
{

View File

@ -13,7 +13,7 @@ import biomesoplenty.api.BOPBiomeHelper;
import biomesoplenty.api.BOPBiomeHelper.BOPBiomeEntry;
import biomesoplenty.api.BOPBiomeHelper.TemperatureType;
import biomesoplenty.common.core.BOPBiomes;
import biomesoplenty.common.world.GenLayerBiomeBOP;
import biomesoplenty.common.world.layer.GenLayerBiomeBOP;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.FMLLog;
@ -23,6 +23,15 @@ public class BOPConfigurationBiomeGen
public static ArrayList<String> disabledBiomes = new ArrayList();
public static boolean oceanGen = false;
public static boolean frozenOceanGen = false;
public static boolean deepOceanGen = false;
public static boolean mushroomIslandGen = false;
public static boolean mesaPlateauFGen = false;
public static boolean mesaPlateauGen = false;
public static boolean jungleGen = false;
public static boolean megaTaigaGen = false;
public static void addDefaultDisabledBiomes()
{
}
@ -60,7 +69,18 @@ public class BOPConfigurationBiomeGen
BOPBiomeHelper.getCorrespondingTemperatureTypeList(temperatureType).add(BOPBiomes.onlyBiome);
}
}
else
{
oceanGen = config.get("Special Biomes To Generate", "Ocean", true).getBoolean(true);
frozenOceanGen = config.get("Special Biomes To Generate", "FrozenOcean", true).getBoolean(true);
deepOceanGen = config.get("Special Biomes To Generate", "Deep Ocean", true).getBoolean(true);
mushroomIslandGen = config.get("Special Biomes To Generate", "MushroomIsland", true).getBoolean(true);
mesaPlateauFGen = config.get("Special Biomes To Generate", "Mesa Plateau F", true).getBoolean(true);
mesaPlateauGen = config.get("Special Biomes To Generate", "Mesa Plateau", true).getBoolean(true);
jungleGen = config.get("Special Biomes To Generate", "Jungle", true).getBoolean(true);
megaTaigaGen = config.get("Special Biomes To Generate", "Mega Taiga", true).getBoolean(true);
}
FMLCommonHandler.instance().getFMLLogger().log(Level.INFO, "[BiomesOPlenty] Generated Biome Gen Config!");
}
catch (Exception e)

View File

@ -1,5 +1,6 @@
package biomesoplenty.common.world;
import biomesoplenty.common.world.layer.GenLayerBiomeBOP;
import net.minecraft.world.World;
import net.minecraft.world.WorldType;
import net.minecraft.world.biome.BiomeGenBase;

View File

@ -1,4 +1,4 @@
package biomesoplenty.common.world;
package biomesoplenty.common.world.layer;
import java.util.ArrayList;
import java.util.Collection;
@ -13,6 +13,7 @@ import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.GenLayerBiome;
import net.minecraft.world.gen.layer.IntCache;
import biomesoplenty.api.BOPBiomeHelper.BOPBiomeEntry;
import biomesoplenty.common.configuration.BOPConfigurationBiomeGen;
public class GenLayerBiomeBOP extends GenLayerBiome
{
@ -44,11 +45,11 @@ public class GenLayerBiomeBOP extends GenLayerBiome
biomeID &= -3841;
//TODO: isOceanBiome()
if (func_151618_b(biomeID))
if (this.func_151618_b(biomeID))
{
aint1[j1 + i1 * par3] = biomeID;
}
else if (biomeID == BiomeGenBase.mushroomIsland.biomeID)
else if (biomeID == BiomeGenBase.mushroomIsland.biomeID && BOPConfigurationBiomeGen.mushroomIslandGen)
{
aint1[j1 + i1 * par3] = biomeID;
}
@ -56,12 +57,12 @@ public class GenLayerBiomeBOP extends GenLayerBiome
{
if (l1 > 0)
{
if (this.nextInt(3) == 0)
if (this.nextInt(3) == 0 && BOPConfigurationBiomeGen.mesaPlateauGen)
{
//TODO: mesaPlateau
aint1[j1 + i1 * par3] = BiomeGenBase.field_150608_ab.biomeID;
}
else
else if (BOPConfigurationBiomeGen.mesaPlateauFGen)
{
//TODO: mesaPlateau F
aint1[j1 + i1 * par3] = BiomeGenBase.field_150607_aa.biomeID;
@ -74,7 +75,7 @@ public class GenLayerBiomeBOP extends GenLayerBiome
}
else if (biomeID == 2)
{
if (l1 > 0)
if (l1 > 0 && BOPConfigurationBiomeGen.jungleGen)
{
aint1[j1 + i1 * par3] = BiomeGenBase.jungle.biomeID;
}
@ -85,7 +86,7 @@ public class GenLayerBiomeBOP extends GenLayerBiome
}
else if (biomeID == 3)
{
if (l1 > 0)
if (l1 > 0 && BOPConfigurationBiomeGen.megaTaigaGen)
{
//TODO: megaTaiga
aint1[j1 + i1 * par3] = BiomeGenBase.field_150578_U.biomeID;
@ -99,7 +100,7 @@ public class GenLayerBiomeBOP extends GenLayerBiome
{
aint1[j1 + i1 * par3] = getRandomBiome(icyBiomes).biome.biomeID;
}
else
else if (BOPConfigurationBiomeGen.mushroomIslandGen)
{
aint1[j1 + i1 * par3] = BiomeGenBase.mushroomIsland.biomeID;
}
@ -141,4 +142,9 @@ public class GenLayerBiomeBOP extends GenLayerBiome
return item;
}
}
protected static boolean isOceanBiome(int biomeID)
{
return biomeID == BiomeGenBase.ocean.biomeID && BOPConfigurationBiomeGen.oceanGen || biomeID == BiomeGenBase.field_150575_M.biomeID && BOPConfigurationBiomeGen.deepOceanGen || biomeID == BiomeGenBase.frozenOcean.biomeID && BOPConfigurationBiomeGen.frozenOceanGen;
}
}