Overhauled the biome generation and id config files, redid biome registration/referencing and made the mcmod.info have alphabetical ordering because it was irritating me. In turn, you no longer have to pick a biome from every temperature type, generation of biomes added from the default world is now configurable (closes #239) and disabling special biomes should no longer cause any issues.

This commit is contained in:
Adubbz 2014-05-10 09:27:30 +10:00
parent 2628b811bb
commit 5c56d157cd
28 changed files with 984 additions and 1118 deletions

View file

@ -1,5 +1,5 @@
minecraft_version=1.7.2
forge_version=10.12.0.1024
forge_version=10.12.0.1074
mod_version=2.0.0
worldcore_version=1.1.0.17
fmp_version=1.0.0.182
fmp_version=1.0.0.182

View file

@ -54,7 +54,6 @@ public class BiomesOPlenty
BOPArmor.init();
BOPCrafting.init();
BOPBiomes.init();
BOPConfigurationBiomeGen.init(BOPConfiguration.biomeGenConfigFile);
BOPConfigurationVillages.init(BOPConfiguration.villagesConfigFile);
BOPConfigurationStrongholds.init(BOPConfiguration.strongholdsConfigFile);
BOPConfigurationWorldFeatures.init(BOPConfiguration.worldFeaturesConfigFile);

View file

@ -1,74 +0,0 @@
package biomesoplenty.api;
import java.util.HashMap;
import java.util.List;
import net.minecraft.world.biome.BiomeGenBase;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.text.WordUtils;
import biomesoplenty.common.world.BOPBiomeManager;
import biomesoplenty.common.world.BOPBiomeManager.BiomeEntry;
public class BOPBiomeHelper
{
public static HashMap<String, BiomeEntry>[] biomeLists = new HashMap[256];
public static void init()
{
biomeLists[-1 + 1] = new HashMap();
biomeLists[0 + 1] = new HashMap();
}
public static void registerBiome(BiomeEntry biome, int dimID, String name)
{
biomeLists[dimID + 1].put(name, biome);
}
public static void registerBiome(BiomeEntry biome, String name)
{
registerBiome(biome, 0, name);
}
public static BiomeGenBase get(int dimID, String name)
{
return biomeLists[dimID + 1].get("biomesoplenty:" + name).biome;
}
public static BiomeGenBase get(String name)
{
return get(0, name);
}
public static String convertBiomeName(String originalName)
{
return StringUtils.remove(StringUtils.uncapitalize(WordUtils.capitalize(originalName)), " ");
}
public static List<BiomeEntry> getCorrespondingTemperatureTypeList(TemperatureType type)
{
switch (type)
{
case HOT:
return BOPBiomeManager.desertBiomes;
case WARM:
return BOPBiomeManager.warmBiomes;
case COOL:
return BOPBiomeManager.coolBiomes;
case ICY:
return BOPBiomeManager.icyBiomes;
default:
return BOPBiomeManager.warmBiomes;
}
}
public enum TemperatureType
{
HOT, WARM, COOL, ICY;
}
}

View file

@ -0,0 +1,95 @@
package biomesoplenty.api;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.util.WeightedRandom;
import net.minecraft.world.biome.BiomeGenBase;
import biomesoplenty.common.configuration.BOPConfigurationBiomeGen;
import biomesoplenty.common.configuration.BOPConfigurationIDs;
public class BOPBiomeManager
{
private static int nextBiomeId = 40;
public static List<BiomeEntry>[] overworldBiomes = new ArrayList[] { new ArrayList(), new ArrayList(), new ArrayList(), new ArrayList()};
public static List<BiomeEntry> netherBiomes = new ArrayList();
public static BiomeGenBase createAndRegisterBiome(Class<? extends BiomeGenBase> biomeClass, String biomeType, String biomeName, List<BiomeEntry> biomeList, int weight)
{
BiomeGenBase biome = createBiome(biomeClass, biomeName);
if (biome != null)
{
BiomeEntry entry = new BiomeEntry(biome, weight);
if (BOPConfigurationBiomeGen.config.get(biomeType + " Biomes To Generate", biome.biomeName, true).getBoolean(false))
{
biomeList.add(entry);
}
return biome;
}
return null;
}
public static BiomeGenBase createBiome(Class<? extends BiomeGenBase> biomeClass, String biomeName)
{
int biomeId = BOPConfigurationIDs.config.get("Biome IDs", biomeName + " ID", getNextFreeBiomeId()).getInt();
if (biomeId != -1)
{
try
{
BiomeGenBase biome = biomeClass.getConstructor(int.class).newInstance(biomeId).setBiomeName(biomeName);
return biome;
}
catch (Exception e)
{
e.printStackTrace();
}
}
return null;
}
public static int getNextFreeBiomeId()
{
for (int i = nextBiomeId; i < 256; i++)
{
if (BiomeGenBase.getBiomeGenArray()[i] != null)
{
if (i == 255) throw new IllegalArgumentException("There are no more biome ids avaliable!");
continue;
}
else
{
nextBiomeId = i + 1;
return i;
}
}
return -1;
}
public class TemperatureType
{
public static final int HOT = 0;
public static final int WARM = 1;
public static final int COOL = 2;
public static final int ICY = 3;
}
public static class BiomeEntry extends WeightedRandom.Item
{
public BiomeGenBase biome;
public BiomeEntry(BiomeGenBase biome, int weight)
{
super(weight);
this.biome = biome;
}
}
}

View file

@ -0,0 +1,70 @@
package biomesoplenty.api.content;
import net.minecraft.world.biome.BiomeGenBase;
public class BOPCBiomes
{
//Overworld Biomes
public static BiomeGenBase alps;
public static BiomeGenBase arctic;
public static BiomeGenBase bambooForest;
public static BiomeGenBase bayou;
public static BiomeGenBase bog;
public static BiomeGenBase borealForest;
public static BiomeGenBase brushland;
public static BiomeGenBase canyon;
public static BiomeGenBase chaparral;
public static BiomeGenBase cherryBlossomGrove;
public static BiomeGenBase coniferousForest;
public static BiomeGenBase snowyConiferousForest;
public static BiomeGenBase crag;
public static BiomeGenBase deadForest;
public static BiomeGenBase deadSwamp;
public static BiomeGenBase deciduousForest;
public static BiomeGenBase dunes;
public static BiomeGenBase fen;
public static BiomeGenBase flowerField;
public static BiomeGenBase frostForest;
public static BiomeGenBase grassland;
public static BiomeGenBase grove;
public static BiomeGenBase heathland;
public static BiomeGenBase highland;
public static BiomeGenBase jadeCliffs;
public static BiomeGenBase lavenderFields;
public static BiomeGenBase lushDesert;
public static BiomeGenBase lushSwamp;
public static BiomeGenBase mapleWoods;
public static BiomeGenBase marsh;
public static BiomeGenBase meadow;
public static BiomeGenBase moor;
public static BiomeGenBase mountain;
public static BiomeGenBase mysticGrove;
public static BiomeGenBase ominousWoods;
public static BiomeGenBase originValley;
public static BiomeGenBase outback;
public static BiomeGenBase prairie;
public static BiomeGenBase quagmire;
public static BiomeGenBase rainforest;
public static BiomeGenBase redwoodForest;
public static BiomeGenBase sacredSprings;
public static BiomeGenBase seasonalForest;
public static BiomeGenBase shield;
public static BiomeGenBase shrubland;
public static BiomeGenBase silkglades;
public static BiomeGenBase sludgepit;
public static BiomeGenBase spruceWoods;
public static BiomeGenBase temperateRainforest;
public static BiomeGenBase thicket;
public static BiomeGenBase timber;
public static BiomeGenBase tropicalRainforest;
public static BiomeGenBase tropics;
public static BiomeGenBase tundra;
public static BiomeGenBase volcano;
public static BiomeGenBase wasteland;
public static BiomeGenBase wetland;
public static BiomeGenBase woodland;
//Sub Biomes
//Nether Biomes
}

View file

@ -0,0 +1,5 @@
package biomesoplenty.api.utils;
public class BiomeUtils
{
}

View file

@ -0,0 +1,23 @@
package biomesoplenty.common.biomes;
import java.util.ArrayList;
import java.util.List;
import biomesoplenty.common.world.layer.GenLayerSubBiome;
public abstract class BOPSubBiome extends BOPBiome
{
public int minRadius;
public int maxRadius;
public List parents;
public BOPSubBiome(int biomeID)
{
super(biomeID);
this.minRadius = 2;
this.maxRadius = 5;
this.parents = new ArrayList();
}
}

View file

@ -0,0 +1,20 @@
package biomesoplenty.common.biomes.overworld.subbiomes;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import biomesoplenty.common.biomes.BOPSubBiome;
public abstract class BOPOceanBiome extends BOPSubBiome
{
public BOPOceanBiome(int biomeID)
{
super(biomeID);
this.setHeight(BiomeGenBase.height_Oceans);
this.spawnableCreatureList.clear();
}
}

View file

@ -0,0 +1,20 @@
package biomesoplenty.common.biomes.overworld.subbiomes.ocean;
import org.apache.commons.lang3.tuple.Pair;
import net.minecraft.init.Blocks;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.BiomeGenBase.Height;
import biomesoplenty.common.biomes.overworld.subbiomes.BOPOceanBiome;
public class BiomeGenKelpForest extends BOPOceanBiome
{
public BiomeGenKelpForest(int biomeID)
{
super(biomeID);
this.setColor(53);
this.waterColorMultiplier = 11506176;
}
}

View file

@ -25,6 +25,7 @@ public class BOPConfiguration
miscConfigFile = new File(configpath + "misc.cfg");
BOPConfigurationMain.init(mainConfigFile);
BOPConfigurationBiomeGen.init(biomeGenConfigFile);
BOPConfigurationTerrainGen.init(terrainGenConfigFile);
BOPConfigurationIDs.init(idConfigFile);
BOPConfigurationMisc.init(miscConfigFile);

View file

@ -1,27 +1,18 @@
package biomesoplenty.common.configuration;
import java.io.File;
import java.util.ArrayList;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.config.Configuration;
import org.apache.commons.lang3.text.WordUtils;
import org.apache.logging.log4j.Level;
import biomesoplenty.api.BOPBiomeHelper;
import biomesoplenty.api.BOPBiomeHelper.TemperatureType;
import biomesoplenty.common.core.BOPBiomes;
import biomesoplenty.common.world.BOPBiomeManager.BiomeEntry;
import biomesoplenty.common.world.layer.hell.BiomeLayerHellBiomes;
import cpw.mods.fml.common.FMLLog;
public class BOPConfigurationBiomeGen
{
public static Configuration config;
public static ArrayList<String> disabledBiomes = new ArrayList();
//Special
public static boolean oceanGen = false;
public static boolean frozenOceanGen = false;
public static boolean deepOceanGen = false;
@ -31,69 +22,24 @@ public class BOPConfigurationBiomeGen
public static boolean jungleGen = false;
public static boolean shrublandGen = false;
public static boolean megaTaigaGen = false;
public static void addDefaultDisabledBiomes()
{
}
public static void init(File configFile)
{
addDefaultDisabledBiomes();
config = new Configuration(configFile);
try
{
config.load();
for (BiomeEntry entry : BOPBiomeHelper.biomeLists[-1 + 1].values())
{
BiomeGenBase biome = entry.biome;
String name = biome.biomeName;
String convertedName = BOPBiomeHelper.convertBiomeName(name);
if (config.get("Nether Biomes To Generate (There must be at least one from each category)", name, !disabledBiomes.contains(convertedName)).getBoolean(!disabledBiomes.contains(convertedName)))
{
BiomeLayerHellBiomes.netherBiomes.add(biome);
}
}
for (BiomeEntry entry : BOPBiomeHelper.biomeLists[0 + 1].values())
{
BiomeGenBase biome = entry.biome;
String name = biome.biomeName;
String convertedName = BOPBiomeHelper.convertBiomeName(name);
if (config.get("Overworld Biomes To Generate (There must be at least one from each category)", name + " (" + WordUtils.capitalize(entry.temperatureType.toString().toLowerCase()) + ")", !disabledBiomes.contains(convertedName)).getBoolean(!disabledBiomes.contains(convertedName)))
{
if (BOPBiomes.onlyBiome != null ? entry == BOPBiomes.onlyBiome : true)
{
entry.addToCorrespondingTemperatureTypeList();
}
}
}
if (BOPBiomes.onlyBiome != null)
{
for (TemperatureType temperatureType : BOPBiomeHelper.TemperatureType.values())
{
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);
shrublandGen = config.get("Special Biomes To Generate", "Shrubland", true).getBoolean(true);
megaTaigaGen = config.get("Special Biomes To Generate", "Mega Taiga", true).getBoolean(true);
}
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);
shrublandGen = config.get("Special Biomes To Generate", "Shrubland", true).getBoolean(true);
megaTaigaGen = config.get("Special Biomes To Generate", "Mega Taiga", true).getBoolean(true);
}
catch (Exception e)
{

View file

@ -10,115 +10,6 @@ public class BOPConfigurationIDs
{
public static Configuration config;
//Biome IDs
public static int alpsID;
public static int alpsForestID;
public static int alpsBaseID;
public static int arcticID;
public static int autumnHillsID;
public static int badlandsID;
public static int bambooForestID;
public static int bayouID;
public static int beachGravelID;
public static int beachOvergrownID;
public static int birchForestID;
public static int bogID;
public static int borealForestID;
public static int brushlandID;
public static int canyonID;
public static int canyonRavineID;
public static int chaparralID;
public static int cherryBlossomGroveID;
public static int coniferousForestID;
public static int coniferousForestSnowID;
public static int cragID;
public static int deadForestID;
public static int deadForestSnowID;
public static int deadSwampID;
public static int deadlandsID;
public static int deciduousForestID;
public static int dunesID;
public static int fenID;
public static int flowerFieldID;
public static int frostForestID;
public static int fungiForestID;
public static int gardenID;
public static int glacierID;
public static int grasslandID;
public static int groveID;
public static int heathlandID;
public static int highlandID;
public static int hotSpringsID;
public static int icyHillsID;
public static int jadeCliffsID;
public static int lavenderFieldsID;
public static int lushDesertID;
public static int lushSwampID;
public static int mangroveID;
public static int mapleWoodsID;
public static int marshID;
public static int meadowID;
public static int meadowForestID;
public static int mesaID;
public static int moorID;
public static int mountainID;
public static int mysticGroveID;
public static int mysticGroveThinID;
public static int netherUndergardenID;
public static int netherCorruptedSandsID;
public static int netherPhantasmagoricInfernoID;
public static int netherBoneyardID;
public static int netherVisceralHeapID;
public static int oasisID;
public static int oceanAbyssID;
public static int oceanCoralID;
public static int oceanKelpID;
public static int ominousWoodsID;
public static int ominousWoodsThickID;
public static int orchardID;
public static int originValleyID;
public static int outbackID;
public static int overgrownGreensID;
public static int polarID;
public static int prairieID;
public static int quagmireID;
public static int rainforestID;
public static int redwoodForestID;
public static int reefID;
public static int sacredSpringsID;
public static int savannaID;
public static int savannaPlateauID;
public static int scrublandID;
public static int seasonalForestID;
public static int seasonalSpruceForestID;
public static int shieldID;
public static int shoreID;
public static int shrublandID;
public static int shrublandForestID;
public static int silkgladesID;
public static int sludgepitID;
public static int spruceWoodsID;
public static int steppeID;
public static int temperateRainforestID;
public static int thicketID;
public static int timberID;
public static int timberThinID;
public static int tropicalRainforestID;
public static int tropicsID;
public static int tropicsMountainID;
public static int tundraID;
public static int volcanoID;
public static int wastelandID;
public static int wetlandID;
public static int woodlandID;
public static int entityMudballID;
public static int entityDartID;
public static int entityPoisonDartID;
@ -149,104 +40,9 @@ public class BOPConfigurationIDs
pixieID = config.get("Mob IDs", "Pixie ID", 110, null).getInt();
//Projectile IDs
entityMudballID = config.get("Entity IDs", "Mudball ID", 103, null).getInt();;
entityDartID = config.get("Entity IDs", "Dart ID", 104, null).getInt();;
entityPoisonDartID = config.get("Entity IDs", "Poison Dart ID", 105, null).getInt();;
//23-79 ExtraBiomesXL
//fungiForestID = config.get("Biome IDs", "Fungi Forest ID", 201).getInt();
//gardenID = config.get("Biome IDs", "Garden ID", 202).getInt();
//glacierID = config.get("Biome IDs", "Glacier ID", 203).getInt();
//hotSpringsID = config.get("Biome IDs", "Hot Springs ID", 211).getInt();
//mangroveID = config.get("Biome IDs", "Mangrove ID", 216).getInt();
//oasisID = config.get("Biome IDs", "Oasis ID", 224).getInt();
//orchardID = config.get("Biome IDs", "Orchard ID", 226).getInt();
//scrublandID = config.get("Biome IDs", "Scrubland ID", 237).getInt();
//steppeID = config.get("Biome IDs", "Steppe ID", 244).getInt();
//oceanAbyssID = config.get("Biome IDs", "Oceanic Abyss (Ocean) ID", 72).getInt();
//oceanCoralID = config.get("Biome IDs", "Coral Reef (Ocean) ID", 73).getInt();
//oceanKelpID = config.get("Biome IDs", "Kelp Forest (Ocean) ID", 74).getInt();
//beachGravelID = config.get("Biome IDs", "Gravel Beach ID", 75).getInt();
//beachOvergrownID = config.get("Biome IDs", "Overgrown Beach ID", 76).getInt();
//70-87 Twilight Forest < Changed on their end?
//80-159 Better World Generation 4 < Changed on their end?
//160-161 BuildCraft Oil Fields
//162-169 Thaumcraft
netherUndergardenID = config.get("Biome IDs", "Undergarden (Nether) ID", 185).getInt();
netherCorruptedSandsID = config.get("Biome IDs", "Corrupted Sands (Nether) ID", 186).getInt();
netherPhantasmagoricInfernoID = config.get("Biome IDs", "Phantasmagoric Inferno (Nether) ID", 187).getInt();
netherBoneyardID = config.get("Biome IDs", "Boneyard (Nether) ID", 188).getInt();
netherVisceralHeapID = config.get("Biome IDs", "Visceral Heap (Nether) ID", 189).getInt();
alpsID = config.get("Biome IDs", "Alps ID", 194).getInt();
arcticID = config.get("Biome IDs", "Arctic ID", 195).getInt();
bambooForestID = config.get("Biome IDs", "Bamboo Forest ID", 196).getInt();
bayouID = config.get("Biome IDs", "Bayou ID", 197).getInt();
bogID = config.get("Biome IDs", "Bog ID", 198).getInt();
borealForestID = config.get("Biome IDs", "Boreal Forest ID", 199).getInt();
brushlandID = config.get("Biome IDs", "Brushland ID", 200).getInt();
canyonID = config.get("Biome IDs", "Canyon ID", 201).getInt();
chaparralID = config.get("Biome IDs", "Chaparral ID", 202).getInt();
cherryBlossomGroveID = config.get("Biome IDs", "Cherry Blossom Grove ID", 203).getInt();
coniferousForestID = config.get("Biome IDs", "Coniferous Forest ID", 204).getInt();
coniferousForestSnowID = config.get("Biome IDs", "Coniferous Forest (Snow) ID", 205).getInt();
cragID = config.get("Biome IDs", "Crag ID", 206).getInt();
//207-209 left for Mo Creatures
deadForestID = config.get("Biome IDs", "Dead Forest ID", 210).getInt();
deadSwampID = config.get("Biome IDs", "Dead Swamp ID", 211).getInt();
deciduousForestID = config.get("Biome IDs", "Deciduous Forest ID", 212).getInt();
dunesID = config.get("Biome IDs", "Dunes ID", 213).getInt();
fenID = config.get("Biome IDs", "Fen ID", 214).getInt();
flowerFieldID = config.get("Biome IDs", "Flower Field ID", 215).getInt();
frostForestID = config.get("Biome IDs", "Frost Forest ID", 216).getInt();
grasslandID = config.get("Biome IDs", "Grassland ID", 217).getInt();
groveID = config.get("Biome IDs", "Grove ID", 218).getInt();
heathlandID = config.get("Biome IDs", "Heathland ID", 219).getInt();
highlandID = config.get("Biome IDs", "Highland ID", 220).getInt();
jadeCliffsID = config.get("Biome IDs", "Jade Cliffs ID", 221).getInt();
lavenderFieldsID = config.get("Biome IDs", "Lavender Fields ID", 222).getInt();
lushDesertID = config.get("Biome IDs", "Lush Desert ID", 223).getInt();
lushSwampID = config.get("Biome IDs", "Lush Swamp ID", 224).getInt();
mapleWoodsID = config.get("Biome IDs", "Maple Woods ID", 225).getInt();
marshID = config.get("Biome IDs", "Marsh ID", 226).getInt();
meadowID = config.get("Biome IDs", "Meadow ID", 227).getInt();
moorID = config.get("Biome IDs", "Moor ID", 228).getInt();
mountainID = config.get("Biome IDs", "Mountain ID", 229).getInt();
mysticGroveID = config.get("Biome IDs", "Mystic Grove ID", 230).getInt();
ominousWoodsID = config.get("Biome IDs", "Ominous Woods ID", 231).getInt();
originValleyID = config.get("Biome IDs", "Origin Valley ID", 232).getInt();
outbackID = config.get("Biome IDs", "Outback ID", 233).getInt();
prairieID = config.get("Biome IDs", "Prairie ID", 234).getInt();
quagmireID = config.get("Biome IDs", "Quagmire ID", 235).getInt();
rainforestID = config.get("Biome IDs", "Rainforest ID", 236).getInt();
redwoodForestID = config.get("Biome IDs", "Redwood Forest ID", 237).getInt();
sacredSpringsID = config.get("Biome IDs", "Sacred Springs ID", 238).getInt();
seasonalForestID = config.get("Biome IDs", "Seasonal Forest ID", 239).getInt();
shieldID = config.get("Biome IDs", "Shield ID", 240).getInt();
shrublandID = config.get("Biome IDs", "Shrubland ID", 241).getInt();
silkgladesID = config.get("Biome IDs", "Silkglades ID", 242).getInt();
sludgepitID = config.get("Biome IDs", "Sludgepit ID", 243).getInt();
spruceWoodsID = config.get("Biome IDs", "Spruce Woods ID", 244).getInt();
temperateRainforestID = config.get("Biome IDs", "Temperate Rainforest ID", 245).getInt();
thicketID = config.get("Biome IDs", "Thicket ID", 246).getInt();
timberID = config.get("Biome IDs", "Timber ID", 247).getInt();
tropicalRainforestID = config.get("Biome IDs", "Tropical Rainforest ID", 248).getInt();
tropicsID = config.get("Biome IDs", "Tropics ID", 249).getInt();
tundraID = config.get("Biome IDs", "Tundra ID", 250).getInt();
volcanoID = config.get("Biome IDs", "Volcano ID", 251).getInt();
wastelandID = config.get("Biome IDs", "Wasteland ID", 252).getInt();
wetlandID = config.get("Biome IDs", "Wetland ID", 253).getInt();
woodlandID = config.get("Biome IDs", "Woodland ID", 254).getInt();
entityMudballID = config.get("Entity IDs", "Mudball ID", 103, null).getInt();
entityDartID = config.get("Entity IDs", "Dart ID", 104, null).getInt();
entityPoisonDartID = config.get("Entity IDs", "Poison Dart ID", 105, null).getInt();
}
catch (Exception e)
{

View file

@ -2,6 +2,7 @@ package biomesoplenty.common.configuration.structures;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.BiomeManager;
@ -9,94 +10,94 @@ import net.minecraftforge.common.config.Configuration;
import org.apache.logging.log4j.Level;
import biomesoplenty.api.BOPBiomeHelper;
import biomesoplenty.common.world.BOPBiomeManager.BiomeEntry;
import biomesoplenty.api.BOPBiomeManager;
import biomesoplenty.api.BOPBiomeManager.BiomeEntry;
import biomesoplenty.api.content.BOPCBiomes;
import cpw.mods.fml.common.FMLLog;
public class BOPConfigurationStrongholds
{
public static Configuration config;
public static ArrayList<String> enabledBiomes = new ArrayList();
public static ArrayList<Integer> enabledBiomes = new ArrayList();
public static void addDefaultStrongholdBiomes()
{
addStrongholdBiome("alps");
addStrongholdBiome("arctic");
//addStrongholdBiome("autumnHills");
//addStrongholdBiome("badlands");
addStrongholdBiome("bambooForest");
addStrongholdBiome("bayou");
//addStrongholdBiome("birchForest");
addStrongholdBiome("bog");
addStrongholdBiome("borealForest");
addStrongholdBiome("brushland");
addStrongholdBiome("canyon");
addStrongholdBiome("chaparral");
addStrongholdBiome("cherryBlossomGrove");
addStrongholdBiome("coniferousForest");
addStrongholdBiome("snowyConiferousForest");
addStrongholdBiome("crag");
addStrongholdBiome("deadForest");
//addStrongholdBiome("deadForestSnow");
addStrongholdBiome("deadSwamp");
//addStrongholdBiome("deadlands");
addStrongholdBiome("deciduousForest");
addStrongholdBiome("dunes");
addStrongholdBiome("fen");
addStrongholdBiome("flowerField");
addStrongholdBiome("frostForest");
//addStrongholdBiome("fungiForest");
//addStrongholdBiome("garden");
//addStrongholdBiome("glacier");
addStrongholdBiome("grassland");
addStrongholdBiome("grove");
addStrongholdBiome("heathland");
addStrongholdBiome("highland");
//addStrongholdBiome("hotSprings");
//addStrongholdBiome("icyHills");
addStrongholdBiome("jadeCliffs");
addStrongholdBiome("lavenderFields");
addStrongholdBiome("lushDesert");
addStrongholdBiome("lushSwamp");
//addStrongholdBiome("mangrove");
addStrongholdBiome("mapleWoods");
addStrongholdBiome("marsh");
addStrongholdBiome("meadow");
//addStrongholdBiome("mesa");
addStrongholdBiome("moor");
addStrongholdBiome("mountain");
addStrongholdBiome("mysticGrove");
//addStrongholdBiome("oasis");
addStrongholdBiome("ominousWoods");
//addStrongholdBiome("orchard");
addStrongholdBiome("outback");
//addStrongholdBiome("overgrownGreens");
//addStrongholdBiome("polar");
addStrongholdBiome("prairie");
addStrongholdBiome("quagmire");
addStrongholdBiome("rainforest");
addStrongholdBiome("redwoodForest");
addStrongholdBiome("sacredSprings");
//addStrongholdBiome("savanna");
//addStrongholdBiome("scrubland");
addStrongholdBiome("seasonalForest");
addStrongholdBiome("shield");
addStrongholdBiome("shrubland");
addStrongholdBiome("silkglades");
addStrongholdBiome("sludgepit");
addStrongholdBiome("spruceWoods");
//addStrongholdBiome("steppe");
addStrongholdBiome("temperateRainforest");
addStrongholdBiome("thicket");
addStrongholdBiome("timber");
addStrongholdBiome("tropicalRainforest");
addStrongholdBiome("tropics");
addStrongholdBiome("tundra");
addStrongholdBiome("volcano");
addStrongholdBiome("wasteland");
addStrongholdBiome("wetland");
addStrongholdBiome("woodland");
addStrongholdBiome(BOPCBiomes.alps);
addStrongholdBiome(BOPCBiomes.arctic);
//addStrongholdBiomBOPCBiomes.("autumnHills);
//addStrongholdBiomBOPCBiomes.("badlands);
addStrongholdBiome(BOPCBiomes.bambooForest);
addStrongholdBiome(BOPCBiomes.bayou);
//addStrongholdBiomBOPCBiomes.("birchForest);
addStrongholdBiome(BOPCBiomes.bog);
addStrongholdBiome(BOPCBiomes.borealForest);
addStrongholdBiome(BOPCBiomes.brushland);
addStrongholdBiome(BOPCBiomes.canyon);
addStrongholdBiome(BOPCBiomes.chaparral);
addStrongholdBiome(BOPCBiomes.cherryBlossomGrove);
addStrongholdBiome(BOPCBiomes.coniferousForest);
addStrongholdBiome(BOPCBiomes.snowyConiferousForest);
addStrongholdBiome(BOPCBiomes.crag);
addStrongholdBiome(BOPCBiomes.deadForest);
//addStrongholdBiomBOPCBiomes.("deadForestSnow);
addStrongholdBiome(BOPCBiomes.deadSwamp);
//addStrongholdBiomBOPCBiomes.("deadlands);
addStrongholdBiome(BOPCBiomes.deciduousForest);
addStrongholdBiome(BOPCBiomes.dunes);
addStrongholdBiome(BOPCBiomes.fen);
addStrongholdBiome(BOPCBiomes.flowerField);
addStrongholdBiome(BOPCBiomes.frostForest);
//addStrongholdBiomBOPCBiomes.("fungiForest);
//addStrongholdBiomBOPCBiomes.("garden);
//addStrongholdBiomBOPCBiomes.("glacier);
addStrongholdBiome(BOPCBiomes.grassland);
addStrongholdBiome(BOPCBiomes.grove);
addStrongholdBiome(BOPCBiomes.heathland);
addStrongholdBiome(BOPCBiomes.highland);
//addStrongholdBiomBOPCBiomes.("hotSprings);
//addStrongholdBiomBOPCBiomes.("icyHills);
addStrongholdBiome(BOPCBiomes.jadeCliffs);
addStrongholdBiome(BOPCBiomes.lavenderFields);
addStrongholdBiome(BOPCBiomes.lushDesert);
addStrongholdBiome(BOPCBiomes.lushSwamp);
//addStrongholdBiomBOPCBiomes.("mangrove);
addStrongholdBiome(BOPCBiomes.mapleWoods);
addStrongholdBiome(BOPCBiomes.marsh);
addStrongholdBiome(BOPCBiomes.meadow);
//addStrongholdBiomBOPCBiomes.("mesa);
addStrongholdBiome(BOPCBiomes.moor);
addStrongholdBiome(BOPCBiomes.mountain);
addStrongholdBiome(BOPCBiomes.mysticGrove);
//addStrongholdBiomBOPCBiomes.("oasis);
addStrongholdBiome(BOPCBiomes.ominousWoods);
//addStrongholdBiomBOPCBiomes.("orchard);
addStrongholdBiome(BOPCBiomes.outback);
//addStrongholdBiomBOPCBiomes.("overgrownGreens);
//addStrongholdBiomBOPCBiomes.("polar);
addStrongholdBiome(BOPCBiomes.prairie);
addStrongholdBiome(BOPCBiomes.quagmire);
addStrongholdBiome(BOPCBiomes.rainforest);
addStrongholdBiome(BOPCBiomes.redwoodForest);
addStrongholdBiome(BOPCBiomes.sacredSprings);
//addStrongholdBiomBOPCBiomes.("scrubland);
addStrongholdBiome(BOPCBiomes.seasonalForest);
addStrongholdBiome(BOPCBiomes.shield);
addStrongholdBiome(BOPCBiomes.shrubland);
addStrongholdBiome(BOPCBiomes.silkglades);
addStrongholdBiome(BOPCBiomes.sludgepit);
addStrongholdBiome(BOPCBiomes.spruceWoods);
//addStrongholdBiomBOPCBiomes.("steppe);
addStrongholdBiome(BOPCBiomes.temperateRainforest);
addStrongholdBiome(BOPCBiomes.thicket);
addStrongholdBiome(BOPCBiomes.timber);
addStrongholdBiome(BOPCBiomes.tropicalRainforest);
addStrongholdBiome(BOPCBiomes.tropics);
addStrongholdBiome(BOPCBiomes.tundra);
addStrongholdBiome(BOPCBiomes.volcano);
addStrongholdBiome(BOPCBiomes.wasteland);
addStrongholdBiome(BOPCBiomes.wetland);
addStrongholdBiome(BOPCBiomes.woodland);
}
public static void init(File configFile)
@ -108,17 +109,17 @@ public class BOPConfigurationStrongholds
try
{
config.load();
for (BiomeEntry entry : BOPBiomeHelper.biomeLists[0 + 1].values())
{
BiomeGenBase biome = entry.biome;
String name = biome.biomeName;
String convertedName = BOPBiomeHelper.convertBiomeName(name);
if (config.get("Allow Strongholds", name, enabledBiomes.contains(convertedName)).getBoolean(enabledBiomes.contains(convertedName)))
for (List<BiomeEntry> biomeList : BOPBiomeManager.overworldBiomes)
{
for (BiomeEntry entry : biomeList)
{
BiomeManager.addStrongholdBiome(biome);
BiomeGenBase biome = entry.biome;
if (config.get("Allow Strongholds", biome.biomeName, enabledBiomes.contains(biome.biomeID)).getBoolean(enabledBiomes.contains(biome.biomeID)))
{
BiomeManager.addStrongholdBiome(biome);
}
}
}
}
@ -134,8 +135,8 @@ public class BOPConfigurationStrongholds
}
}
public static void addStrongholdBiome(String biomeName)
public static void addStrongholdBiome(BiomeGenBase biome)
{
enabledBiomes.add(biomeName);
enabledBiomes.add(biome.biomeID);
}
}

View file

@ -2,6 +2,7 @@ package biomesoplenty.common.configuration.structures;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.BiomeManager;
@ -9,8 +10,9 @@ import net.minecraftforge.common.config.Configuration;
import org.apache.logging.log4j.Level;
import biomesoplenty.api.BOPBiomeHelper;
import biomesoplenty.common.world.BOPBiomeManager.BiomeEntry;
import biomesoplenty.api.BOPBiomeManager;
import biomesoplenty.api.BOPBiomeManager.BiomeEntry;
import biomesoplenty.api.content.BOPCBiomes;
import cpw.mods.fml.common.FMLLog;
public class BOPConfigurationVillages
@ -19,78 +21,77 @@ public class BOPConfigurationVillages
public static int villageDistance;
public static ArrayList<String> enabledBiomes = new ArrayList();
public static ArrayList<Integer> enabledBiomes = new ArrayList();
public static void addDefaultVillageBiomes()
{
addVillageBiome("alps");
addVillageBiome("arctic");
//addVillageBiome("autumnHills");
//addVillageBiome("badlands");
addVillageBiome("bambooForest");
addVillageBiome("bayou");
addVillageBiome("bog");
addVillageBiome("borealForest");
addVillageBiome("brushland");
addVillageBiome("canyon");
addVillageBiome("chaparral");
addVillageBiome("cherryBlossomGrove");
addVillageBiome("coniferousForest");
addVillageBiome("snowyConiferousForest");
addVillageBiome("deadForest");
//addVillageBiome("deadForestSnow");
addVillageBiome("deadSwamp");
addVillageBiome("deciduousForest");
addVillageBiome("dunes");
addVillageBiome("fen");
addVillageBiome("flowerField");
addVillageBiome("frostForest");
//addVillageBiome("glacier");
addVillageBiome("grassland");
addVillageBiome("grove");
addVillageBiome("heathland");
addVillageBiome("highland");
//addVillageBiome("hotSprings");
addVillageBiome("jadeCliffs");
addVillageBiome("lushDesert");
addVillageBiome("lushSwamp");
//addVillageBiome("mangrove");
addVillageBiome("mapleWoods");
addVillageBiome("marsh");
addVillageBiome("meadow");
//addVillageBiome("meadowForest");
//addVillageBiome("mesa");
addVillageBiome("moor");
addVillageBiome("mountain");
//addVillageBiome("oasis");
addVillageBiome(BOPCBiomes.alps);
addVillageBiome(BOPCBiomes.arctic);
//addVillageBiome(BOPCBiomes.autumnHills);
//addVillageBiome(BOPCBiomes.badlands);
addVillageBiome(BOPCBiomes.bambooForest);
addVillageBiome(BOPCBiomes.bayou);
addVillageBiome(BOPCBiomes.bog);
addVillageBiome(BOPCBiomes.borealForest);
addVillageBiome(BOPCBiomes.brushland);
addVillageBiome(BOPCBiomes.canyon);
addVillageBiome(BOPCBiomes.chaparral);
addVillageBiome(BOPCBiomes.cherryBlossomGrove);
addVillageBiome(BOPCBiomes.coniferousForest);
addVillageBiome(BOPCBiomes.snowyConiferousForest);
addVillageBiome(BOPCBiomes.deadForest);
//addVillageBiome(BOPCBiomes.deadForestSnow);
addVillageBiome(BOPCBiomes.deadSwamp);
addVillageBiome(BOPCBiomes.deciduousForest);
addVillageBiome(BOPCBiomes.dunes);
addVillageBiome(BOPCBiomes.fen);
addVillageBiome(BOPCBiomes.flowerField);
addVillageBiome(BOPCBiomes.frostForest);
//addVillageBiome(BOPCBiomes.glacier);
addVillageBiome(BOPCBiomes.grassland);
addVillageBiome(BOPCBiomes.grove);
addVillageBiome(BOPCBiomes.heathland);
addVillageBiome(BOPCBiomes.highland);
//addVillageBiome(BOPCBiomes.hotSprings);
addVillageBiome(BOPCBiomes.jadeCliffs);
addVillageBiome(BOPCBiomes.lushDesert);
addVillageBiome(BOPCBiomes.lushSwamp);
//addVillageBiome(BOPCBiomes.mangrove);
addVillageBiome(BOPCBiomes.mapleWoods);
addVillageBiome(BOPCBiomes.marsh);
addVillageBiome(BOPCBiomes.meadow);
//addVillageBiome(BOPCBiomes.meadowForest);
//addVillageBiome(BOPCBiomes.mesa);
addVillageBiome(BOPCBiomes.moor);
addVillageBiome(BOPCBiomes.mountain);
//addVillageBiome(BOPCBiomes.oasis);
//addVillageBiome("orchard");
addVillageBiome("outback");
//addVillageBiome("overgrownGreens");
addVillageBiome("pasture");
//addVillageBiome("polar");
addVillageBiome("prairie");
addVillageBiome("quagmire");
addVillageBiome("rainforest");
addVillageBiome("redwoodForest");
//addVillageBiome(BOPCBiomes.orchard);
addVillageBiome(BOPCBiomes.outback);
//addVillageBiome(BOPCBiomes.overgrownGreens);
//addVillageBiome(BOPCBiomes.polar);
addVillageBiome(BOPCBiomes.prairie);
addVillageBiome(BOPCBiomes.quagmire);
addVillageBiome(BOPCBiomes.rainforest);
addVillageBiome(BOPCBiomes.redwoodForest);
addVillageBiome("seasonalForest");
addVillageBiome("shield");
//addVillageBiome("scrubland");
addVillageBiome("shrubland");
addVillageBiome("sludgepit");
addVillageBiome("spruceWoods");
//addVillageBiome("steppe");
addVillageBiome("temperateRainforest");
addVillageBiome("thicket");
addVillageBiome("timber");
addVillageBiome("tropicalRainforest");
addVillageBiome("tropics");
addVillageBiome("tundra");
addVillageBiome("volcano");
addVillageBiome(BOPCBiomes.seasonalForest);
addVillageBiome(BOPCBiomes.shield);
//addVillageBiome(BOPCBiomes.scrubland);
addVillageBiome(BOPCBiomes.shrubland);
addVillageBiome(BOPCBiomes.sludgepit);
addVillageBiome(BOPCBiomes.spruceWoods);
//addVillageBiome(BOPCBiomes.steppe);
addVillageBiome(BOPCBiomes.temperateRainforest);
addVillageBiome(BOPCBiomes.thicket);
addVillageBiome(BOPCBiomes.timber);
addVillageBiome(BOPCBiomes.tropicalRainforest);
addVillageBiome(BOPCBiomes.tropics);
addVillageBiome(BOPCBiomes.tundra);
addVillageBiome(BOPCBiomes.volcano);
addVillageBiome("wetland");
addVillageBiome("woodland");
addVillageBiome(BOPCBiomes.wetland);
addVillageBiome(BOPCBiomes.woodland);
}
public static void init(File configFile)
@ -106,16 +107,16 @@ public class BOPConfigurationVillages
villageDistance = config.get("Biomes O\' Plenty World Type Settings", "Distance between villages", 32, "In Vanilla it is set to 32").getInt();
if (villageDistance < 8) villageDistance = 8;
for (BiomeEntry entry : BOPBiomeHelper.biomeLists[0 + 1].values())
for (List<BiomeEntry> biomeList : BOPBiomeManager.overworldBiomes)
{
BiomeGenBase biome = entry.biome;
String name = biome.biomeName;
String convertedName = BOPBiomeHelper.convertBiomeName(name);
if (config.get("Allow Villages", name, enabledBiomes.contains(convertedName)).getBoolean(enabledBiomes.contains(convertedName)))
for (BiomeEntry entry : biomeList)
{
BiomeManager.addVillageBiome(biome, true);
BiomeGenBase biome = entry.biome;
if (config.get("Allow Villages", biome.biomeName, enabledBiomes.contains(biome.biomeID)).getBoolean(enabledBiomes.contains(biome.biomeID)))
{
BiomeManager.addVillageBiome(biome, true);
}
}
}
}
@ -131,8 +132,8 @@ public class BOPConfigurationVillages
}
}
public static void addVillageBiome(String biomeName)
public static void addVillageBiome(BiomeGenBase biome)
{
enabledBiomes.add(biomeName);
enabledBiomes.add(biome.biomeID);
}
}

View file

@ -1,12 +1,75 @@
package biomesoplenty.common.core;
import static biomesoplenty.api.content.BOPCBiomes.alps;
import static biomesoplenty.api.content.BOPCBiomes.arctic;
import static biomesoplenty.api.content.BOPCBiomes.bambooForest;
import static biomesoplenty.api.content.BOPCBiomes.bayou;
import static biomesoplenty.api.content.BOPCBiomes.bog;
import static biomesoplenty.api.content.BOPCBiomes.borealForest;
import static biomesoplenty.api.content.BOPCBiomes.brushland;
import static biomesoplenty.api.content.BOPCBiomes.canyon;
import static biomesoplenty.api.content.BOPCBiomes.chaparral;
import static biomesoplenty.api.content.BOPCBiomes.cherryBlossomGrove;
import static biomesoplenty.api.content.BOPCBiomes.coniferousForest;
import static biomesoplenty.api.content.BOPCBiomes.crag;
import static biomesoplenty.api.content.BOPCBiomes.deadForest;
import static biomesoplenty.api.content.BOPCBiomes.deadSwamp;
import static biomesoplenty.api.content.BOPCBiomes.deciduousForest;
import static biomesoplenty.api.content.BOPCBiomes.dunes;
import static biomesoplenty.api.content.BOPCBiomes.fen;
import static biomesoplenty.api.content.BOPCBiomes.flowerField;
import static biomesoplenty.api.content.BOPCBiomes.frostForest;
import static biomesoplenty.api.content.BOPCBiomes.grassland;
import static biomesoplenty.api.content.BOPCBiomes.grove;
import static biomesoplenty.api.content.BOPCBiomes.heathland;
import static biomesoplenty.api.content.BOPCBiomes.highland;
import static biomesoplenty.api.content.BOPCBiomes.jadeCliffs;
import static biomesoplenty.api.content.BOPCBiomes.lavenderFields;
import static biomesoplenty.api.content.BOPCBiomes.lushDesert;
import static biomesoplenty.api.content.BOPCBiomes.lushSwamp;
import static biomesoplenty.api.content.BOPCBiomes.mapleWoods;
import static biomesoplenty.api.content.BOPCBiomes.marsh;
import static biomesoplenty.api.content.BOPCBiomes.meadow;
import static biomesoplenty.api.content.BOPCBiomes.moor;
import static biomesoplenty.api.content.BOPCBiomes.mountain;
import static biomesoplenty.api.content.BOPCBiomes.mysticGrove;
import static biomesoplenty.api.content.BOPCBiomes.ominousWoods;
import static biomesoplenty.api.content.BOPCBiomes.originValley;
import static biomesoplenty.api.content.BOPCBiomes.outback;
import static biomesoplenty.api.content.BOPCBiomes.prairie;
import static biomesoplenty.api.content.BOPCBiomes.quagmire;
import static biomesoplenty.api.content.BOPCBiomes.rainforest;
import static biomesoplenty.api.content.BOPCBiomes.redwoodForest;
import static biomesoplenty.api.content.BOPCBiomes.sacredSprings;
import static biomesoplenty.api.content.BOPCBiomes.seasonalForest;
import static biomesoplenty.api.content.BOPCBiomes.shield;
import static biomesoplenty.api.content.BOPCBiomes.shrubland;
import static biomesoplenty.api.content.BOPCBiomes.silkglades;
import static biomesoplenty.api.content.BOPCBiomes.sludgepit;
import static biomesoplenty.api.content.BOPCBiomes.snowyConiferousForest;
import static biomesoplenty.api.content.BOPCBiomes.spruceWoods;
import static biomesoplenty.api.content.BOPCBiomes.temperateRainforest;
import static biomesoplenty.api.content.BOPCBiomes.thicket;
import static biomesoplenty.api.content.BOPCBiomes.timber;
import static biomesoplenty.api.content.BOPCBiomes.tropicalRainforest;
import static biomesoplenty.api.content.BOPCBiomes.tropics;
import static biomesoplenty.api.content.BOPCBiomes.tundra;
import static biomesoplenty.api.content.BOPCBiomes.volcano;
import static biomesoplenty.api.content.BOPCBiomes.wasteland;
import static biomesoplenty.api.content.BOPCBiomes.wetland;
import static biomesoplenty.api.content.BOPCBiomes.woodland;
import java.util.List;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.WorldChunkManager;
import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.common.BiomeDictionary.Type;
import net.minecraftforge.common.BiomeManager;
import biomesoplenty.api.BOPBiomeHelper;
import biomesoplenty.api.BOPBiomeHelper.TemperatureType;
import org.apache.logging.log4j.Level;
import biomesoplenty.api.BOPBiomeManager;
import biomesoplenty.api.BOPBiomeManager.BiomeEntry;
import biomesoplenty.api.BOPBiomeManager.TemperatureType;
import biomesoplenty.common.biomes.nether.BiomeGenBoneyard;
import biomesoplenty.common.biomes.nether.BiomeGenCorruptedSands;
import biomesoplenty.common.biomes.nether.BiomeGenPhantasmagoricInferno;
@ -69,9 +132,10 @@ import biomesoplenty.common.biomes.overworld.BiomeGenVolcano;
import biomesoplenty.common.biomes.overworld.BiomeGenWasteland;
import biomesoplenty.common.biomes.overworld.BiomeGenWetland;
import biomesoplenty.common.biomes.overworld.BiomeGenWoodland;
import biomesoplenty.common.configuration.BOPConfigurationBiomeGen;
import biomesoplenty.common.configuration.BOPConfigurationIDs;
import biomesoplenty.common.configuration.BOPConfigurationMisc;
import biomesoplenty.common.world.BOPBiomeManager.BiomeEntry;
import biomesoplenty.common.utils.BOPLogger;
import biomesoplenty.common.world.WorldTypeBOP;
import biomesoplenty.common.world.decoration.BOPDecorationManager;
import cpw.mods.fml.common.registry.GameRegistry;
@ -79,85 +143,101 @@ import cpw.mods.fml.common.registry.GameRegistry;
public class BOPBiomes
{
public static WorldTypeBOP worldTypeBOP;
public static BiomeEntry onlyBiome;
public static void init()
{
GameRegistry.registerWorldGenerator(new BOPDecorationManager(), 0);
BOPBiomeHelper.init();
registerBiomes();
try
{
BOPConfigurationIDs.config.load();
BOPConfigurationBiomeGen.config.load();
registerBiomes();
}
catch (Exception e)
{
BOPLogger.log(Level.ERROR, "Biomes O Plenty has had a problem loading its configuration", e);
}
finally
{
if (BOPConfigurationIDs.config.hasChanged()) BOPConfigurationIDs.config.save();
if (BOPConfigurationBiomeGen.config.hasChanged()) BOPConfigurationBiomeGen.config.save();
}
addBiomesToDictionary();
addSpawnBiomes();
}
private static void registerBiomes()
{
registerBiome(new BiomeEntry(new BiomeGenAlps(BOPConfigurationIDs.alpsID).setBiomeName("Alps"), TemperatureType.ICY, 5));
registerBiome(new BiomeEntry(new BiomeGenArctic(BOPConfigurationIDs.arcticID).setBiomeName("Arctic"), TemperatureType.ICY, 10));
registerBiome(new BiomeEntry(new BiomeGenBambooForest(BOPConfigurationIDs.bambooForestID).setBiomeName("Bamboo Forest"), TemperatureType.HOT, 5));
registerBiome(new BiomeEntry(new BiomeGenBayou(BOPConfigurationIDs.bayouID).setBiomeName("Bayou"), TemperatureType.WARM, 10));
registerBiome(new BiomeEntry(new BiomeGenBog(BOPConfigurationIDs.bogID).setBiomeName("Bog"), TemperatureType.WARM, 10));
registerBiome(new BiomeEntry(new BiomeGenBorealForest(BOPConfigurationIDs.borealForestID).setBiomeName("Boreal Forest"), TemperatureType.WARM, 10));
registerBiome(new BiomeEntry(new BiomeGenBrushland(BOPConfigurationIDs.brushlandID).setBiomeName("Brushland"), TemperatureType.HOT, 10));
registerBiome(new BiomeEntry(new BiomeGenCanyon(BOPConfigurationIDs.canyonID).setBiomeName("Canyon"), TemperatureType.HOT, 10));
registerBiome(new BiomeEntry(new BiomeGenChaparral(BOPConfigurationIDs.chaparralID).setBiomeName("Chaparral"), TemperatureType.WARM, 10));
registerBiome(new BiomeEntry(new BiomeGenCherryBlossomGrove(BOPConfigurationIDs.cherryBlossomGroveID).setBiomeName("Cherry Blossom Grove"), TemperatureType.COOL, 3));
registerBiome(new BiomeEntry(new BiomeGenConiferousForest(BOPConfigurationIDs.coniferousForestID).setBiomeName("Coniferous Forest"), TemperatureType.WARM, 10));
registerBiome(new BiomeEntry(new BiomeGenConiferousForestSnow(BOPConfigurationIDs.coniferousForestSnowID).setBiomeName("Snowy Coniferous Forest"), TemperatureType.ICY, 10));
registerBiome(new BiomeEntry(new BiomeGenCrag(BOPConfigurationIDs.cragID).setBiomeName("Crag"), TemperatureType.COOL, 3));
registerBiome(new BiomeEntry(new BiomeGenDeadForest(BOPConfigurationIDs.deadForestID).setBiomeName("Dead Forest"), TemperatureType.COOL, 10));
registerBiome(new BiomeEntry(new BiomeGenDeadSwamp(BOPConfigurationIDs.deadSwampID).setBiomeName("Dead Swamp"), TemperatureType.WARM, 10));
registerBiome(new BiomeEntry(new BiomeGenDeciduousForest(BOPConfigurationIDs.deciduousForestID).setBiomeName("Deciduous Forest"), TemperatureType.WARM, 10));
registerBiome(new BiomeEntry(new BiomeGenDunes(BOPConfigurationIDs.dunesID).setBiomeName("Dunes"), TemperatureType.HOT, 10));
registerBiome(new BiomeEntry(new BiomeGenFen(BOPConfigurationIDs.fenID).setBiomeName("Fen"), TemperatureType.WARM, 10));
registerBiome(new BiomeEntry(new BiomeGenFlowerField(BOPConfigurationIDs.flowerFieldID).setBiomeName("Flower Field"), TemperatureType.WARM, 3));
registerBiome(new BiomeEntry(new BiomeGenFrostForest(BOPConfigurationIDs.frostForestID).setBiomeName("Frost Forest"), TemperatureType.ICY, 10));
registerBiome(new BiomeEntry(new BiomeGenGrassland(BOPConfigurationIDs.grasslandID).setBiomeName("Grassland"), TemperatureType.COOL, 10));
registerBiome(new BiomeEntry(new BiomeGenGrove(BOPConfigurationIDs.groveID).setBiomeName("Grove"), TemperatureType.COOL, 5));
registerBiome(new BiomeEntry(new BiomeGenHeathland(BOPConfigurationIDs.heathlandID).setBiomeName("Heathland"), TemperatureType.WARM, 10));
registerBiome(new BiomeEntry(new BiomeGenHighland(BOPConfigurationIDs.highlandID).setBiomeName("Highland"), TemperatureType.WARM, 10));
registerBiome(new BiomeEntry(new BiomeGenJadeCliffs(BOPConfigurationIDs.jadeCliffsID).setBiomeName("Jade Cliffs"), TemperatureType.WARM, 5));
registerBiome(new BiomeEntry(new BiomeGenLavenderFields(BOPConfigurationIDs.lavenderFieldsID).setBiomeName("Lavender Fields"), TemperatureType.WARM, 3));
registerBiome(new BiomeEntry(new BiomeGenLushDesert(BOPConfigurationIDs.lushDesertID).setBiomeName("Lush Desert"), TemperatureType.HOT, 5));
registerBiome(new BiomeEntry(new BiomeGenLushSwamp(BOPConfigurationIDs.lushSwampID).setBiomeName("Lush Swamp"), TemperatureType.WARM, 10));
registerBiome(new BiomeEntry(new BiomeGenMapleWoods(BOPConfigurationIDs.mapleWoodsID).setBiomeName("Maple Woods"), TemperatureType.COOL, 10));
registerBiome(new BiomeEntry(new BiomeGenMarsh(BOPConfigurationIDs.marshID).setBiomeName("Marsh"), TemperatureType.WARM, 10));
registerBiome(new BiomeEntry(new BiomeGenMeadow(BOPConfigurationIDs.meadowID).setBiomeName("Meadow"), TemperatureType.COOL, 10));
registerBiome(new BiomeEntry(new BiomeGenMoor(BOPConfigurationIDs.moorID).setBiomeName("Moor"), TemperatureType.COOL, 10));
registerBiome(new BiomeEntry(new BiomeGenMountain(BOPConfigurationIDs.mountainID).setBiomeName("Mountain"), TemperatureType.WARM, 10));
registerBiome(new BiomeEntry(new BiomeGenMysticGrove(BOPConfigurationIDs.mysticGroveID).setBiomeName("Mystic Grove"), TemperatureType.WARM, 3));
registerBiome(new BiomeEntry(new BiomeGenOminousWoods(BOPConfigurationIDs.ominousWoodsID).setBiomeName("Ominous Woods"), TemperatureType.COOL, 3));
registerBiome(new BiomeEntry(new BiomeGenOriginValley(BOPConfigurationIDs.originValleyID).setBiomeName("Origin Valley"), TemperatureType.WARM, 1));
registerBiome(new BiomeEntry(new BiomeGenOutback(BOPConfigurationIDs.outbackID).setBiomeName("Outback"), TemperatureType.HOT, 10));
registerBiome(new BiomeEntry(new BiomeGenPrairie(BOPConfigurationIDs.prairieID).setBiomeName("Prairie"), TemperatureType.WARM, 10));
registerBiome(new BiomeEntry(new BiomeGenQuagmire(BOPConfigurationIDs.quagmireID).setBiomeName("Quagmire"), TemperatureType.WARM, 10));
registerBiome(new BiomeEntry(new BiomeGenRainforest(BOPConfigurationIDs.rainforestID).setBiomeName("Rainforest"), TemperatureType.WARM, 5));
registerBiome(new BiomeEntry(new BiomeGenRedwoodForest(BOPConfigurationIDs.redwoodForestID).setBiomeName("Redwood Forest"), TemperatureType.WARM, 10));
registerBiome(new BiomeEntry(new BiomeGenSacredSprings(BOPConfigurationIDs.sacredSpringsID).setBiomeName("Sacred Springs"), TemperatureType.WARM, 3));
registerBiome(new BiomeEntry(new BiomeGenSeasonalForest(BOPConfigurationIDs.seasonalForestID).setBiomeName("Seasonal Forest"), TemperatureType.COOL, 10));
registerBiome(new BiomeEntry(new BiomeGenShield(BOPConfigurationIDs.shieldID).setBiomeName("Shield"), TemperatureType.COOL, 10));
registerBiome(new BiomeEntry(new BiomeGenShrubland(BOPConfigurationIDs.shrublandID).setBiomeName("Shrubland"), TemperatureType.COOL, 10));
registerBiome(new BiomeEntry(new BiomeGenSilkglades(BOPConfigurationIDs.silkgladesID).setBiomeName("Silkglades"), TemperatureType.COOL, 5));
registerBiome(new BiomeEntry(new BiomeGenSludgepit(BOPConfigurationIDs.sludgepitID).setBiomeName("Sludgepit"), TemperatureType.WARM, 10));
registerBiome(new BiomeEntry(new BiomeGenSpruceWoods(BOPConfigurationIDs.spruceWoodsID).setBiomeName("Spruce Woods"), TemperatureType.WARM, 10));
registerBiome(new BiomeEntry(new BiomeGenTemperateRainforest(BOPConfigurationIDs.temperateRainforestID).setBiomeName("Temperate Rainforest"), TemperatureType.WARM, 10));
registerBiome(new BiomeEntry(new BiomeGenThicket(BOPConfigurationIDs.thicketID).setBiomeName("Thicket"), TemperatureType.COOL, 5));
registerBiome(new BiomeEntry(new BiomeGenTimber(BOPConfigurationIDs.timberID).setBiomeName("Timber"), TemperatureType.COOL, 5));
registerBiome(new BiomeEntry(new BiomeGenTropicalRainforest(BOPConfigurationIDs.tropicalRainforestID).setBiomeName("Tropical Rainforest"), TemperatureType.HOT, 5));
registerBiome(new BiomeEntry(new BiomeGenTropics(BOPConfigurationIDs.tropicsID).setBiomeName("Tropics"), TemperatureType.HOT, 3));
registerBiome(new BiomeEntry(new BiomeGenTundra(BOPConfigurationIDs.tundraID).setBiomeName("Tundra"), TemperatureType.ICY, 10));
registerBiome(new BiomeEntry(new BiomeGenVolcano(BOPConfigurationIDs.volcanoID).setBiomeName("Volcano"), TemperatureType.HOT, 5));
registerBiome(new BiomeEntry(new BiomeGenWasteland(BOPConfigurationIDs.wastelandID).setBiomeName("Wasteland"), TemperatureType.HOT, 3));
registerBiome(new BiomeEntry(new BiomeGenWetland(BOPConfigurationIDs.wetlandID).setBiomeName("Wetland"), TemperatureType.WARM, 10));
registerBiome(new BiomeEntry(new BiomeGenWoodland(BOPConfigurationIDs.woodlandID).setBiomeName("Woodland"), TemperatureType.WARM, 10));
registerBiome(new BiomeEntry(new BiomeGenCorruptedSands(BOPConfigurationIDs.netherCorruptedSandsID).setBiomeName("Corrupted Sands"), 10), -1);
alps = registerOverworldBiome(BiomeGenAlps.class, "Alps", TemperatureType.ICY, 5);
arctic = registerOverworldBiome(BiomeGenArctic.class, "Arctic", TemperatureType.ICY, 10);
bambooForest = registerOverworldBiome(BiomeGenBambooForest.class, "Bamboo Forest", TemperatureType.HOT, 5);
bayou = registerOverworldBiome(BiomeGenBayou.class, "Bayou", TemperatureType.WARM, 10);
bog = registerOverworldBiome(BiomeGenBog.class, "Bog", TemperatureType.WARM, 10);
borealForest = registerOverworldBiome(BiomeGenBorealForest.class, "Boreal Forest", TemperatureType.WARM, 10);
brushland = registerOverworldBiome(BiomeGenBrushland.class, "Brushland", TemperatureType.HOT, 10);
canyon = registerOverworldBiome(BiomeGenCanyon.class, "Canyon", TemperatureType.HOT, 10);
chaparral = registerOverworldBiome(BiomeGenChaparral.class, "Chaparral", TemperatureType.WARM, 10);
cherryBlossomGrove = registerOverworldBiome(BiomeGenCherryBlossomGrove.class, "Cherry Blossom Grove", TemperatureType.COOL, 3);
coniferousForest = registerOverworldBiome(BiomeGenConiferousForest.class, "Coniferous Forest", TemperatureType.WARM, 10);
snowyConiferousForest = registerOverworldBiome(BiomeGenConiferousForestSnow.class, "Snowy Coniferous Forest", TemperatureType.ICY, 10);
crag = registerOverworldBiome(BiomeGenCrag.class, "Crag", TemperatureType.COOL, 3);
deadForest = registerOverworldBiome(BiomeGenDeadForest.class, "Dead Forest", TemperatureType.COOL, 10);
deadSwamp = registerOverworldBiome(BiomeGenDeadSwamp.class, "Dead Swamp", TemperatureType.WARM, 10);
deciduousForest = registerOverworldBiome(BiomeGenDeciduousForest.class, "Deciduous Forest", TemperatureType.WARM, 10);
dunes = registerOverworldBiome(BiomeGenDunes.class, "Dunes", TemperatureType.HOT, 10);
fen = registerOverworldBiome(BiomeGenFen.class, "Fen", TemperatureType.WARM, 10);
flowerField = registerOverworldBiome(BiomeGenFlowerField.class, "Flower Field", TemperatureType.WARM, 3);
frostForest = registerOverworldBiome(BiomeGenFrostForest.class, "Frost Forest", TemperatureType.ICY, 10);
grassland = registerOverworldBiome(BiomeGenGrassland.class, "Grassland", TemperatureType.COOL, 10);
grove = registerOverworldBiome(BiomeGenGrove.class, "Grove", TemperatureType.COOL, 5);
heathland = registerOverworldBiome(BiomeGenHeathland.class, "Heathland", TemperatureType.WARM, 10);
highland = registerOverworldBiome(BiomeGenHighland.class, "Highland", TemperatureType.WARM, 10);
jadeCliffs = registerOverworldBiome(BiomeGenJadeCliffs.class, "Jade Cliffs", TemperatureType.WARM, 5);
lavenderFields = registerOverworldBiome(BiomeGenLavenderFields.class, "Lavender Fields", TemperatureType.WARM, 3);
lushDesert = registerOverworldBiome(BiomeGenLushDesert.class, "Lush Desert", TemperatureType.HOT, 5);
lushSwamp = registerOverworldBiome(BiomeGenLushSwamp.class, "Lush Swamp", TemperatureType.WARM, 10);
mapleWoods = registerOverworldBiome(BiomeGenMapleWoods.class, "Maple Woods", TemperatureType.COOL, 10);
marsh = registerOverworldBiome(BiomeGenMarsh.class, "Marsh", TemperatureType.WARM, 10);
meadow = registerOverworldBiome(BiomeGenMeadow.class, "Meadow", TemperatureType.COOL, 10);
moor = registerOverworldBiome(BiomeGenMoor.class, "Moor", TemperatureType.COOL, 10);
mountain = registerOverworldBiome(BiomeGenMountain.class, "Mountain", TemperatureType.WARM, 10);
mysticGrove = registerOverworldBiome(BiomeGenMysticGrove.class, "Mystic Grove", TemperatureType.WARM, 3);
ominousWoods = registerOverworldBiome(BiomeGenOminousWoods.class, "Ominous Woods", TemperatureType.COOL, 3);
originValley = registerOverworldBiome(BiomeGenOriginValley.class, "Origin Valley", TemperatureType.WARM, 1);
outback = registerOverworldBiome(BiomeGenOutback.class, "Outback", TemperatureType.HOT, 10);
prairie = registerOverworldBiome(BiomeGenPrairie.class, "Prairie", TemperatureType.WARM, 10);
quagmire = registerOverworldBiome(BiomeGenQuagmire.class, "Quagmire", TemperatureType.WARM, 10);
rainforest = registerOverworldBiome(BiomeGenRainforest.class, "Rainforest", TemperatureType.WARM, 5);
redwoodForest = registerOverworldBiome(BiomeGenRedwoodForest.class, "Redwood Forest", TemperatureType.WARM, 10);
sacredSprings = registerOverworldBiome(BiomeGenSacredSprings.class, "Sacred Springs", TemperatureType.WARM, 3);
seasonalForest = registerOverworldBiome(BiomeGenSeasonalForest.class, "Seasonal Forest", TemperatureType.COOL, 10);
shield = registerOverworldBiome(BiomeGenShield.class, "Shield", TemperatureType.COOL, 10);
shrubland = registerOverworldBiome(BiomeGenShrubland.class, "Shrubland", TemperatureType.COOL, 10);
silkglades = registerOverworldBiome(BiomeGenSilkglades.class, "Silkglades", TemperatureType.COOL, 5);
sludgepit = registerOverworldBiome(BiomeGenSludgepit.class, "Sludgepit", TemperatureType.WARM, 10);
spruceWoods = registerOverworldBiome(BiomeGenSpruceWoods.class, "Spruce Woods", TemperatureType.WARM, 10);
temperateRainforest = registerOverworldBiome(BiomeGenTemperateRainforest.class, "Temperate Rainforest", TemperatureType.WARM, 10);
thicket = registerOverworldBiome(BiomeGenThicket.class, "Thicket", TemperatureType.COOL, 5);
timber = registerOverworldBiome(BiomeGenTimber.class, "Timber", TemperatureType.COOL, 5);
tropicalRainforest = registerOverworldBiome(BiomeGenTropicalRainforest.class, "Tropical Rainforest", TemperatureType.HOT, 5);
tropics = registerOverworldBiome(BiomeGenTropics.class, "Tropics", TemperatureType.HOT, 3);
tundra = registerOverworldBiome(BiomeGenTundra.class, "Tundra", TemperatureType.ICY, 10);
volcano = registerOverworldBiome(BiomeGenVolcano.class, "Volcano", TemperatureType.HOT, 5);
wasteland = registerOverworldBiome(BiomeGenWasteland.class, "Wasteland", TemperatureType.HOT, 3);
wetland = registerOverworldBiome(BiomeGenWetland.class, "Wetland", TemperatureType.WARM, 10);
woodland = registerOverworldBiome(BiomeGenWoodland.class, "Woodland", TemperatureType.WARM, 10);
//Sub Biomes
//new BiomeGenKelpForest(BOPConfigurationIDs.oceanKelpID).setBiomeName("Kelp Forest");
//Nether Biomes
registerNetherBiome(BiomeGenCorruptedSands.class, "Corrupted Sands", 10);
//registerBiome(new BiomeEntry(new BiomeGenUndergarden(BOPConfigurationIDs.netherUndergardenID).setBiomeName("Undergarden"), 10), -1);
registerBiome(new BiomeEntry(new BiomeGenPhantasmagoricInferno(BOPConfigurationIDs.netherPhantasmagoricInfernoID).setBiomeName("Phantasmagoric Inferno"), 10), -1);
registerBiome(new BiomeEntry(new BiomeGenBoneyard(BOPConfigurationIDs.netherBoneyardID).setBiomeName("Boneyard"), 10), -1);
registerBiome(new BiomeEntry(new BiomeGenVisceralHeap(BOPConfigurationIDs.netherVisceralHeapID).setBiomeName("Visceral Heap"), 10), -1);
registerNetherBiome(BiomeGenPhantasmagoricInferno.class, "Phantasmagoric Inferno", 10);
registerNetherBiome(BiomeGenBoneyard.class, "Boneyard", 10);
registerNetherBiome(BiomeGenVisceralHeap.class, "Visceral Heap", 10);
}
private static void addSpawnBiomes()
@ -172,75 +252,78 @@ public class BOPBiomes
}
else
{
for (BiomeEntry entry : BOPBiomeHelper.biomeLists[0 + 1].values())
for (List<BiomeEntry> biomeList : BOPBiomeManager.overworldBiomes)
{
addSpawnBiome(entry.biome);
for (BiomeEntry entry : biomeList)
{
addSpawnBiome(entry.biome);
}
}
}
}
private static void addBiomesToDictionary()
{
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("alps"), Type.FROZEN, Type.MOUNTAIN);
/*BiomeDictionary.registerBiomeType(BOPBiomeManager.get("alps"), Type.FROZEN, Type.MOUNTAIN);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("alpsBase"), Type.FROZEN, Type.MOUNTAIN, Type.FOREST);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("alpsForest"), Type.FROZEN, Type.MOUNTAIN);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("arctic"), Type.FROZEN, Type.WASTELAND);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("arctic"), Type.FROZEN, Type.WASTELAND);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("autumnHills"), Type.FOREST, Type.HILLS);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("badlands"), Type.DESERT, Type.WASTELAND);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("bambooForest"), Type.JUNGLE, Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("bayou"), Type.SWAMP, Type.WATER);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("bambooForest"), Type.JUNGLE, Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("bayou"), Type.SWAMP, Type.WATER);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("beachGravel"), Type.BEACH);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("beachOvergrown"), Type.BEACH, Type.FOREST);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("birchForest"), Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("bog"), Type.SWAMP, Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("borealForest"), Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("brushland"), Type.DESERT, Type.FOREST, Type.PLAINS);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("canyon"), Type.DESERT, Type.MOUNTAIN, Type.HILLS);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("bog"), Type.SWAMP, Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("borealForest"), Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("brushland"), Type.DESERT, Type.FOREST, Type.PLAINS);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("canyon"), Type.DESERT, Type.MOUNTAIN, Type.HILLS);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("canyonRavine"), Type.DESERT, Type.HILLS);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("chaparral"), Type.PLAINS);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("cherryBlossomGrove"), Type.MAGICAL, Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("coniferousForest"), Type.FOREST, Type.HILLS);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("snowyConiferousForest"), Type.FROZEN, Type.FOREST, Type.HILLS);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("crag"), Type.WASTELAND, Type.MOUNTAIN);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("deadForest"), Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("chaparral"), Type.PLAINS);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("cherryBlossomGrove"), Type.MAGICAL, Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("coniferousForest"), Type.FOREST, Type.HILLS);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("snowyConiferousForest"), Type.FROZEN, Type.FOREST, Type.HILLS);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("crag"), Type.WASTELAND, Type.MOUNTAIN);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("deadForest"), Type.FOREST);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("deadForestSnow"), Type.FOREST, Type.FROZEN);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("deadlands"), Type.WASTELAND);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("deadSwamp"), Type.SWAMP);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("deciduousForest"), Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("dunes"), Type.BEACH, Type.DESERT, Type.HILLS);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("fen"), Type.FOREST, Type.SWAMP);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("flowerField"), Type.PLAINS);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("deadSwamp"), Type.SWAMP);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("deciduousForest"), Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("dunes"), Type.BEACH, Type.DESERT, Type.HILLS);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("fen"), Type.FOREST, Type.SWAMP);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("flowerField"), Type.PLAINS);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("fieldForest"), Type.PLAINS, Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("frostForest"), Type.FROZEN, Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("frostForest"), Type.FROZEN, Type.FOREST);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("fungiForest"), Type.MAGICAL, Type.MUSHROOM, Type.FOREST, Type.SWAMP);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("garden"), Type.MAGICAL, Type.PLAINS);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("glacier"), Type.FROZEN, Type.HILLS);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("grassland"), Type.PLAINS, Type.SWAMP, Type.HILLS);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("grove"), Type.FOREST, Type.PLAINS);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("heathland"), Type.PLAINS);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("highland"), Type.HILLS, Type.MOUNTAIN);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("grassland"), Type.PLAINS, Type.SWAMP, Type.HILLS);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("grove"), Type.FOREST, Type.PLAINS);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("heathland"), Type.PLAINS);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("highland"), Type.HILLS, Type.MOUNTAIN);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("hotSprings"), Type.HILLS, Type.FOREST, Type.WATER);
// BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("icyHills"), Type.FROZEN, Type.HILLS);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("jadeCliffs"), Type.FOREST, Type.MOUNTAIN);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("lavenderFields"), Type.PLAINS);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("lushDesert"), Type.DESERT, Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("lushSwamp"), Type.SWAMP, Type.WATER);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("jadeCliffs"), Type.FOREST, Type.MOUNTAIN);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("lavenderFields"), Type.PLAINS);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("lushDesert"), Type.DESERT, Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("lushSwamp"), Type.SWAMP, Type.WATER);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("mangrove"), Type.WATER, Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("mapleWoods"), Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("marsh"), Type.SWAMP, Type.WATER);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("mapleWoods"), Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("marsh"), Type.SWAMP, Type.WATER);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("meadow"), Type.FOREST, Type.PLAINS);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("meadow"), Type.FOREST, Type.PLAINS);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("meadowForest"), Type.FOREST, Type.PLAINS);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("mesa"), Type.DESERT, Type.WASTELAND, Type.MOUNTAIN);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("moor"), Type.HILLS, Type.SWAMP);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("mountain"), Type.MOUNTAIN);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("moor"), Type.HILLS, Type.SWAMP);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("mountain"), Type.MOUNTAIN);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("mysticGrove"), Type.MAGICAL, Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("mysticGrove"), Type.MAGICAL, Type.FOREST);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("mysticGroveThin"), Type.MAGICAL, Type.FOREST);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("netherBase"), Type.NETHER);
@ -256,67 +339,62 @@ public class BOPBiomes
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("oceanCoral"), Type.WATER);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("oceanKelp"), Type.WATER, Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("ominousWoods"), Type.MAGICAL);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("ominousWoods"), Type.MAGICAL);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("ominousWoodsThick"), Type.MAGICAL);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("orchard"), Type.FOREST, Type.PLAINS);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("outback"), Type.DESERT, Type.PLAINS);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("outback"), Type.DESERT, Type.PLAINS);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("overgrownGreens"), Type.JUNGLE, Type.PLAINS);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("polar"), Type.FROZEN, Type.WATER);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("prairie"), Type.PLAINS);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("prairie"), Type.PLAINS);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("quagmire"), Type.WASTELAND, Type.SWAMP);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("rainforest"), Type.JUNGLE, Type.HILLS, Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("redwoodForest"), Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("sacredSprings"), Type.MOUNTAIN, Type.FOREST, Type.MAGICAL);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("quagmire"), Type.WASTELAND, Type.SWAMP);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("rainforest"), Type.JUNGLE, Type.HILLS, Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("redwoodForest"), Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("sacredSprings"), Type.MOUNTAIN, Type.FOREST, Type.MAGICAL);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("savanna"), Type.DESERT, Type.PLAINS);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("savannaPlateau"), Type.DESERT, Type.PLAINS, Type.HILLS);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("scrubland"), Type.DESERT, Type.PLAINS);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("seasonalForest"), Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("seasonalForest"), Type.FOREST);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("seasonalSpruceForest"), Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("shield"), Type.FOREST, Type.WATER);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("shield"), Type.FOREST, Type.WATER);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("shrubland"), Type.PLAINS);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("shrubland"), Type.PLAINS);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("shrublandForest"), Type.PLAINS);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("silkglades"), Type.SWAMP, Type.WASTELAND);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("sludgepit"), Type.SWAMP, Type.FOREST, Type.WASTELAND);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("spruceWoods"), Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("silkglades"), Type.SWAMP, Type.WASTELAND);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("sludgepit"), Type.SWAMP, Type.FOREST, Type.WASTELAND);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("spruceWoods"), Type.FOREST);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("steppe"), Type.PLAINS, Type.DESERT);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("temperateRainforest"), Type.FOREST, Type.HILLS);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("thicket"), Type.PLAINS, Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("temperateRainforest"), Type.FOREST, Type.HILLS);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("thicket"), Type.PLAINS, Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("timber"), Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("timber"), Type.FOREST);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("timberThin"), Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("tropicalRainforest"), Type.JUNGLE);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("tropicalRainforest"), Type.JUNGLE);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("tropics"), Type.JUNGLE, Type.WATER);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("tropics"), Type.JUNGLE, Type.WATER);
//BiomeDictionary.registerBiomeType(BOPBiomeHelper.getBOPBiome("tropicsMountain"), Type.JUNGLE, Type.WATER);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("tundra"), Type.FROZEN, Type.WASTELAND);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("volcano"), Type.WASTELAND, Type.MOUNTAIN);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("wasteland"), Type.WASTELAND);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("wetland"), Type.SWAMP, Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeHelper.get("woodland"), Type.FOREST);
}
public static void registerOnlyBiome(BiomeEntry biome)
{
onlyBiome = biome;
registerBiome(biome);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("tundra"), Type.FROZEN, Type.WASTELAND);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("volcano"), Type.WASTELAND, Type.MOUNTAIN);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("wasteland"), Type.WASTELAND);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("wetland"), Type.SWAMP, Type.FOREST);
BiomeDictionary.registerBiomeType(BOPBiomeManager.get("woodland"), Type.FOREST);*/
}
public static void registerBiome(BiomeEntry biome, int dimID)
private static BiomeGenBase registerOverworldBiome(Class<? extends BiomeGenBase> biomeClass, String biomeName, int temperatureType, int weight)
{
BOPBiomeHelper.registerBiome(biome, dimID, "biomesoplenty:" + BOPBiomeHelper.convertBiomeName(biome.biome.biomeName));
return BOPBiomeManager.createAndRegisterBiome(biomeClass, "Overworld", biomeName, BOPBiomeManager.overworldBiomes[temperatureType], weight);
}
public static void registerBiome(BiomeEntry biome)
private static BiomeGenBase registerNetherBiome(Class<? extends BiomeGenBase> biomeClass, String biomeName, int weight)
{
registerBiome(biome, 0);
return BOPBiomeManager.createAndRegisterBiome(biomeClass, "Nether", biomeName, BOPBiomeManager.netherBiomes, weight);
}
public static void addSpawnBiome(BiomeGenBase biome)

View file

@ -6,7 +6,7 @@ import net.minecraft.entity.EntityList.EntityEggInfo;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.world.biome.BiomeGenBase;
import biomesoplenty.BiomesOPlenty;
import biomesoplenty.api.BOPBiomeHelper;
import biomesoplenty.api.content.BOPCBiomes;
import biomesoplenty.common.configuration.BOPConfigurationIDs;
import biomesoplenty.common.entities.EntityBird;
import biomesoplenty.common.entities.EntityGlob;
@ -39,7 +39,7 @@ public class BOPEntities
registerEntityEgg(EntityJungleSpider.class, 5147192, 11013646);
EntityRegistry.addSpawn(EntityJungleSpider.class, 8, 1, 3, EnumCreatureType.monster, BOPBiomeHelper.get("bambooForest"), BiomeGenBase.jungle, BOPBiomeHelper.get("tropicalRainforest")/*, Biomes.oasis.get()*/, BOPBiomeHelper.get("tropics"));
EntityRegistry.addSpawn(EntityJungleSpider.class, 8, 1, 3, EnumCreatureType.monster, BOPCBiomes.bambooForest, BiomeGenBase.jungle, BOPCBiomes.tropicalRainforest/*, Biomes.oasis.get()*/, BOPCBiomes.tropics);
}
if (BOPConfigurationIDs.rosesterID > 0)
@ -60,7 +60,7 @@ public class BOPEntities
registerEntityEgg(EntityGlob.class, 6836276, 8414787);
EntityRegistry.addSpawn(EntityGlob.class, 1, 1, 1, EnumCreatureType.creature, BOPBiomeHelper.get("bog"), BOPBiomeHelper.get("deadSwamp"), BOPBiomeHelper.get("fen"), BOPBiomeHelper.get("moor"), BOPBiomeHelper.get("quagmire"), BOPBiomeHelper.get("sludgepit"), BiomeGenBase.swampland);
EntityRegistry.addSpawn(EntityGlob.class, 1, 1, 1, EnumCreatureType.creature, BOPCBiomes.bog, BOPCBiomes.deadSwamp, BOPCBiomes.fen, BOPCBiomes.moor, BOPCBiomes.quagmire, BOPCBiomes.sludgepit, BiomeGenBase.swampland);
}
if (BOPConfigurationIDs.phantomID > 0)
@ -100,7 +100,7 @@ public class BOPEntities
registerEntityEgg(EntityPixie.class, 16742365, 16645116);
EntityRegistry.addSpawn(EntityPixie.class, 8, 1, 3, EnumCreatureType.ambient, BOPBiomeHelper.get("mysticGrove"));
EntityRegistry.addSpawn(EntityPixie.class, 8, 1, 3, EnumCreatureType.ambient, BOPCBiomes.mysticGrove);
}
}

View file

@ -1,15 +1,18 @@
package biomesoplenty.common.eventhandler.world;
import org.apache.logging.log4j.Level;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.GenLayerBiome;
import net.minecraft.world.gen.layer.GenLayerRiverMix;
import net.minecraftforge.event.terraingen.WorldTypeEvent.InitBiomeGens;
import biomesoplenty.api.BOPBiomeHelper.TemperatureType;
import biomesoplenty.api.BOPBiomeManager.BiomeEntry;
import biomesoplenty.common.configuration.BOPConfigurationBiomeGen;
import biomesoplenty.common.configuration.BOPConfigurationIDs;
import biomesoplenty.common.configuration.BOPConfigurationMain;
import biomesoplenty.common.core.BOPBiomes;
import biomesoplenty.common.utils.BOPLogger;
import biomesoplenty.common.world.BOPBiomeManager.BiomeEntry;
import biomesoplenty.common.world.layer.GenLayerBiomeBOP;
import cpw.mods.fml.common.ObfuscationReflectionHelper;
import cpw.mods.fml.common.eventhandler.EventPriority;
@ -56,57 +59,82 @@ public class DefaultWorldEventHandler
if (genLayerBiome != null)
{
BiomeGenBase[] vanillaDesertBiomes = (BiomeGenBase[])ObfuscationReflectionHelper.getPrivateValue(GenLayerBiome.class, genLayerBiome, "field_151623_c");
BiomeGenBase[] vanillaWarmBiomes = (BiomeGenBase[])ObfuscationReflectionHelper.getPrivateValue(GenLayerBiome.class, genLayerBiome, "field_151621_d");
BiomeGenBase[] vanillaCoolBiomes = (BiomeGenBase[])ObfuscationReflectionHelper.getPrivateValue(GenLayerBiome.class, genLayerBiome, "field_151622_e");
BiomeGenBase[] vanillaIcyBiomes = (BiomeGenBase[])ObfuscationReflectionHelper.getPrivateValue(GenLayerBiome.class, genLayerBiome, "field_151620_f");
for (BiomeGenBase biome : vanillaDesertBiomes)
try
{
if (biome != null)
BOPConfigurationBiomeGen.config.load();
BiomeGenBase[] vanillaDesertBiomes = (BiomeGenBase[])ObfuscationReflectionHelper.getPrivateValue(GenLayerBiome.class, genLayerBiome, "field_151623_c");
BiomeGenBase[] vanillaWarmBiomes = (BiomeGenBase[])ObfuscationReflectionHelper.getPrivateValue(GenLayerBiome.class, genLayerBiome, "field_151621_d");
BiomeGenBase[] vanillaCoolBiomes = (BiomeGenBase[])ObfuscationReflectionHelper.getPrivateValue(GenLayerBiome.class, genLayerBiome, "field_151622_e");
BiomeGenBase[] vanillaIcyBiomes = (BiomeGenBase[])ObfuscationReflectionHelper.getPrivateValue(GenLayerBiome.class, genLayerBiome, "field_151620_f");
for (BiomeGenBase biome : vanillaDesertBiomes)
{
if (BOPConfigurationMain.debugMode) BOPLogger.info("Adding biome " + biome.biomeName + " from the default world.");
if (biome != null)
{
if (BOPConfigurationMain.debugMode) BOPLogger.info("Adding biome " + biome.biomeName + " from the default world.");
BiomeEntry entry = new BiomeEntry(biome, TemperatureType.HOT, 10);
BiomeEntry entry = new BiomeEntry(biome, 10);
genLayerBiome.desertBiomes.add(entry);
if (BOPConfigurationBiomeGen.config.get("Default World" + " Biomes To Generate", biome.biomeName, true).getBoolean(false))
{
genLayerBiome.biomeLists[0].add(entry);
}
}
}
for (BiomeGenBase biome : vanillaWarmBiomes)
{
if (biome != null)
{
if (BOPConfigurationMain.debugMode) BOPLogger.info("Adding biome " + biome.biomeName + " from the default world.");
BiomeEntry entry = new BiomeEntry(biome, 10);
if (BOPConfigurationBiomeGen.config.get("Default World" + " Biomes To Generate", biome.biomeName, true).getBoolean(false))
{
genLayerBiome.biomeLists[1].add(entry);
}
}
}
for (BiomeGenBase biome : vanillaCoolBiomes)
{
if (biome != null)
{
if (BOPConfigurationMain.debugMode) BOPLogger.info("Adding biome " + biome.biomeName + " from the default world.");
BiomeEntry entry = new BiomeEntry(biome, 10);
if (BOPConfigurationBiomeGen.config.get("Default World" + " Biomes To Generate", biome.biomeName, true).getBoolean(false))
{
genLayerBiome.biomeLists[2].add(entry);
}
}
}
for (BiomeGenBase biome : vanillaIcyBiomes)
{
if (biome != null)
{
if (BOPConfigurationMain.debugMode) BOPLogger.info("Adding biome " + biome.biomeName + " from the default world.");
BiomeEntry entry = new BiomeEntry(biome, 10);
if (BOPConfigurationBiomeGen.config.get("Default World" + " Biomes To Generate", biome.biomeName, true).getBoolean(false))
{
genLayerBiome.biomeLists[3].add(entry);
}
}
}
}
for (BiomeGenBase biome : vanillaWarmBiomes)
catch (Exception e)
{
if (biome != null)
{
if (BOPConfigurationMain.debugMode) BOPLogger.info("Adding biome " + biome.biomeName + " from the default world.");
BiomeEntry entry = new BiomeEntry(biome, TemperatureType.WARM, 10);
genLayerBiome.warmBiomes.add(entry);
}
BOPLogger.log(Level.ERROR, "Biomes O Plenty has had a problem loading its configuration", e);
}
for (BiomeGenBase biome : vanillaCoolBiomes)
finally
{
if (biome != null)
{
if (BOPConfigurationMain.debugMode) BOPLogger.info("Adding biome " + biome.biomeName + " from the default world.");
BiomeEntry entry = new BiomeEntry(biome, TemperatureType.COOL, 10);
genLayerBiome.coolBiomes.add(entry);
}
}
for (BiomeGenBase biome : vanillaIcyBiomes)
{
if (biome != null)
{
if (BOPConfigurationMain.debugMode) BOPLogger.info("Adding biome " + biome.biomeName + " from the default world.");
BiomeEntry entry = new BiomeEntry(biome, TemperatureType.ICY, 10);
genLayerBiome.icyBiomes.add(entry);
}
if (BOPConfigurationBiomeGen.config.hasChanged()) BOPConfigurationBiomeGen.config.save();
}
}
}

View file

@ -7,7 +7,7 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
public class MapGenEventHandler
{
@SubscribeEvent
public void onMapGenInit(InitMapGenEvent event)
public void onInitBiomeGens(InitMapGenEvent event)
{
if (event.type == EventType.VILLAGE)
{

View file

@ -1,10 +1,9 @@
package biomesoplenty.common.eventhandler.world;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraftforge.event.terraingen.BiomeEvent;
import biomesoplenty.api.BOPBiomeHelper;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.api.content.BOPCBiomes;
import cpw.mods.fml.common.eventhandler.Event.Result;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
@ -15,7 +14,7 @@ public class VillageMaterialEventHandler
public void getVillageBlockID(BiomeEvent.GetVillageBlockID event)
{
//Arctic
if (event.biome == BOPBiomeHelper.get("arctic"))
if (event.biome == BOPCBiomes.arctic)
{
//Cobblestone
if (event.original == Blocks.cobblestone)
@ -141,7 +140,7 @@ public class VillageMaterialEventHandler
}*/
//Brushland
if (event.biome == BOPBiomeHelper.get("brushland"))
if (event.biome == BOPCBiomes.brushland)
{
//Gravel
if (event.original == Blocks.gravel)
@ -152,7 +151,7 @@ public class VillageMaterialEventHandler
}
//Coniferous Forest
if (event.biome == BOPBiomeHelper.get("coniferousForest"))
if (event.biome == BOPCBiomes.coniferousForest)
{
//Cobblestone
if (event.original == Blocks.cobblestone)
@ -263,7 +262,7 @@ public class VillageMaterialEventHandler
}*/
//Grove
if (event.biome == BOPBiomeHelper.get("grove"))
if (event.biome == BOPCBiomes.grove)
{
//Cobblestone
if (event.original == Blocks.cobblestone)
@ -314,7 +313,7 @@ public class VillageMaterialEventHandler
}
//Heathland
if (event.biome == BOPBiomeHelper.get("heathland"))
if (event.biome == BOPCBiomes.heathland)
{
//Logs
if (event.original == Blocks.log)
@ -346,7 +345,7 @@ public class VillageMaterialEventHandler
}
//Lush Desert
if (event.biome == BOPBiomeHelper.get("lushDesert"))
if (event.biome == BOPCBiomes.lushDesert)
{
//Cobblestone
if (event.original == Blocks.cobblestone)
@ -399,7 +398,7 @@ public class VillageMaterialEventHandler
}
//Lush Swamp
if (event.biome == BOPBiomeHelper.get("lushSwamp"))
if (event.biome == BOPCBiomes.lushSwamp)
{
//Gravel
if (event.original == Blocks.cobblestone)
@ -410,7 +409,7 @@ public class VillageMaterialEventHandler
}
//Maple Woods
if (event.biome == BOPBiomeHelper.get("mapleWoods"))
if (event.biome == BOPCBiomes.mapleWoods)
{
//Wooden Stairs
if (event.original == Blocks.oak_stairs)
@ -421,7 +420,7 @@ public class VillageMaterialEventHandler
}
//Meadow
if (event.biome == BOPBiomeHelper.get("meadow"))
if (event.biome == BOPCBiomes.meadow)
{
//Cobblestone
if (event.original == Blocks.cobblestone)
@ -523,7 +522,7 @@ public class VillageMaterialEventHandler
}*/
//Outback
if (event.biome == BOPBiomeHelper.get("outback"))
if (event.biome == BOPCBiomes.outback)
{
//Cobblestone
if (event.original == Blocks.cobblestone)
@ -620,7 +619,7 @@ public class VillageMaterialEventHandler
}*/
//Prairie
if (event.biome == BOPBiomeHelper.get("prairie"))
if (event.biome == BOPCBiomes.prairie)
{
//Gravel
if (event.original == Blocks.gravel)
@ -714,7 +713,7 @@ public class VillageMaterialEventHandler
}*/
//Snowy Coniferous Forest
if (event.biome == BOPBiomeHelper.get("snowyConiferousForest"))
if (event.biome == BOPCBiomes.snowyConiferousForest)
{
//Cobblestone
if (event.original == Blocks.cobblestone)
@ -779,7 +778,7 @@ public class VillageMaterialEventHandler
}
//Spruce Woods
if (event.biome == BOPBiomeHelper.get("spruceWoods"))
if (event.biome == BOPCBiomes.spruceWoods)
{
//Wooden Stairs
if (event.original == Blocks.oak_stairs)
@ -862,7 +861,7 @@ public class VillageMaterialEventHandler
}*/
//Tropical Rainforest
if (event.biome == BOPBiomeHelper.get("tropicalRainforest"))
if (event.biome == BOPCBiomes.tropicalRainforest)
{
//Cobblestone
if (event.original == Blocks.cobblestone)
@ -920,7 +919,7 @@ public class VillageMaterialEventHandler
}
//Wetland
if (event.biome == BOPBiomeHelper.get("wetland"))
if (event.biome == BOPCBiomes.wetland)
{
//Cobblestone
if (event.original == Blocks.cobblestone)
@ -1000,7 +999,7 @@ public class VillageMaterialEventHandler
}*/
//Coniferous Forest
if (event.biome == BOPBiomeHelper.get("coniferousForest"))
if (event.biome == BOPCBiomes.coniferousForest)
{
//Cobblestone
if (event.original == Blocks.cobblestone)
@ -1050,7 +1049,7 @@ public class VillageMaterialEventHandler
}*/
//Grove
if (event.biome == BOPBiomeHelper.get("grove"))
if (event.biome == BOPCBiomes.grove)
{
//Cobblestone
if (event.original == Blocks.cobblestone)
@ -1089,7 +1088,7 @@ public class VillageMaterialEventHandler
}
//Heathland
if (event.biome == BOPBiomeHelper.get("heathland"))
if (event.biome == BOPCBiomes.heathland)
{
//Logs
if (event.original == Blocks.log)
@ -1107,7 +1106,7 @@ public class VillageMaterialEventHandler
}
//Lush Desert
if (event.biome == BOPBiomeHelper.get("lushDesert"))
if (event.biome == BOPCBiomes.lushDesert)
{
//Cobblestone
if (event.original == Blocks.cobblestone)
@ -1133,7 +1132,7 @@ public class VillageMaterialEventHandler
}
//Maple Woods
if (event.biome == BOPBiomeHelper.get("mapleWoods"))
if (event.biome == BOPCBiomes.mapleWoods)
{
//Logs
if (event.original == Blocks.log)
@ -1151,7 +1150,7 @@ public class VillageMaterialEventHandler
}
//Meadow
if (event.biome == BOPBiomeHelper.get("meadow"))
if (event.biome == BOPCBiomes.meadow)
{
//Cobblestone
if (event.original == Blocks.cobblestone)
@ -1215,7 +1214,7 @@ public class VillageMaterialEventHandler
}*/
//Outback
if (event.biome == BOPBiomeHelper.get("outback"))
if (event.biome == BOPCBiomes.outback)
{
//Wooden Planks
if (event.original == Blocks.planks)
@ -1244,7 +1243,7 @@ public class VillageMaterialEventHandler
}*/
//Snowy Coniferous Forest
if (event.biome == BOPBiomeHelper.get("snowyConiferousForest"))
if (event.biome == BOPCBiomes.snowyConiferousForest)
{
//Cobblestone
if (event.original == Blocks.cobblestone)
@ -1276,7 +1275,7 @@ public class VillageMaterialEventHandler
}
//Spruce Woods
if (event.biome == BOPBiomeHelper.get("spruceWoods"))
if (event.biome == BOPCBiomes.spruceWoods)
{
//Logs
if (event.original == Blocks.log)
@ -1294,7 +1293,7 @@ public class VillageMaterialEventHandler
}
//Tropical Rainforest
if (event.biome == BOPBiomeHelper.get("tropicalRainforest"))
if (event.biome == BOPCBiomes.tropicalRainforest)
{
//Cobblestone
if (event.original == Blocks.cobblestone)
@ -1326,7 +1325,7 @@ public class VillageMaterialEventHandler
}
//Wetland
if (event.biome == BOPBiomeHelper.get("wetland"))
if (event.biome == BOPCBiomes.wetland)
{
//Cobblestone
if (event.original == Blocks.cobblestone)

View file

@ -1,74 +0,0 @@
package biomesoplenty.common.world;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import biomesoplenty.api.BOPBiomeHelper;
import biomesoplenty.api.BOPBiomeHelper.TemperatureType;
import net.minecraft.util.WeightedRandom;
import net.minecraft.world.biome.BiomeGenBase;
public class BOPBiomeManager
{
public static List<BiomeEntry> desertBiomes = new ArrayList<BiomeEntry>();
public static List<BiomeEntry> warmBiomes = new ArrayList<BiomeEntry>();
public static List<BiomeEntry> coolBiomes = new ArrayList<BiomeEntry>();
public static List<BiomeEntry> icyBiomes = new ArrayList<BiomeEntry>();
public static BiomeEntry getWeightedRandomBiome(Collection<BiomeEntry> weightedBiomes, int seedRandom)
{
return getWeightedRandomBiome(weightedBiomes, seedRandom, WeightedRandom.getTotalWeight(weightedBiomes));
}
private static BiomeEntry getWeightedRandomBiome(Collection<BiomeEntry> weightedBiomes, int seedRandom, int totalWeight)
{
if (totalWeight <= 0)
{
throw new IllegalArgumentException();
}
else
{
Iterator iterator = weightedBiomes.iterator();
BiomeEntry biomeEntry;
do
{
if (!iterator.hasNext())
{
return null;
}
biomeEntry = (BiomeEntry)iterator.next();
seedRandom -= biomeEntry.itemWeight;
}
while (seedRandom >= 0);
return biomeEntry;
}
}
public static class BiomeEntry extends WeightedRandom.Item
{
public BiomeGenBase biome;
public TemperatureType temperatureType;
public BiomeEntry(BiomeGenBase biome, TemperatureType temperatureType, int weight)
{
super(weight);
this.biome = biome;
this.temperatureType = temperatureType;
}
public BiomeEntry(BiomeGenBase biome, int weight)
{
this(biome, TemperatureType.WARM, weight);
}
public void addToCorrespondingTemperatureTypeList()
{
BOPBiomeHelper.getCorrespondingTemperatureTypeList(temperatureType).add(this);
}
}
}

View file

@ -3,16 +3,42 @@ package biomesoplenty.common.world;
import java.util.List;
import java.util.Random;
import cpw.mods.fml.common.ObfuscationReflectionHelper;
import biomesoplenty.common.configuration.BOPConfigurationMisc;
import biomesoplenty.common.world.layer.GenLayerBOP;
import net.minecraft.world.ChunkPosition;
import net.minecraft.world.World;
import net.minecraft.world.WorldType;
import net.minecraft.world.biome.WorldChunkManager;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.GenLayerAddIsland;
import net.minecraft.world.gen.layer.GenLayerAddMushroomIsland;
import net.minecraft.world.gen.layer.GenLayerAddSnow;
import net.minecraft.world.gen.layer.GenLayerDeepOcean;
import net.minecraft.world.gen.layer.GenLayerEdge;
import net.minecraft.world.gen.layer.GenLayerFuzzyZoom;
import net.minecraft.world.gen.layer.GenLayerHills;
import net.minecraft.world.gen.layer.GenLayerIsland;
import net.minecraft.world.gen.layer.GenLayerRareBiome;
import net.minecraft.world.gen.layer.GenLayerRemoveTooMuchOcean;
import net.minecraft.world.gen.layer.GenLayerRiver;
import net.minecraft.world.gen.layer.GenLayerRiverInit;
import net.minecraft.world.gen.layer.GenLayerRiverMix;
import net.minecraft.world.gen.layer.GenLayerShore;
import net.minecraft.world.gen.layer.GenLayerSmooth;
import net.minecraft.world.gen.layer.GenLayerVoronoiZoom;
import net.minecraft.world.gen.layer.GenLayerZoom;
public class WorldChunkManagerBOP extends WorldChunkManager
{
public WorldChunkManagerBOP(World world)
{
super(world);
super();
GenLayer[] agenlayer = GenLayerBOP.initializeAllBiomeGenerators(world.getSeed(), world.getWorldInfo().getTerrainType());
agenlayer = getModdedBiomeGenerators(world.getWorldInfo().getTerrainType(), world.getSeed(), agenlayer);
ObfuscationReflectionHelper.setPrivateValue(WorldChunkManager.class, this, agenlayer[0], "genBiomes", "field_76944_d");
ObfuscationReflectionHelper.setPrivateValue(WorldChunkManager.class, this, agenlayer[1], "biomeIndexLayer", "field_76945_e");
}
@Override

View file

@ -0,0 +1,98 @@
package biomesoplenty.common.world.layer;
import net.minecraft.world.WorldType;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.GenLayerAddIsland;
import net.minecraft.world.gen.layer.GenLayerAddMushroomIsland;
import net.minecraft.world.gen.layer.GenLayerAddSnow;
import net.minecraft.world.gen.layer.GenLayerDeepOcean;
import net.minecraft.world.gen.layer.GenLayerEdge;
import net.minecraft.world.gen.layer.GenLayerFuzzyZoom;
import net.minecraft.world.gen.layer.GenLayerHills;
import net.minecraft.world.gen.layer.GenLayerIsland;
import net.minecraft.world.gen.layer.GenLayerRareBiome;
import net.minecraft.world.gen.layer.GenLayerRemoveTooMuchOcean;
import net.minecraft.world.gen.layer.GenLayerRiver;
import net.minecraft.world.gen.layer.GenLayerRiverInit;
import net.minecraft.world.gen.layer.GenLayerRiverMix;
import net.minecraft.world.gen.layer.GenLayerShore;
import net.minecraft.world.gen.layer.GenLayerSmooth;
import net.minecraft.world.gen.layer.GenLayerVoronoiZoom;
import net.minecraft.world.gen.layer.GenLayerZoom;
public abstract class GenLayerBOP extends GenLayer
{
public GenLayerBOP(long par1)
{
super(par1);
}
public static GenLayer[] initializeAllBiomeGenerators(long seed, WorldType par2WorldType)
{
boolean flag = false;
GenLayerIsland genlayerisland = new GenLayerIsland(1L);
GenLayerFuzzyZoom genlayerfuzzyzoom = new GenLayerFuzzyZoom(2000L, genlayerisland);
GenLayerAddIsland genlayeraddisland = new GenLayerAddIsland(1L, genlayerfuzzyzoom);
GenLayerZoom genlayerzoom = new GenLayerZoom(2001L, genlayeraddisland);
genlayeraddisland = new GenLayerAddIsland(2L, genlayerzoom);
genlayeraddisland = new GenLayerAddIsland(50L, genlayeraddisland);
genlayeraddisland = new GenLayerAddIsland(70L, genlayeraddisland);
GenLayerRemoveTooMuchOcean genlayerremovetoomuchocean = new GenLayerRemoveTooMuchOcean(2L, genlayeraddisland);
GenLayerAddSnow genlayeraddsnow = new GenLayerAddSnow(2L, genlayerremovetoomuchocean);
genlayeraddisland = new GenLayerAddIsland(3L, genlayeraddsnow);
GenLayerEdge genlayeredge = new GenLayerEdge(2L, genlayeraddisland, GenLayerEdge.Mode.COOL_WARM);
genlayeredge = new GenLayerEdge(2L, genlayeredge, GenLayerEdge.Mode.HEAT_ICE);
genlayeredge = new GenLayerEdge(3L, genlayeredge, GenLayerEdge.Mode.SPECIAL);
genlayerzoom = new GenLayerZoom(2002L, genlayeredge);
genlayerzoom = new GenLayerZoom(2003L, genlayerzoom);
genlayeraddisland = new GenLayerAddIsland(4L, genlayerzoom);
GenLayerAddMushroomIsland genlayeraddmushroomisland = new GenLayerAddMushroomIsland(5L, genlayeraddisland);
GenLayerDeepOcean genlayerdeepocean = new GenLayerDeepOcean(4L, genlayeraddmushroomisland);
GenLayer genlayer2 = GenLayerZoom.magnify(1000L, genlayerdeepocean, 0);
byte b0 = 4;
if (flag)
{
b0 = 4;
}
b0 = getModdedBiomeSize(par2WorldType, b0);
GenLayer genlayer = GenLayerZoom.magnify(1000L, genlayer2, 0);
GenLayerRiverInit genlayerriverinit = new GenLayerRiverInit(100L, genlayer);
Object object = par2WorldType.getBiomeLayer(seed, genlayer2);
GenLayer genlayer1 = GenLayerZoom.magnify(1000L, genlayerriverinit, 2);
GenLayerHills genlayerhills = new GenLayerHills(1000L, (GenLayer)object, genlayer1);
//
//GenLayerSubBiome genlayersubbiome = new GenLayerSubBiome(1500L, genlayerhills);
//
genlayer = GenLayerZoom.magnify(1000L, genlayerriverinit, 2);
genlayer = GenLayerZoom.magnify(1000L, genlayer, b0);
GenLayerRiver genlayerriver = new GenLayerRiver(1L, genlayer);
GenLayerSmooth genlayersmooth = new GenLayerSmooth(1000L, genlayerriver);
//object = new GenLayerRareBiome(1001L, genlayerhills);
object = new GenLayerRareBiome(1001L, genlayerhills);
for (int j = 0; j < b0; ++j)
{
object = new GenLayerZoom((long)(1000 + j), (GenLayer)object);
if (j == 0)
{
object = new GenLayerAddIsland(3L, (GenLayer)object);
}
if (j == 1)
{
object = new GenLayerShore(1000L, (GenLayer)object);
}
}
GenLayerSmooth genlayersmooth1 = new GenLayerSmooth(1000L, (GenLayer)object);
GenLayerRiverMix genlayerrivermix = new GenLayerRiverMix(100L, genlayersmooth1, genlayersmooth);
GenLayerVoronoiZoom genlayervoronoizoom = new GenLayerVoronoiZoom(10L, genlayerrivermix);
genlayerrivermix.initWorldGenSeed(seed);
genlayervoronoizoom.initWorldGenSeed(seed);
return new GenLayer[] {genlayerrivermix, genlayervoronoizoom, genlayerrivermix};
}
}

View file

@ -9,29 +9,23 @@ import net.minecraft.world.biome.BiomeGenBase;
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.TemperatureType;
import biomesoplenty.api.BOPBiomeManager;
import biomesoplenty.api.BOPBiomeManager.BiomeEntry;
import biomesoplenty.common.configuration.BOPConfigurationBiomeGen;
import biomesoplenty.common.configuration.BOPConfigurationMain;
import biomesoplenty.common.utils.BOPLogger;
import biomesoplenty.common.world.BOPBiomeManager;
import biomesoplenty.common.world.BOPBiomeManager.BiomeEntry;
import cpw.mods.fml.common.ObfuscationReflectionHelper;
public class GenLayerBiomeBOP extends GenLayerBiome
{
public List<BiomeEntry> desertBiomes = new ArrayList<BiomeEntry>();
public List<BiomeEntry> warmBiomes = new ArrayList<BiomeEntry>();
public List<BiomeEntry> coolBiomes = new ArrayList<BiomeEntry>();
public List<BiomeEntry> icyBiomes = new ArrayList<BiomeEntry>();
//Desert, Warm, Cool, Icy
public List<BiomeEntry>[] biomeLists = new ArrayList[] { new ArrayList(), new ArrayList(), new ArrayList(), new ArrayList() };
public GenLayerBiomeBOP(long seed, GenLayer parentLayer, WorldType worldType)
{
super(seed, parentLayer, worldType);
this.desertBiomes.addAll(BOPBiomeManager.desertBiomes);
this.warmBiomes.addAll(BOPBiomeManager.warmBiomes);
this.coolBiomes.addAll(BOPBiomeManager.coolBiomes);
this.icyBiomes.addAll(BOPBiomeManager.icyBiomes);
this.biomeLists[0].addAll(BOPBiomeManager.overworldBiomes[0]);
this.biomeLists[1].addAll(BOPBiomeManager.overworldBiomes[1]);
this.biomeLists[2].addAll(BOPBiomeManager.overworldBiomes[2]);
this.biomeLists[3].addAll(BOPBiomeManager.overworldBiomes[3]);
}
@ -50,7 +44,7 @@ public class GenLayerBiomeBOP extends GenLayerBiome
// 111100000000
int l1 = (currentBiomeID & 3840) >> 8;
currentBiomeID &= -3841;
if (isBiomeOceanic(currentBiomeID))
{
outputBiomeIDs[j1 + i1 * width] = currentBiomeID;
@ -71,10 +65,14 @@ public class GenLayerBiomeBOP extends GenLayerBiome
{
outputBiomeIDs[j1 + i1 * width] = BiomeGenBase.mesaPlateau_F.biomeID;
}
else
{
outputBiomeIDs[j1 + i1 * width] = getBiomeIdFromList(0);
}
}
else
{
outputBiomeIDs[j1 + i1 * width] = BOPBiomeManager.getWeightedRandomBiome(desertBiomes, this.nextInt(WeightedRandom.getTotalWeight(desertBiomes))).biome.biomeID;
outputBiomeIDs[j1 + i1 * width] = getBiomeIdFromList(0);
}
}
else if (currentBiomeID == 2)
@ -85,7 +83,7 @@ public class GenLayerBiomeBOP extends GenLayerBiome
}
else
{
outputBiomeIDs[j1 + i1 * width] = BOPBiomeManager.getWeightedRandomBiome(warmBiomes, this.nextInt(WeightedRandom.getTotalWeight(warmBiomes))).biome.biomeID;
outputBiomeIDs[j1 + i1 * width] = getBiomeIdFromList(1);
}
}
else if (currentBiomeID == 3)
@ -96,14 +94,14 @@ public class GenLayerBiomeBOP extends GenLayerBiome
}
else
{
outputBiomeIDs[j1 + i1 * width] = BOPBiomeManager.getWeightedRandomBiome(coolBiomes, this.nextInt(WeightedRandom.getTotalWeight(coolBiomes))).biome.biomeID;
outputBiomeIDs[j1 + i1 * width] = getBiomeIdFromList(2);
}
}
else if (currentBiomeID == 4)
{
outputBiomeIDs[j1 + i1 * width] = BOPBiomeManager.getWeightedRandomBiome(icyBiomes, this.nextInt(WeightedRandom.getTotalWeight(icyBiomes))).biome.biomeID;
outputBiomeIDs[j1 + i1 * width] = getBiomeIdFromList(3);
}
else if (BOPConfigurationBiomeGen.mushroomIslandGen)
else
{
outputBiomeIDs[j1 + i1 * width] = BiomeGenBase.mushroomIsland.biomeID;
}
@ -112,4 +110,35 @@ public class GenLayerBiomeBOP extends GenLayerBiome
return outputBiomeIDs;
}
private int getBiomeIdFromList(int listId)
{
if (!this.biomeLists[listId].isEmpty())
{
return getWeightedBiomeFromList(this.biomeLists[listId]);
}
else
{
List<BiomeEntry> mixedBiomeList = new ArrayList();
for (int i = 0; i < 4; i++)
{
if (i != listId && !this.biomeLists[i].isEmpty()) mixedBiomeList.addAll(this.biomeLists[i]);
}
if (!mixedBiomeList.isEmpty())
{
return getWeightedBiomeFromList(mixedBiomeList);
}
else
{
throw new RuntimeException("No biomes are enabled!");
}
}
}
private int getWeightedBiomeFromList(List<BiomeEntry> biomeList)
{
return ((BiomeEntry)WeightedRandom.getItem(biomeList, this.nextInt(WeightedRandom.getTotalWeight(biomeList)))).biome.biomeID;
}
}

View file

@ -0,0 +1,66 @@
package biomesoplenty.common.world.layer;
import java.util.ArrayList;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.IntCache;
import biomesoplenty.common.biomes.BOPSubBiome;
public class GenLayerSubBiome extends GenLayer
{
private static ArrayList<BOPSubBiome>[] subBiomes = new ArrayList[BiomeGenBase.getBiomeGenArray().length];
public GenLayerSubBiome(long seed, GenLayer parent)
{
super(seed);
this.parent = parent;
}
@Override
public int[] getInts(int x, int z, int width, int length)
{
int[] inputBiomeIDs = this.parent.getInts(x - 1, z - 1, width + 2, length + 2);
int[] outputBiomeIDs = IntCache.getIntCache(width * length);
/*for (int xi = 0; xi < width; ++xi)
{
for (int zi = 0; zi < length; ++zi)
{
this.initChunkSeed(xi + x, zi + z);
int currentBiomeId = inputBiomeIDs[xi + 1 + (zi + 1) * (width + 2)];
ArrayList<BOPSubBiome> currentSubBiomes = subBiomes[currentBiomeId];
BOPSubBiome selectedSubBiome = currentSubBiomes != null ? currentSubBiomes.get(this.nextInt(currentSubBiomes.size())) : null;
if (selectedSubBiome != null)
{
if (SimplexNoise.noise((xi + x) * selectedSubBiome.getZoom(), (zi + z) * selectedSubBiome.getZoom()) > selectedSubBiome.getThreshold())
{
System.out.println(SimplexNoise.noise((xi + x) * selectedSubBiome.getZoom(), (zi + z) * selectedSubBiome.getZoom()));
System.out.printf("Replaced Biome at %d, %d\n", xi + x, zi + z);
outputBiomeIDs[xi + zi * width] = selectedSubBiome.biomeID;
}
else outputBiomeIDs[xi + zi * width] = currentBiomeId;
}
else
{
outputBiomeIDs[xi + zi * width] = currentBiomeId;
}
}
}*/
return outputBiomeIDs;
}
public static void registerSubBiome(BOPSubBiome subBiome, int... parents)
{
for (int parent : parents)
{
if (subBiomes[parent] == null) subBiomes[parent] = new ArrayList();
subBiomes[parent].add(subBiome);
}
}
}

View file

@ -5,7 +5,7 @@ import java.util.ArrayList;
import net.minecraft.world.WorldType;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.layer.IntCache;
import biomesoplenty.api.BOPBiomeHelper;
import biomesoplenty.api.BOPBiomeManager;
public class BiomeLayerHellBiomes extends BiomeLayerHell
{

View file

@ -1,65 +0,0 @@
package biomesoplenty.common.world.noise;
import java.util.Random;
import net.minecraft.world.gen.NoiseGenerator;
public class NoiseOctaves extends NoiseGenerator
{
private NoisePerlin generatorCollection[];
private int octaves;
public NoiseOctaves(Random random, int i)
{
octaves = i;
generatorCollection = new NoisePerlin[i];
for (int j = 0; j < i; j++)
{
generatorCollection[j] = new NoisePerlin(random);
}
}
public double func_806_a(double d, double d1)
{
double d2 = 0.0D;
double d3 = 1.0D;
for (int i = 0; i < octaves; i++)
{
d2 += generatorCollection[i].func_801_a(d * d3, d1 * d3) / d3;
d3 /= 2D;
}
return d2;
}
public double[] generateNoiseOctaves(double ad[], double d, double d1, double d2,
int i, int j, int k, double d3, double d4,
double d5)
{
if (ad == null)
{
ad = new double[i * j * k];
}
else
{
for (int l = 0; l < ad.length; l++)
{
ad[l] = 0.0D;
}
}
double d6 = 1.0D;
for (int i1 = 0; i1 < octaves; i1++)
{
generatorCollection[i1].func_805_a(ad, d, d1, d2, i, j, k, d3 * d6, d4 * d6, d5 * d6, d6);
d6 /= 2D;
}
return ad;
}
public double[] generateNoiseOctaves(double ad[], int i, int j, int k, int l, double d,
double d1, double d2)
{
return generateNoiseOctaves(ad, i, 10D, j, k, 1, l, d, 1.0D, d1);
}
}

View file

@ -1,222 +0,0 @@
package biomesoplenty.common.world.noise;
import java.util.Random;
import net.minecraft.world.gen.NoiseGenerator;
public class NoisePerlin extends NoiseGenerator
{
public NoisePerlin()
{
this(new Random());
}
public NoisePerlin(Random random)
{
permutations = new int[512];
xCoord = random.nextDouble() * 256D;
yCoord = random.nextDouble() * 256D;
zCoord = random.nextDouble() * 256D;
for (int i = 0; i < 256; i++)
{
permutations[i] = i;
}
for (int j = 0; j < 256; j++)
{
int k = random.nextInt(256 - j) + j;
int l = permutations[j];
permutations[j] = permutations[k];
permutations[k] = l;
permutations[j + 256] = permutations[j];
}
}
public double generateNoise(double d, double d1, double d2)
{
double d3 = d + xCoord;
double d4 = d1 + yCoord;
double d5 = d2 + zCoord;
int i = (int)d3;
int j = (int)d4;
int k = (int)d5;
if (d3 < i)
{
i--;
}
if (d4 < j)
{
j--;
}
if (d5 < k)
{
k--;
}
int l = i & 0xff;
int i1 = j & 0xff;
int j1 = k & 0xff;
d3 -= i;
d4 -= j;
d5 -= k;
double d6 = d3 * d3 * d3 * (d3 * (d3 * 6D - 15D) + 10D);
double d7 = d4 * d4 * d4 * (d4 * (d4 * 6D - 15D) + 10D);
double d8 = d5 * d5 * d5 * (d5 * (d5 * 6D - 15D) + 10D);
int k1 = permutations[l] + i1;
int l1 = permutations[k1] + j1;
int i2 = permutations[k1 + 1] + j1;
int j2 = permutations[l + 1] + i1;
int k2 = permutations[j2] + j1;
int l2 = permutations[j2 + 1] + j1;
return lerp(d8, lerp(d7, lerp(d6, grad(permutations[l1], d3, d4, d5), grad(permutations[k2], d3 - 1.0D, d4, d5)), lerp(d6, grad(permutations[i2], d3, d4 - 1.0D, d5), grad(permutations[l2], d3 - 1.0D, d4 - 1.0D, d5))), lerp(d7, lerp(d6, grad(permutations[l1 + 1], d3, d4, d5 - 1.0D), grad(permutations[k2 + 1], d3 - 1.0D, d4, d5 - 1.0D)), lerp(d6, grad(permutations[i2 + 1], d3, d4 - 1.0D, d5 - 1.0D), grad(permutations[l2 + 1], d3 - 1.0D, d4 - 1.0D, d5 - 1.0D))));
}
public final double lerp(double d, double d1, double d2)
{
return d1 + d * (d2 - d1);
}
public final double func_4110_a(int i, double d, double d1)
{
int j = i & 0xf;
double d2 = (1 - ((j & 8) >> 3)) * d;
double d3 = j >= 4 ? j != 12 && j != 14 ? d1 : d : 0.0D;
return ((j & 1) != 0 ? -d2 : d2) + ((j & 2) != 0 ? -d3 : d3);
}
public final double grad(int i, double d, double d1, double d2)
{
int j = i & 0xf;
double d3 = j >= 8 ? d1 : d;
double d4 = j >= 4 ? j != 12 && j != 14 ? d2 : d : d1;
return ((j & 1) != 0 ? -d3 : d3) + ((j & 2) != 0 ? -d4 : d4);
}
public double func_801_a(double d, double d1)
{
return generateNoise(d, d1, 0.0D);
}
public void func_805_a(double ad[], double d, double d1, double d2,
int i, int j, int k, double d3, double d4,
double d5, double d6)
{
if(j == 1)
{
boolean flag = false;
boolean flag1 = false;
boolean flag2 = false;
boolean flag3 = false;
double d8 = 0.0D;
double d10 = 0.0D;
int j3 = 0;
double d12 = 1.0D / d6;
for(int i4 = 0; i4 < i; i4++)
{
double d14 = (d + i4) * d3 + xCoord;
int j4 = (int)d14;
if(d14 < j4)
{
j4--;
}
int k4 = j4 & 0xff;
d14 -= j4;
double d17 = d14 * d14 * d14 * (d14 * (d14 * 6D - 15D) + 10D);
for(int l4 = 0; l4 < k; l4++)
{
double d19 = (d2 + l4) * d5 + zCoord;
int j5 = (int)d19;
if(d19 < j5)
{
j5--;
}
int l5 = j5 & 0xff;
d19 -= j5;
double d21 = d19 * d19 * d19 * (d19 * (d19 * 6D - 15D) + 10D);
int l = permutations[k4] + 0; ///bwg4 made by ted80
int j1 = permutations[l] + l5;
int k1 = permutations[k4 + 1] + 0;
int l1 = permutations[k1] + l5;
double d9 = lerp(d17, func_4110_a(permutations[j1], d14, d19), grad(permutations[l1], d14 - 1.0D, 0.0D, d19));
double d11 = lerp(d17, grad(permutations[j1 + 1], d14, 0.0D, d19 - 1.0D), grad(permutations[l1 + 1], d14 - 1.0D, 0.0D, d19 - 1.0D));
double d23 = lerp(d21, d9, d11);
ad[j3++] += d23 * d12;
}
}
return;
}
int i1 = 0;
double d7 = 1.0D / d6;
int i2 = -1;
boolean flag4 = false;
boolean flag5 = false;
boolean flag6 = false;
boolean flag7 = false;
boolean flag8 = false;
boolean flag9 = false;
double d13 = 0.0D;
double d15 = 0.0D;
double d16 = 0.0D;
double d18 = 0.0D;
for(int i5 = 0; i5 < i; i5++)
{
double d20 = (d + i5) * d3 + xCoord;
int k5 = (int)d20;
if(d20 < k5)
{
k5--;
}
int i6 = k5 & 0xff;
d20 -= k5;
double d22 = d20 * d20 * d20 * (d20 * (d20 * 6D - 15D) + 10D);
for(int j6 = 0; j6 < k; j6++)
{
double d24 = (d2 + j6) * d5 + zCoord;
int k6 = (int)d24;
if(d24 < k6)
{
k6--;
}
int l6 = k6 & 0xff;
d24 -= k6;
double d25 = d24 * d24 * d24 * (d24 * (d24 * 6D - 15D) + 10D);
for(int i7 = 0; i7 < j; i7++)
{
double d26 = (d1 + i7) * d4 + yCoord;
int j7 = (int)d26;
if(d26 < j7)
{
j7--;
}
int k7 = j7 & 0xff;
d26 -= j7;
double d27 = d26 * d26 * d26 * (d26 * (d26 * 6D - 15D) + 10D);
if(i7 == 0 || k7 != i2)
{
i2 = k7;
int j2 = permutations[i6] + k7;
int k2 = permutations[j2] + l6;
int l2 = permutations[j2 + 1] + l6;
int i3 = permutations[i6 + 1] + k7;
int k3 = permutations[i3] + l6;
int l3 = permutations[i3 + 1] + l6;
d13 = lerp(d22, grad(permutations[k2], d20, d26, d24), grad(permutations[k3], d20 - 1.0D, d26, d24));
d15 = lerp(d22, grad(permutations[l2], d20, d26 - 1.0D, d24), grad(permutations[l3], d20 - 1.0D, d26 - 1.0D, d24));
d16 = lerp(d22, grad(permutations[k2 + 1], d20, d26, d24 - 1.0D), grad(permutations[k3 + 1], d20 - 1.0D, d26, d24 - 1.0D));
d18 = lerp(d22, grad(permutations[l2 + 1], d20, d26 - 1.0D, d24 - 1.0D), grad(permutations[l3 + 1], d20 - 1.0D, d26 - 1.0D, d24 - 1.0D));
}
double d28 = lerp(d27, d13, d15);
double d29 = lerp(d27, d16, d18);
double d30 = lerp(d25, d28, d29);
ad[i1++] += d30 * d7;
}
}
}
}
private int permutations[];
public double xCoord;
public double yCoord;
public double zCoord;
}

View file

@ -6,8 +6,8 @@
"mcversion": "${minecraft_version}",
"url": "www.minecraftforum.net/topic/1495041-",
"updateUrl": "",
"authors": ["Forstride", "Adubbz", "Amnet", "ted80"],
"credits": "gamax92, enchilado, Tim Rurkowski, Soaryn",
"authors": ["Adubbz", "Amnet", "Forstride", "ted80"],
"credits": "enchilado, gamax92, Soaryn, Tim Rurkowski",
"logoFile": "assets/biomesoplenty/textures/gui/logo.png",
"screenshots": [],
"parent": "",