Changed Oil Generation to use config file ID's for generation to support

integration with mods like Biomes O' Plenty
This commit is contained in:
Meepster 2014-04-24 23:40:40 -05:00
parent fd9d9272b7
commit 6892234a54
2 changed files with 17 additions and 7 deletions

View file

@ -9,7 +9,8 @@
package buildcraft; package buildcraft;
import java.util.TreeMap; import java.util.TreeMap;
import java.util.HashSet;
import java.util.Set;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
@ -81,6 +82,9 @@ public class BuildCraftEnergy extends BuildCraftMod {
public static Item fuel; public static Item fuel;
public static boolean canOilBurn; public static boolean canOilBurn;
public static double oilWellScalar = 1.0; 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 TreeMap<BlockIndex, Integer> saturationStored = new TreeMap<BlockIndex, Integer>();
public static BCTrigger triggerBlueEngineHeat = new TriggerEngineHeat(EnergyStage.BLUE); public static BCTrigger triggerBlueEngineHeat = new TriggerEngineHeat(EnergyStage.BLUE);
public static BCTrigger triggerGreenEngineHeat = new TriggerEngineHeat(EnergyStage.GREEN); public static BCTrigger triggerGreenEngineHeat = new TriggerEngineHeat(EnergyStage.GREEN);
@ -95,6 +99,15 @@ public class BuildCraftEnergy extends BuildCraftMod {
int oilOceanBiomeId = BuildCraftCore.mainConfiguration.get("biomes", "biomeOilOcean", DefaultProps.BIOME_OIL_OCEAN).getInt(DefaultProps.BIOME_OIL_OCEAN); int oilOceanBiomeId = BuildCraftCore.mainConfiguration.get("biomes", "biomeOilOcean", DefaultProps.BIOME_OIL_OCEAN).getInt(DefaultProps.BIOME_OIL_OCEAN);
canOilBurn = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "burnOil", true, "Can oil burn?").getBoolean(true); canOilBurn = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "burnOil", true, "Can oil burn?").getBoolean(true);
oilWellScalar = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "oilWellGenerationRate", 1.0, "Probability of oil well generation").getDouble(1.0); oilWellScalar = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "oilWellGenerationRate", 1.0, "Probability of oil well generation").getDouble(1.0);
for(String id : BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "oilBiomeIDs", BiomeGenBase.desert.biomeID +","+BiomeGenBase.taiga.biomeID, "ID's of biomes that should have increased oil generation rates.").getString().trim().split(",")){
if(id.length() > 0) oilBiomeIDs.add(Integer.parseInt(id));
}
for(String id : BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "excessiveOilBiomeIDs", "", "ID's of biomes that should have GREATLY increased oil generation rates.").getString().trim().split(",")) {
if(id.length() > 0) excessiveOilBiomeIDs.add(Integer.parseInt(id));
}
for(String id : BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "excludeOilBiomeIDs", BiomeGenBase.sky.biomeID +","+BiomeGenBase.hell.biomeID, "ID's of biomes that are excluded from generating oil.").getString().trim().split(",")){
if(id.length() > 0) excludeOilBiomeIDs.add(Integer.parseInt(id));
}
double fuelOilMultiplier = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "fuel.oil.combustion", 1.0F, "adjust energy value of Oil in Combustion Engines").getDouble(1.0F); double fuelOilMultiplier = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "fuel.oil.combustion", 1.0F, "adjust energy value of Oil in Combustion Engines").getDouble(1.0F);
double fuelFuelMultiplier = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "fuel.fuel.combustion", 1.0F, "adjust energy value of Fuel in Combustion Engines").getDouble(1.0F); double fuelFuelMultiplier = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "fuel.fuel.combustion", 1.0F, "adjust energy value of Fuel in Combustion Engines").getDouble(1.0F);

View file

@ -83,18 +83,15 @@ public class OilPopulate {
BiomeGenBase biome = world.getBiomeGenForCoords(x, z); BiomeGenBase biome = world.getBiomeGenForCoords(x, z);
// Do not generate oil in the End or Nether // Do not generate oil in the End or Nether
if (excludedBiomes.contains(biome.biomeID)) { if (BuildCraftEnergy.excludeOilBiomeIDs.contains(biome.biomeID)) {
return; return;
} }
boolean oilBiome = surfaceDepositBiomes.contains(biome.biomeID) boolean oilBiome = BuildCraftEnergy.oilBiomeIDs.contains(biome.biomeID);
|| BiomeDictionary.isBiomeOfType(biome, DESERT)
|| (BiomeDictionary.isBiomeOfType(biome, WASTELAND) && !BiomeDictionary.isBiomeOfType(biome, FROZEN))
|| (BiomeDictionary.isBiomeOfType(biome, FOREST) && BiomeDictionary.isBiomeOfType(biome, FROZEN));
double bonus = oilBiome ? 3.0 : 1.0; double bonus = oilBiome ? 3.0 : 1.0;
bonus *= BuildCraftEnergy.oilWellScalar; bonus *= BuildCraftEnergy.oilWellScalar;
if (excessiveBiomes.contains(biome.biomeID)) { if (BuildCraftEnergy.excessiveOilBiomeIDs.contains(biome.biomeID)) {
bonus *= 30.0; bonus *= 30.0;
} else if (BuildCraftCore.debugMode) { } else if (BuildCraftCore.debugMode) {
bonus *= 20.0; bonus *= 20.0;