fix #2145 and related oilgen issues

This commit is contained in:
Adrian Siekierka 2014-11-07 19:06:06 +01:00
parent a3064c12cd
commit 928cc436dd
2 changed files with 8 additions and 16 deletions

View file

@ -104,9 +104,6 @@ public class BuildCraftEnergy extends BuildCraftMod {
public static boolean canOilBurn;
public static double oilWellScalar = 1.0;
public static Set<Integer> oilBiomeIDs = new HashSet<Integer>();
public static Set<Integer> excessiveOilBiomeIDs = new HashSet<Integer>();
public static Set<Integer> excludeOilBiomeIDs = new HashSet<Integer>();
public static TreeMap<BlockIndex, Integer> saturationStored = new TreeMap<BlockIndex, Integer>();
public static ITriggerExternal triggerBlueEngineHeat = new TriggerEngineHeat(EnergyStage.BLUE);
public static ITriggerExternal triggerGreenEngineHeat = new TriggerEngineHeat(EnergyStage.GREEN);
@ -126,21 +123,22 @@ public class BuildCraftEnergy extends BuildCraftMod {
oilWellScalar = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "oilWellGenerationRate", 1.0, "Probability of oil well generation").getDouble(1.0);
setBiomeList(
oilBiomeIDs,
OilPopulate.INSTANCE.surfaceDepositBiomes,
BuildCraftCore.mainConfiguration
.get(Configuration.CATEGORY_GENERAL, "oil.increasedBiomeIDs",
new String[] {BiomeDictionary.Type.SANDY.toString(), BiomeGenBase.taiga.biomeName},
"IDs or Biome Types (e.g. SANDY,OCEAN) of biomes that should have increased oil generation rates."));
setBiomeList(
excessiveOilBiomeIDs,
OilPopulate.INSTANCE.excessiveBiomes,
BuildCraftCore.mainConfiguration
.get(Configuration.CATEGORY_GENERAL,
"oil.excessiveBiomeIDs",
new String[] {},
"IDs or Biome Types (e.g. SANDY,OCEAN) of biomes that should have GREATLY increased oil generation rates."));
setBiomeList(excludeOilBiomeIDs, BuildCraftCore.mainConfiguration
setBiomeList(OilPopulate.INSTANCE.excludedBiomes,
BuildCraftCore.mainConfiguration
.get(Configuration.CATEGORY_GENERAL, "oil.excludeBiomeIDs",
new String[] {BiomeGenBase.sky.biomeName, BiomeGenBase.hell.biomeName},
"IDs or Biome Types (e.g. SANDY,OCEAN) of biomes that are excluded from generating oil."));

View file

@ -46,17 +46,11 @@ public final class OilPopulate {
public final Set<Integer> excludedBiomes = new HashSet<Integer>();
private enum GenType {
LARGE, MEDIUM, LAKE, NONE
};
private OilPopulate() {
// BuildCraftCore.debugMode = true;
surfaceDepositBiomes.add(BiomeGenBase.desert.biomeID);
surfaceDepositBiomes.add(BiomeGenBase.taiga.biomeID);
excludedBiomes.add(BiomeGenBase.sky.biomeID);
excludedBiomes.add(BiomeGenBase.hell.biomeID);
// BuildCraftCore.debugWorldgen = true;
}
@SubscribeEvent
@ -80,15 +74,15 @@ public final class OilPopulate {
BiomeGenBase biome = world.getBiomeGenForCoords(x, z);
// Do not generate oil in the End or Nether
if (BuildCraftEnergy.excludeOilBiomeIDs.contains(biome.biomeID)) {
if (excludedBiomes.contains(biome.biomeID)) {
return;
}
boolean oilBiome = BuildCraftEnergy.oilBiomeIDs.contains(biome.biomeID);
boolean oilBiome = surfaceDepositBiomes.contains(biome.biomeID);
double bonus = oilBiome ? 3.0 : 1.0;
bonus *= BuildCraftEnergy.oilWellScalar;
if (BuildCraftEnergy.excessiveOilBiomeIDs.contains(biome.biomeID)) {
if (excessiveBiomes.contains(biome.biomeID)) {
bonus *= 30.0;
} else if (BuildCraftCore.debugWorldgen) {
bonus *= 20.0;