This commit is contained in:
Matt Caughey 2014-05-15 07:20:13 -04:00
commit 51aaad79df
12 changed files with 36 additions and 9 deletions

View File

@ -6,6 +6,7 @@ import java.util.List;
import net.minecraft.util.WeightedRandom;
import net.minecraft.world.biome.BiomeGenBase;
import biomesoplenty.common.configuration.BOPConfigurationBiomeGen;
import biomesoplenty.common.configuration.BOPConfigurationBiomeWeights;
import biomesoplenty.common.configuration.BOPConfigurationIDs;
public class BOPBiomeManager
@ -23,7 +24,7 @@ public class BOPBiomeManager
if (biome != null)
{
BiomeEntry entry = new BiomeEntry(biome, weight);
BiomeEntry entry = new BiomeEntry(biome, getConfiguredWeight(biome, biomeType, weight));
if (BOPConfigurationBiomeGen.config.get(biomeType + " Biomes To Generate", biome.biomeName, true).getBoolean(false))
{
@ -76,6 +77,11 @@ public class BOPBiomeManager
return -1;
}
private static int getConfiguredWeight(BiomeGenBase biome, String biomeType, int weight)
{
return BOPConfigurationBiomeWeights.config.get(biomeType + " Biome Weights", biome.biomeName, weight).getInt(weight);
}
public class TemperatureType
{
public static final int HOT = 0;

View File

@ -41,7 +41,7 @@ public class BiomeGenBog extends BOPBiome
this.bopWorldFeatures.setFeature("riverCanePerChunk", 8);
this.bopWorldFeatures.setFeature("blueMilksPerChunk", 1);
this.bopWorldFeatures.setFeature("waterLakesPerChunk", 6);
//TODO: FEATURE this.bopWorldFeatures.poisonWaterPerChunk = 2;
this.bopWorldFeatures.setFeature("poisonLakesPerChunk", 2);
this.bopWorldFeatures.setFeature("waterReedsPerChunk", 8);
this.bopWorldFeatures.setFeature("koruPerChunk", 1);
this.bopWorldFeatures.setFeature("shrubsPerChunk", 10);

View File

@ -37,7 +37,7 @@ public class BiomeGenLushSwamp extends BOPBiome
this.bopWorldFeatures.setFeature("highCattailsPerChunk", 5);
this.bopWorldFeatures.setFeature("riverCanePerChunk", 5);
this.bopWorldFeatures.setFeature("algaePerChunk", 3);
//TODO: FEATURE this.bopWorldFeatures.poisonWaterPerChunk = 2;
this.bopWorldFeatures.setFeature("poisonLakesPerChunk", 2);
this.bopWorldFeatures.setFeature("wildCarrotsPerChunk", 1);
this.bopWorldFeatures.setFeature("shrubsPerChunk", 5);
this.bopWorldFeatures.setFeature("koruPerChunk", 1);

View File

@ -21,9 +21,7 @@ public class BiomeGenMysticGrove extends BOPBiome
{
super(id);
//TODO: setHeight()
this.setHeight(biomeHeight);
//TODO: setColor()
this.setColor(6934491);
this.setTemperatureRainfall(0.9F, 1.0F);
@ -43,7 +41,7 @@ public class BiomeGenMysticGrove extends BOPBiome
this.bopWorldFeatures.setFeature("bopFlowersPerChunk", 10);
this.bopWorldFeatures.setFeature("sproutsPerChunk", 1);
this.bopWorldFeatures.setFeature("blueMilksPerChunk", 1);
//TODO: FEATURE customBiomeDecorator.poisonWaterPerChunk = 1;
this.bopWorldFeatures.setFeature("poisonLakesPerChunk", 1);
this.bopWorldFeatures.setFeature("cloverPatchesPerChunk", 10);
this.bopWorldFeatures.setFeature("shrubsPerChunk", 4);

View File

@ -52,7 +52,7 @@ public class BiomeGenOminousWoods extends BOPBiome
this.bopWorldFeatures.setFeature("poisonIvyPerChunk", 3);
this.bopWorldFeatures.setFeature("leafPilesPerChunk", 2);
this.bopWorldFeatures.setFeature("deadLeafPilesPerChunk", 4);
//TODO: FEATURE customBiomeDecorator.poisonWaterPerChunk = 15;
this.bopWorldFeatures.setFeature("poisonLakesPerChunk", 15);
this.bopWorldFeatures.setFeature("bopFlowersPerChunk", 1);
this.bopWorldFeatures.setFeature("bopGrassPerChunk", 1);

View File

@ -45,7 +45,7 @@ public class BiomeGenSludgepit extends BOPBiome
this.bopWorldFeatures.setFeature("mudPerChunk", 5);
this.bopWorldFeatures.setFeature("algaePerChunk", 2);
//TODO: FEATURE customBiomeDecorator.poisonWaterPerChunk = 5;
this.bopWorldFeatures.setFeature("poisonLakesPerChunk", 5);
this.bopWorldFeatures.setFeature("waterReedsPerChunk", 6);
this.bopWorldFeatures.setFeature("koruPerChunk", 1);
this.bopWorldFeatures.setFeature("leafPilesPerChunk", 5);

View File

@ -32,7 +32,7 @@ public class BiomeGenWasteland extends BOPBiome
this.theBiomeDecorator.treesPerChunk = 0;
this.theBiomeDecorator.grassPerChunk = 20;
//TODO: FEATURE customBiomeDecorator.poisonWaterPerChunk = 10;
this.bopWorldFeatures.setFeature("poisonLakesPerChunk", 10);
this.bopWorldFeatures.setFeature("waterLakesPerChunk", 2);
this.bopWorldFeatures.setFeature("wasteland1PerChunk", 1);
this.bopWorldFeatures.setFeature("wasteland2PerChunk", 1);

View File

@ -7,6 +7,7 @@ public class BOPConfiguration
public static File mainConfigFile;
public static File worldFeaturesConfigFile;
public static File biomeGenConfigFile;
public static File biomeWeightsConfigFile;
public static File terrainGenConfigFile;
public static File villagesConfigFile;
public static File strongholdsConfigFile;
@ -18,6 +19,7 @@ public class BOPConfiguration
mainConfigFile = new File(configpath + "main.cfg");
worldFeaturesConfigFile = new File(configpath + "worldfeatures.cfg");
biomeGenConfigFile = new File(configpath + "biomegen.cfg");
biomeWeightsConfigFile = new File(configpath + "biomeweights.cfg");
terrainGenConfigFile = new File(configpath + "terraingen.cfg");
villagesConfigFile = new File(configpath + "structures/villages.cfg");
strongholdsConfigFile = new File(configpath + "structures/strongholds.cfg");
@ -26,6 +28,7 @@ public class BOPConfiguration
BOPConfigurationMain.init(mainConfigFile);
BOPConfigurationBiomeGen.init(biomeGenConfigFile);
BOPConfigurationBiomeWeights.init(biomeWeightsConfigFile);
BOPConfigurationTerrainGen.init(terrainGenConfigFile);
BOPConfigurationIDs.init(idConfigFile);
BOPConfigurationMisc.init(miscConfigFile);

View File

@ -0,0 +1,15 @@
package biomesoplenty.common.configuration;
import java.io.File;
import net.minecraftforge.common.config.Configuration;
public class BOPConfigurationBiomeWeights
{
public static Configuration config;
public static void init(File configFile)
{
config = new Configuration(configFile);
}
}

View File

@ -91,6 +91,7 @@ import biomesoplenty.common.biomes.overworld.subbiomes.BiomeGenVolcano;
import biomesoplenty.common.biomes.overworld.techbiomes.BiomeGenDryRiver;
import biomesoplenty.common.biomes.overworld.techbiomes.BiomeGenLushRiver;
import biomesoplenty.common.configuration.BOPConfigurationBiomeGen;
import biomesoplenty.common.configuration.BOPConfigurationBiomeWeights;
import biomesoplenty.common.configuration.BOPConfigurationIDs;
import biomesoplenty.common.configuration.BOPConfigurationMisc;
import biomesoplenty.common.utils.BOPLogger;
@ -112,6 +113,7 @@ public class BOPBiomes
{
BOPConfigurationIDs.config.load();
BOPConfigurationBiomeGen.config.load();
BOPConfigurationBiomeWeights.config.load();
registerBiomes();
}
catch (Exception e)
@ -122,6 +124,7 @@ public class BOPBiomes
{
if (BOPConfigurationIDs.config.hasChanged()) BOPConfigurationIDs.config.save();
if (BOPConfigurationBiomeGen.config.hasChanged()) BOPConfigurationBiomeGen.config.save();
if (BOPConfigurationBiomeWeights.config.hasChanged()) BOPConfigurationBiomeWeights.config.save();
}
addBiomesToDictionary();

View File

@ -38,6 +38,7 @@ public class BOPWorldFeatures
addFeature("waterLakesPerChunk", 0);
addFeature("lavaLakesPerChunk", 0);
addFeature("poisonLakesPerChunk", 0);
addFeature("mudPerChunk", 0);
addFeature("riverCanePerChunk", 0);

View File

@ -127,6 +127,7 @@ public class WorldGenFieldAssociation
associateFeatureForced("waterLakesPerChunk", new WorldGenLakes(Blocks.water), LakesForcedGenerator.class);
associateFeatureForced("lavaLakesPerChunk", new WorldGenLakes(Blocks.lava), LakesForcedGenerator.class);
associateFeatureForced("poisonLakesPerChunk", new WorldGenLakes(BOPBlockHelper.get("poison")), LakesForcedGenerator.class);
associateFeatureForced("generateMelons", new WorldGenMelon(), MelonForcedGenerator.class);
}