Add config to enable all disabled mats & components.

This commit is contained in:
Muramasa 2016-10-13 18:51:14 +01:00
parent 021ed41721
commit e16b037cb7
3 changed files with 8 additions and 10 deletions

View file

@ -49,20 +49,14 @@ import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.oredict.OreDictionary;
import org.apache.commons.lang3.StringUtils;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintStream;
import java.io.*;
import java.util.*;
import java.util.Map.Entry;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.lang3.StringUtils;
@Mod(modid = "gregtech", name = "GregTech", version = "MC1710", useMetadata = false, dependencies = "required-after:IC2; after:Forestry; after:PFAAGeologica; after:Thaumcraft; after:Railcraft; after:appliedenergistics2; after:ThermalExpansion; after:TwilightForest; after:harvestcraft; after:magicalcrops; after:BuildCraft|Transport; after:BuildCraft|Silicon; after:BuildCraft|Factory; after:BuildCraft|Energy; after:BuildCraft|Core; after:BuildCraft|Builders; after:GalacticraftCore; after:GalacticraftMars; after:GalacticraftPlanets; after:ThermalExpansion|Transport; after:ThermalExpansion|Energy; after:ThermalExpansion|Factory; after:RedPowerCore; after:RedPowerBase; after:RedPowerMachine; after:RedPowerCompat; after:RedPowerWiring; after:RedPowerLogic; after:RedPowerLighting; after:RedPowerWorld; after:RedPowerControl; after:UndergroundBiomes;")
public class GT_Mod implements IGT_Mod {
public static final int VERSION = 509;
@ -244,6 +238,8 @@ public class GT_Mod implements IGT_Mod {
gregtechproxy.mMagneticraftRecipes = tMainConfig.get(aTextGeneral, "EnableMagneticraftSupport", true).getBoolean(true);
gregtechproxy.mMagneticraftBonusOutputPercent = tMainConfig.get(aTextGeneral, "MagneticraftBonusOutputPercent", 100.0f).getDouble();
gregtechproxy.mTEMachineRecipes = tMainConfig.get("general", "TEMachineRecipes", false).getBoolean(false);
gregtechproxy.mEnableAllMaterials = tMainConfig.get("general", "EnableAllMaterials", false).getBoolean(false);
gregtechproxy.mEnableAllComponents = tMainConfig.get("general", "EnableAllComponents", false).getBoolean(false);
gregtechproxy.mPollution = tMainConfig.get("Pollution", "EnablePollution", true).getBoolean(true);
gregtechproxy.mPollutionSmogLimit = tMainConfig.get("Pollution", "SmogLimit", 500000).getInt(500000);
gregtechproxy.mPollutionPoisonLimit = tMainConfig.get("Pollution", "PoisonLimit", 750000).getInt(750000);

View file

@ -1275,14 +1275,14 @@ public class Materials implements IColorModulationContainer, ISubTagContainer {
public static void init() {
new ProcessingConfig();
new ProcessingModSupport();
if (!GT_Mod.gregtechproxy.mEnableAllMaterials) new ProcessingModSupport();
for (IMaterialHandler aRegistrator : mMaterialHandlers) {
aRegistrator.onMaterialsInit(); //This is where addon mods can add/manipulate materials
}
initMaterialProperties(); //No more material addition or manipulation should be done past this point!
MATERIALS_ARRAY = MATERIALS_MAP.values().toArray(new Materials[MATERIALS_MAP.size()]); //Generate standard object array. This is a lot faster to loop over.
VALUES = Arrays.asList(MATERIALS_ARRAY);
OrePrefixes.initMaterialComponents();
if (!GT_Mod.gregtechproxy.mEnableAllComponents) OrePrefixes.initMaterialComponents();
for (Materials aMaterial : MATERIALS_ARRAY) {
if (aMaterial.mMetaItemSubID >= 0) {
if (aMaterial.mMetaItemSubID < 1000) {

View file

@ -179,6 +179,8 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
private final String aTextForestry = "Forestry";
private final String aTextArsmagica2 = "arsmagica2";
public boolean mTEMachineRecipes = false;
public boolean mEnableAllMaterials = false;
public boolean mEnableAllComponents = false;
public GT_Proxy() {
GameRegistry.registerFuelHandler(this);