Readded stronghold biomes, and made them configurable

This commit is contained in:
Adubbz 2014-01-16 18:51:31 +11:00
parent 2eb03d3705
commit 923c15daea
6 changed files with 155 additions and 273 deletions

View file

@ -3,6 +3,7 @@ package biomesoplenty;
import net.minecraft.creativetab.CreativeTabs;
import biomesoplenty.common.configuration.BOPConfiguration;
import biomesoplenty.common.configuration.BOPConfigurationWorldFeatures;
import biomesoplenty.common.configuration.structures.BOPConfigurationStrongholds;
import biomesoplenty.common.configuration.structures.BOPConfigurationVillages;
import biomesoplenty.common.core.BOPArmor;
import biomesoplenty.common.core.BOPBiomes;
@ -56,6 +57,7 @@ public class BiomesOPlenty
BOPCrafting.init();
BOPBiomes.init();
BOPConfigurationVillages.init(BOPConfiguration.villagesConfigFile);
BOPConfigurationStrongholds.init(BOPConfiguration.strongholdsConfigFile);
WorldGenFieldAssociation.init();
BOPConfigurationWorldFeatures.init(BOPConfiguration.worldFeaturesConfigFile);
ForcedBOPWorldGenerators.init();

View file

@ -9,6 +9,7 @@ public class BOPConfiguration
public static File biomeGenConfigFile;
public static File terrainGenConfigFile;
public static File villagesConfigFile;
public static File strongholdsConfigFile;
public static File idConfigFile;
public static File miscConfigFile;
@ -19,6 +20,7 @@ public class BOPConfiguration
biomeGenConfigFile = new File(configpath + "biomegen.cfg");
terrainGenConfigFile = new File(configpath + "terraingen.cfg");
villagesConfigFile = new File(configpath + "structures/villages.cfg");
strongholdsConfigFile = new File(configpath + "structures/strongholds.cfg");
idConfigFile = new File(configpath + "ids.cfg");
miscConfigFile = new File(configpath + "misc.cfg");

View file

@ -18,94 +18,7 @@ public class BOPConfigurationTerrainGen
public static boolean vanillaEnhanced;
public static boolean netherOverride;
public static int villageDistance;
public static int landmassPercentage;
// Village biomes
public static boolean alpsVillage;
public static boolean arcticVillage;
public static boolean autumnHillsVillage;
public static boolean badlandsVillage;
public static boolean bambooForestVillage;
public static boolean bayouVillage;
public static boolean birchForestVillage;
public static boolean bogVillage;
public static boolean borealForestVillage;
public static boolean brushlandVillage;
public static boolean canyonVillage;
public static boolean chaparralVillage;
public static boolean cherryBlossomGroveVillage;
public static boolean coniferousForestVillage;
public static boolean snowyConiferousForest;
public static boolean cragVillage;
public static boolean deadForestVillage;
public static boolean deadForestSnowVillage;
public static boolean deadSwampVillage;
public static boolean deadlandsVillage;
public static boolean deciduousForestVillage;
public static boolean dunesVillage;
public static boolean fenVillage;
public static boolean flowerField;
public static boolean frostForestVillage;
public static boolean fungiForestVillage;
public static boolean gardenVillage;
public static boolean glacierVillage;
public static boolean grasslandVillage;
public static boolean groveVillage;
public static boolean heathlandVillage;
public static boolean highlandVillage;
public static boolean hotSpringsVillage;
public static boolean icyHillsVillage;
public static boolean jadeCliffsVillage;
public static boolean lushDesertVillage;
public static boolean lushSwampVillage;
public static boolean mangroveVillage;
public static boolean mapleWoodsVillage;
public static boolean marshVillage;
public static boolean meadowVillage;
public static boolean mesaVillage;
public static boolean moorVillage;
public static boolean mountainVillage;
public static boolean mysticGroveVillage;
public static boolean oasisVillage;
public static boolean ominousWoodsVillage;
public static boolean orchardVillage;
public static boolean originValleyVillage;
public static boolean outbackVillage;
public static boolean overgrownGreensVillage;
public static boolean pastureVillage;
public static boolean polarVillage;
public static boolean prairieVillage;
public static boolean quagmireVillage;
public static boolean rainforestVillage;
public static boolean redwoodForestVillage;
public static boolean sacredSpringsVillage;
public static boolean savannaVillage;
public static boolean scrublandVillage;
public static boolean seasonalForestVillage;
public static boolean shieldVillage;
public static boolean shrublandVillage;
public static boolean silkgladesVillage;
public static boolean sludgepitVillage;
public static boolean spruceWoodsVillage;
public static boolean steppeVillage;
public static boolean temperateRainforestVillage;
public static boolean thicketVillage;
public static boolean timberVillage;
public static boolean tropicalRainforestVillage;
public static boolean tropicsVillage;
public static boolean tundraVillage;
public static boolean volcanoVillage;
public static boolean wastelandVillage;
public static boolean wetlandVillage;
public static boolean woodlandVillage;
public static boolean plainsVillage;
public static boolean desertVillage;
public static boolean extremeHillsVillage;
public static boolean forestVillage;
public static boolean taigaVillage;
public static boolean swamplandVillage;
public static boolean jungleVillage;
public static void init(File configFile)
{
@ -120,98 +33,7 @@ public class BOPConfigurationTerrainGen
vanillaEnhanced = config.get("Biome Settings", "Enhanced Vanilla Biomes", true).getBoolean(false);
netherOverride = config.get("Dimension Settings", "Enable Nether Override", true).getBoolean(true);
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;
landmassPercentage = config.get("Biomes O\' Plenty World Type Settings", "Landmass Percentage", 10, "In Vanilla it is set to 10. Takes values from 0 to 100.").getInt();
// Biomes with villages
alpsVillage = config.get("Allow Villages", "Alps", false).getBoolean(false);
arcticVillage = config.get("Allow Villages", "Arctic", true).getBoolean(false);
autumnHillsVillage = config.get("Allow Villages", "AutumnHills", false).getBoolean(false);
badlandsVillage = config.get("Allow Villages", "Badlands", false).getBoolean(false);
bambooForestVillage = config.get("Allow Villages", "BambooForest", false).getBoolean(false);
bayouVillage = config.get("Allow Villages", "Bayou", false).getBoolean(false);
birchForestVillage = config.get("Allow Villages", "BirchForest", true).getBoolean(false);
bogVillage = config.get("Allow Villages", "Bog", false).getBoolean(false);
borealForestVillage = config.get("Allow Villages", "BorealForest", false).getBoolean(false);
brushlandVillage = config.get("Allow Villages", "Brushland", true).getBoolean(false);
canyonVillage = config.get("Allow Villages", "Canyon", false).getBoolean(false);
chaparralVillage = config.get("Allow Villages", "Chaparral", true).getBoolean(false);
cherryBlossomGroveVillage = config.get("Allow Villages", "CherryBlossomGrove", false).getBoolean(false);
coniferousForestVillage = config.get("Allow Villages", "ConiferousForest", true).getBoolean(false);
snowyConiferousForest = config.get("Allow Villages", "SnowyConiferousForest", true).getBoolean(false);
//cragVillage = config.get("Allow Villages", "Crag", false).getBoolean(false);
deadForestVillage = config.get("Allow Villages", "DeadForest", false).getBoolean(false);
deadForestSnowVillage = config.get("Allow Villages", "DeadForestSnow", false).getBoolean(false);
deadSwampVillage = config.get("Allow Villages", "DeadSwamp", false).getBoolean(false);
//deadlandsVillage = config.get("Allow Villages", "Deadlands", false).getBoolean(false);
deciduousForestVillage = config.get("Allow Villages", "DeciduousForest", true).getBoolean(false);
dunesVillage = config.get("Allow Villages", "Dunes", false).getBoolean(false);
fenVillage = config.get("Allow Villages", "Fen", false).getBoolean(false);
flowerField = config.get("Allow Villages", "FlowerField", true).getBoolean(false);
frostForestVillage = config.get("Allow Villages", "FrostForest", true).getBoolean(false);
//fungiForestVillage = config.get("Allow Villages", "FungiForest", false).getBoolean(false);
//gardenVillage = config.get("Allow Villages", "Garden", false).getBoolean(false);
glacierVillage = config.get("Allow Villages", "Glacier", false).getBoolean(false);
grasslandVillage = config.get("Allow Villages", "Grassland", true).getBoolean(false);
groveVillage = config.get("Allow Villages", "Grove", true).getBoolean(false);
heathlandVillage = config.get("Allow Villages", "Heathland", true).getBoolean(false);
highlandVillage = config.get("Allow Villages", "Highland", false).getBoolean(false);
hotSpringsVillage = config.get("Allow Villages", "HotSprings", false).getBoolean(false);
//icyHillsVillage = config.get("Allow Villages", "IcyHills", false).getBoolean(false);
jadeCliffsVillage = config.get("Allow Villages", "JadeCliffs", false).getBoolean(false);
lushDesertVillage = config.get("Allow Villages", "LushDesert", true).getBoolean(false);
lushSwampVillage = config.get("Allow Villages", "LushSwamp", true).getBoolean(false);
mangroveVillage = config.get("Allow Villages", "Mangrove", false).getBoolean(false);
mapleWoodsVillage = config.get("Allow Villages", "MapleWoods", true).getBoolean(false);
marshVillage = config.get("Allow Villages", "Marsh", false).getBoolean(false);
meadowVillage = config.get("Allow Villages", "Meadow", true).getBoolean(false);
mesaVillage = config.get("Allow Villages", "Mesa", false).getBoolean(false);
moorVillage = config.get("Allow Villages", "Moor", false).getBoolean(false);
mountainVillage = config.get("Allow Villages", "Mountain", false).getBoolean(false);
//mysticGroveVillage = config.get("Allow Villages", "MysticGrove", false).getBoolean(false);
oasisVillage = config.get("Allow Villages", "Oasis", false).getBoolean(false);
//ominousWoodsVillage = config.get("Allow Villages", "OminousWoods", false).getBoolean(false);
orchardVillage = config.get("Allow Villages", "Orchard", false).getBoolean(false);
//originValleyVillage = config.get("Allow Villages", "OriginValley", false).getBoolean(false);
outbackVillage = config.get("Allow Villages", "Outback", true).getBoolean(false);
overgrownGreensVillage = config.get("Allow Villages", "OvergrownGreens", true).getBoolean(false);
pastureVillage = config.get("Allow Villages", "Pasture", false).getBoolean(false);
polarVillage = config.get("Allow Villages", "Polar", false).getBoolean(false);
prairieVillage = config.get("Allow Villages", "Prairie", true).getBoolean(false);
quagmireVillage = config.get("Allow Villages", "Quagmire", false).getBoolean(false);
rainforestVillage = config.get("Allow Villages", "Rainforest", false).getBoolean(false);
redwoodForestVillage = config.get("Allow Villages", "RedwoodForest", false).getBoolean(false);
//sacredSpringsVillage = config.get("Allow Villages", "SacredSprings", false).getBoolean(false);
savannaVillage = config.get("Allow Villages", "Savanna", true).getBoolean(false);
scrublandVillage = config.get("Allow Villages", "Scrubland", true).getBoolean(false);
seasonalForestVillage = config.get("Allow Villages", "SeasonalForest", false).getBoolean(false);
shieldVillage = config.get("Allow Villages", "Shield", false).getBoolean(false);
shrublandVillage = config.get("Allow Villages", "Shrubland", true).getBoolean(false);
//silkgladesVillage = config.get("Allow Villages", "Silkgladess", false).getBoolean(false);
sludgepitVillage = config.get("Allow Villages", "Sludgepit", false).getBoolean(false);
spruceWoodsVillage = config.get("Allow Villages", "SpruceWoods", true).getBoolean(false);
steppeVillage = config.get("Allow Villages", "Steppe", true).getBoolean(false);
temperateRainforestVillage = config.get("Allow Villages", "TemperateRainforest", false).getBoolean(false);
thicketVillage = config.get("Allow Villages", "Thicket", false).getBoolean(false);
timberVillage = config.get("Allow Villages", "Timber", true).getBoolean(false);
tropicalRainforestVillage = config.get("Allow Villages", "TropicalRainforest", true).getBoolean(false);
tropicsVillage = config.get("Allow Villages", "Tropics", false).getBoolean(false);
tundraVillage = config.get("Allow Villages", "Tundra", true).getBoolean(false);
volcanoVillage = config.get("Allow Villages", "Volcano", false).getBoolean(false);
//wastelandVillage = config.get("Allow Villages", "Wasteland", false).getBoolean(false);
wetlandVillage = config.get("Allow Villages", "Wetland", true).getBoolean(false);
woodlandVillage = config.get("Allow Villages", "Woodland", true).getBoolean(false);
// Vanilla biomes
desertVillage = config.get("Allow Villages", "Desert", true).getBoolean(true);
extremeHillsVillage = config.get("Allow Villages", "ExtremeHills", false).getBoolean(false);
forestVillage = config.get("Allow Villages", "Forest", false).getBoolean(false);
jungleVillage = config.get("Allow Villages", "Jungle", false).getBoolean(false);
plainsVillage = config.get("Allow Villages", "Plains", true).getBoolean(true);
swamplandVillage = config.get("Allow Villages", "Swampland", false).getBoolean(false);
taigaVillage = config.get("Allow Villages", "Taiga", false).getBoolean(false);
FMLCommonHandler.instance().getFMLLogger().log(Level.INFO, "[BiomesOPlenty] Generated Terrain Gen Config!");
}

View file

@ -0,0 +1,141 @@
package biomesoplenty.common.configuration.structures;
import java.io.File;
import java.util.ArrayList;
import org.apache.logging.log4j.Level;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.FMLLog;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.BiomeManager;
import net.minecraftforge.common.config.Configuration;
import biomesoplenty.api.BOPBiomeHelper;
public class BOPConfigurationStrongholds
{
public static Configuration config;
public static ArrayList<String> 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("pasture");
//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");
}
public static void init(File configFile)
{
addDefaultStrongholdBiomes();
config = new Configuration(configFile);
try
{
config.load();
for (BiomeGenBase biome : BOPBiomeHelper.biomeList.values())
{
String name = biome.biomeName;
String convertedName = BOPBiomeHelper.convertBiomeName(name);
if (config.get("Allow Strongholds", name.replace(" ", ""), enabledBiomes.contains(convertedName)).getBoolean(enabledBiomes.contains(convertedName)))
{
BiomeManager.addStrongholdBiome(biome);
}
}
FMLCommonHandler.instance().getFMLLogger().log(Level.INFO, "[BiomesOPlenty] Generated Villages Config!");
}
catch (Exception e)
{
FMLLog.log(Level.ERROR, "Biomes O Plenty has had a problem loading its configuration", e);
}
finally
{
if (config.hasChanged()) {
config.save();
}
}
}
public static void addStrongholdBiome(String biomeName)
{
enabledBiomes.add(biomeName);
}
}

View file

@ -16,6 +16,8 @@ public class BOPConfigurationVillages
{
public static Configuration config;
public static int villageDistance;
public static ArrayList<String> enabledBiomes = new ArrayList();
public static void addDefaultVillageBiomes()
@ -100,6 +102,9 @@ public class BOPConfigurationVillages
{
config.load();
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 (BiomeGenBase biome : BOPBiomeHelper.biomeList.values())
{
String name = biome.biomeName;

View file

@ -85,7 +85,6 @@ public class BOPBiomes
registerBiomes();
useOnlyBiome();
addSpawnBiomes();
//addStrongholdBiomes();
}
private static void registerBiomes()
@ -196,100 +195,6 @@ public class BOPBiomes
}
}
private static void addVillageBiomes()
{
}
private static void addStrongholdBiomes()
{
/*addStrongholdBiome(Biomes.alps);
addStrongholdBiome(Biomes.arctic);
addStrongholdBiome(Biomes.autumnHills);
addStrongholdBiome(Biomes.badlands);
addStrongholdBiome(Biomes.bambooForest);
addStrongholdBiome(Biomes.bayou);
addStrongholdBiome(Biomes.birchForest);
addStrongholdBiome(Biomes.bog);
addStrongholdBiome(Biomes.borealForest);
addStrongholdBiome(Biomes.brushland);
addStrongholdBiome(Biomes.canyon);
addStrongholdBiome(Biomes.chaparral);
addStrongholdBiome(Biomes.cherryBlossomGrove);
addStrongholdBiome(Biomes.coniferousForest);
addStrongholdBiome(Biomes.coniferousForestSnow);
addStrongholdBiome(Biomes.crag);
addStrongholdBiome(Biomes.deadForest);
addStrongholdBiome(Biomes.deadForestSnow);
addStrongholdBiome(Biomes.deadSwamp);
addStrongholdBiome(Biomes.deadlands);
addStrongholdBiome(Biomes.deciduousForest);
addStrongholdBiome(Biomes.dunes);
addStrongholdBiome(Biomes.fen);
addStrongholdBiome(Biomes.field);
addStrongholdBiome(Biomes.frostForest);
addStrongholdBiome(Biomes.fungiForest);
addStrongholdBiome(Biomes.garden);
addStrongholdBiome(Biomes.glacier);
addStrongholdBiome(Biomes.grassland);
addStrongholdBiome(Biomes.grove);
addStrongholdBiome(Biomes.heathland);
addStrongholdBiome(Biomes.highland);
addStrongholdBiome(Biomes.hotSprings);
addStrongholdBiome(Biomes.icyHills);
addStrongholdBiome(Biomes.jadeCliffs);
addStrongholdBiome(Biomes.lavenderFields);
addStrongholdBiome(Biomes.lushDesert);
addStrongholdBiome(Biomes.lushSwamp);
addStrongholdBiome(Biomes.mangrove);
addStrongholdBiome(Biomes.mapleWoods);
addStrongholdBiome(Biomes.marsh);
addStrongholdBiome(Biomes.meadow);
addStrongholdBiome(Biomes.mesa);
addStrongholdBiome(Biomes.moor);
addStrongholdBiome(Biomes.mountain);
addStrongholdBiome(Biomes.mysticGrove);
addStrongholdBiome(Biomes.oasis);
addStrongholdBiome(Biomes.ominousWoods);
addStrongholdBiome(Biomes.orchard);
addStrongholdBiome(Biomes.outback);
addStrongholdBiome(Biomes.overgrownGreens);
addStrongholdBiome(Biomes.pasture);
addStrongholdBiome(Biomes.polar);
addStrongholdBiome(Biomes.prairie);
addStrongholdBiome(Biomes.quagmire);
addStrongholdBiome(Biomes.rainforest);
addStrongholdBiome(Biomes.redwoodForest);
addStrongholdBiome(Biomes.sacredSprings);
addStrongholdBiome(Biomes.savanna);
addStrongholdBiome(Biomes.scrubland);
addStrongholdBiome(Biomes.seasonalForest);
addStrongholdBiome(Biomes.shield);
addStrongholdBiome(Biomes.shrubland);
addStrongholdBiome(Biomes.silkglades);
addStrongholdBiome(Biomes.sludgepit);
addStrongholdBiome(Biomes.spruceWoods);
addStrongholdBiome(Biomes.steppe);
addStrongholdBiome(Biomes.temperateRainforest);
addStrongholdBiome(Biomes.thicket);
addStrongholdBiome(Biomes.timber);
addStrongholdBiome(Biomes.tropicalRainforest);
addStrongholdBiome(Biomes.tropics);
addStrongholdBiome(Biomes.tundra);
addStrongholdBiome(Biomes.volcano);
addStrongholdBiome(Biomes.wasteland);
addStrongholdBiome(Biomes.wetland);
addStrongholdBiome(Biomes.woodland);
addStrongholdBiome(Biomes.plainsNew);
addStrongholdBiome(Biomes.desertNew);
addStrongholdBiome(Biomes.forestNew);
addStrongholdBiome(Biomes.extremeHillsNew);
addStrongholdBiome(Biomes.taigaNew);
addStrongholdBiome(Biomes.swamplandNew);
addStrongholdBiome(Biomes.jungleNew);*/
}
public static void registerOnlyBiome(BOPBiomeListEntry biome)
{
onlyBiome = biome.biome;
@ -311,6 +216,11 @@ public class BOPBiomes
BiomeManager.addSpawnBiome(biome);
}
public static void addStrongholdBiome(BiomeGenBase biome)
{
System.out.println(biome.biomeName);
}
public static void clearAllSpawnBiomes()
{
WorldChunkManager.allowedBiomes.clear();