Config work

This commit is contained in:
Muramasa 2016-08-18 07:00:57 +01:00
parent 6917673264
commit eaadf6f74b
4 changed files with 729 additions and 2406 deletions

View file

@ -28,7 +28,6 @@ import gregtech.loaders.load.GT_SonictronLoader;
import gregtech.loaders.misc.GT_Achievements;
import gregtech.loaders.misc.GT_Bees;
import gregtech.loaders.misc.GT_CoverLoader;
import gregtech.loaders.misc.OreProcessingConfiguration;
import gregtech.loaders.postload.*;
import gregtech.loaders.preload.*;
import ic2.api.recipe.IRecipeInput;
@ -127,7 +126,6 @@ public class GT_Mod
GregTech_API.sUnification = new GT_Config(new Configuration(new File(new File(aEvent.getModConfigurationDirectory(), "GregTech"), "Unification.cfg")));
GregTech_API.sSpecialFile = new GT_Config(new Configuration(new File(new File(aEvent.getModConfigurationDirectory(), "GregTech"), "Other.cfg")));
GregTech_API.sOPStuff = new GT_Config(new Configuration(new File(new File(aEvent.getModConfigurationDirectory(), "GregTech"), "OverpoweredStuff.cfg")));
GregTech_API.sMaterialsFile = new GT_Config(new Configuration(new File(new File(aEvent.getModConfigurationDirectory(), "GregTech"), "Materials.cfg")));
GregTech_API.sClientDataFile = new GT_Config(new Configuration(new File(aEvent.getModConfigurationDirectory().getParentFile(), "GregTech.cfg")));
@ -271,7 +269,7 @@ public class GT_Mod
}
}
//GT_Config.troll = (Calendar.getInstance().get(2) + 1 == 4) && (Calendar.getInstance().get(5) >= 1) && (Calendar.getInstance().get(5) <= 2);
Materials.initCustomMats("custom");
Materials.initCustomMaterials();
GT_Log.out.println("GT_Mod: Saving Main Config");
tMainConfig.save();
@ -298,8 +296,6 @@ public class GT_Mod
new Enchantment_EnderDamage();
new Enchantment_Radioactivity();
new OreProcessingConfiguration(aEvent.getModConfigurationDirectory()).run();
new GT_Loader_OreProcessing().run();
new GT_Loader_OreDictionary().run();
new GT_Loader_ItemData().run();
@ -684,7 +680,7 @@ public class GT_Mod
GregTech_API.mInputRF = false;
}
}
Materials.initMaterialProperties();
achievements = new GT_Achievements();
Map.Entry<IRecipeInput, RecipeOutput> tRecipe;
GT_Log.out.println("GT_Mod: Loading finished, deallocating temporary Init Variables.");

View file

@ -1,6 +1,7 @@
package gregtech.api.enums;
import gregtech.api.GregTech_API;
import gregtech.api.enums.TC_Aspects.TC_AspectStack;
import gregtech.api.interfaces.IColorModulationContainer;
import gregtech.api.interfaces.ISubTagContainer;
import gregtech.api.objects.GT_FluidStack;
@ -10,7 +11,6 @@ import net.minecraft.enchantment.Enchantment;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
import gregtech.api.enums.TC_Aspects.TC_AspectStack;
import java.util.*;
@ -18,7 +18,7 @@ import static gregtech.api.enums.GT_Values.M;
public class Materials implements IColorModulationContainer, ISubTagContainer {
public static Collection<Materials> VALUES = new HashSet<Materials>();
public static Collection<Materials> VALUES_CUSTOM = new HashSet<Materials>();
/**
* This is the Default Material returned in case no Material has been found or a NullPointer has been inserted at a location where it shouldn't happen.
@ -705,7 +705,7 @@ public class Materials implements IColorModulationContainer, ISubTagContainer {
public final short[] mRGBa = new short[]{255, 255, 255, 0}, mMoltenRGBa = new short[]{255, 255, 255, 0};
public TextureSet mIconSet;
public int mMetaItemSubID;
public final boolean mUnificatable;
public boolean mUnificatable;
public final Materials mMaterialInto;
public final List<MaterialStack> mMaterialList = new ArrayList<MaterialStack>();
public final List<Materials> mOreByProducts = new ArrayList<Materials>(), mOreReRegistrations = new ArrayList<Materials>();
@ -714,20 +714,24 @@ public class Materials implements IColorModulationContainer, ISubTagContainer {
private final Collection<SubTag> mSubTags = new HashSet<SubTag>();
public Enchantment mEnchantmentTools = null, mEnchantmentArmors = null;
public byte mEnchantmentToolsLevel = 0, mEnchantmentArmorsLevel = 0;
public boolean mBlastFurnaceRequired = false;
public boolean mBlastFurnaceRequired = false, mTransparent = false;
public float mToolSpeed = 1.0F, mHeatDamage = 0.0F;
public String mChemicalFormula = "?", mName = "null", mDefaultLocalName = "null";
public Dyes mColor = Dyes._NULL;
public short mMeltingPoint = 0, mBlastFurnaceTemp = 0;
public int mTypes = 0, mDurability = 16, mFuelPower = 0, mFuelType = 0, mExtraData = 0, mOreValue = 0, mOreMultiplier = 1, mByProductMultiplier = 1, mSmeltingMultiplier = 1;
public int mTypes = 0; // 1=?; 2=?; 4=?; 8=OreProcessing; 16=?; 32=?; 64=?; 128=?; 256=?;
public int mDurability = 16, mFuelPower = 0, mFuelType = 0, mExtraData = 0, mOreValue = 0, mOreMultiplier = 1, mByProductMultiplier = 1, mSmeltingMultiplier = 1;
public int mDensityMultiplier = 1, mDensityDivider = 1;
public long mDensity = M;
public Element mElement = null;
public Materials mDirectSmelting = this, mOreReplacement = this, mMacerateInto = this, mSmeltInto = this, mArcSmeltInto = this, mHandleMaterial = this;
public byte mToolQuality = 0;
public boolean mCustomOre = false;
public String mCustomID = "null", mConfigSection = "null";
public Fluid mSolid = null, mFluid = null, mGas = null, mPlasma = null;
/**
* This Fluid is used as standard Unit for Molten Materials. 1296 is a Molten Block, what means 144 is one Material Unit worth
* This Fluid is used as standard Unit for Molten Materials. 1296 is a Molten Block, that means 144 is one Material Unit worth of fluid.
*/
public Fluid mStandardMoltenFluid = null;
@ -1256,46 +1260,100 @@ public class Materials implements IColorModulationContainer, ISubTagContainer {
Mithril.add(SubTag.MAGICAL);
}
public static void initCustomMats(String aCustomOreConfigLabel) {
//TODO MAIN: increase sGeneratedMaterials limit from 1,000 to 10,000.
//TODO good way to only get the rest of the data (Tool qual etc) one and not twice per for loop (one for default and custom).
//TODO split this into a new method
for (Materials tMaterial : Materials.VALUES) {
if (tMaterial.mMetaItemSubID >= 0) {
tMaterial.mMetaItemSubID = GregTech_API.sMaterialsFile.get("materials.default." + tMaterial.mDefaultLocalName, "MaterialID", tMaterial.mMetaItemSubID);
tMaterial.mDurability = GregTech_API.sMaterialsFile.get("materials.default." + tMaterial.mDefaultLocalName, "Durability", tMaterial.mDurability);
}
}
//TODO make this minetweaker friendly?
//TDOO register fluids
public static void initCustomMaterials() {
//TODO register fluids
int i = 0;
StringBuilder aCustomMatNum = new StringBuilder();
for (int j = GregTech_API.sMaterialsFile.get("general", "AmountOfCustomMaterialSlots", 16); i < j; i++) {
aCustomMatNum.append("materials.").append(aCustomOreConfigLabel).append(".custommat").append(i < 10 ? "0" : "" ).append(i);
int aMetaItemSubID = GregTech_API.sMaterialsFile.get(aCustomMatNum.toString(), "MaterialID", -1);
String aDefaultLocalName = GregTech_API.sMaterialsFile.get(aCustomMatNum.toString(), "MaterialName", "NullMat");
if (!aDefaultLocalName.equalsIgnoreCase("NullMat")) {
new Materials(aMetaItemSubID, TextureSet.SET_METALLIC, 16.0F, 1280, 4, 1 | 2 | 8 | 32 | 64 | 128, 50, 50, 255, 0, aDefaultLocalName, 0, 0, 3306, 3306, true, false, 10, 1, 1, Dyes.dyeBlue);
StringBuilder aCustomPath = new StringBuilder();
StringBuilder aCustomID = new StringBuilder();
for (int j = GregTech_API.sMaterialProperties.get("general", "AmountOfCustomMaterialSlots", 16); i < j; i++) {
aCustomID.append((i < 10 ? "0" : "")).append(i);
aCustomPath.append("materials.custom.").append(aCustomID.toString());
int aMaterialID = GregTech_API.sMaterialProperties.get(aCustomPath.toString(), "MaterialID", -1);
String aMaterialName = GregTech_API.sMaterialProperties.get(aCustomPath.toString(), "MaterialName", "NullMat");
if (aMaterialID >= 0 && aMaterialID <= 1000 && !aMaterialName.equalsIgnoreCase("nullmat")) {
new Materials(aMaterialID, TextureSet.SET_METALLIC, 1.0F, 0, 0, 0, 255, 255, 255, 0, aMaterialName, 0, 0, 0, 0, false, false, 1, 1, 1, Dyes._NULL, "custom", true, aCustomID.toString());
}
aCustomMatNum.setLength(0);
aCustomID.setLength(0);
aCustomPath.setLength(0);
}
}
public Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aToolDurability, int aToolQuality, boolean aUnificatable) {
public static void initMaterialProperties() {
StringBuilder aConfigPath = new StringBuilder();
for (Materials aMaterial : VALUES) {
if (aMaterial != null && aMaterial != Materials._NULL && aMaterial != Materials.Empty) {
aConfigPath.append("materials.").append(aMaterial.mConfigSection).append(".").append(aMaterial.mCustomOre ? aMaterial.mCustomID : aMaterial.mName);
aMaterial.mMetaItemSubID = GregTech_API.sMaterialProperties.get(aConfigPath.toString(), "MaterialID", aMaterial.mCustomOre ? -1 : aMaterial.mMetaItemSubID);
aMaterial.mDefaultLocalName = GregTech_API.sMaterialProperties.get(aConfigPath.toString(), "MaterialName", aMaterial.mCustomOre ? "NullMat" : aMaterial.mDefaultLocalName);
aMaterial.mMeltingPoint = (short) GregTech_API.sMaterialProperties.get(aConfigPath.toString(), "MeltingPoint", aMaterial.mMeltingPoint);
aMaterial.mBlastFurnaceRequired = GregTech_API.sMaterialProperties.get(aConfigPath.toString(), "BlastFurnaceRequired", aMaterial.mBlastFurnaceRequired);
aMaterial.mBlastFurnaceTemp = (short) GregTech_API.sMaterialProperties.get(aConfigPath.toString(), "BlastFurnaceTemp", aMaterial.mBlastFurnaceTemp);
aMaterial.mFuelPower = GregTech_API.sMaterialProperties.get(aConfigPath.toString(), "FuelPower", aMaterial.mFuelPower);
aMaterial.mFuelType = GregTech_API.sMaterialProperties.get(aConfigPath.toString(), "FuelType", aMaterial.mFuelType);
aMaterial.mOreValue = GregTech_API.sMaterialProperties.get(aConfigPath.toString(), "OreValue", aMaterial.mOreValue);
aMaterial.mDensityMultiplier = GregTech_API.sMaterialProperties.get(aConfigPath.toString(), "DensityMultiplier", aMaterial.mDensityMultiplier);
aMaterial.mDensityDivider = GregTech_API.sMaterialProperties.get(aConfigPath.toString(), "DensityDivider", aMaterial.mDensityDivider);
aMaterial.mDensity = (long) GregTech_API.sMaterialProperties.get(aConfigPath.toString(), "Density", (M * aMaterial.mDensityMultiplier) / aMaterial.mDensityDivider);
aMaterial.mDurability = GregTech_API.sMaterialProperties.get(aConfigPath.toString(), "ToolDurability", aMaterial.mDurability);
aMaterial.mToolSpeed = (float) GregTech_API.sMaterialProperties.get(aConfigPath.toString(), "ToolSpeed", aMaterial.mToolSpeed);
aMaterial.mToolQuality = (byte) GregTech_API.sMaterialProperties.get(aConfigPath.toString(), "ToolQuality", aMaterial.mToolQuality);
//aMaterial.mIconSet = GregTech_API.sMaterialProperties.get(aConfigPath.toString(), "IconSet", aMaterial.mIconSet);
aMaterial.mTransparent = GregTech_API.sMaterialProperties.get(aConfigPath.toString(), "Transparent", aMaterial.mTransparent);
aMaterial.mColor = Dyes.get(GregTech_API.sMaterialProperties.get(aConfigPath.toString(), "DyeColor", aMaterial.mColor.mName));
aMaterial.mRGBa[0] = aMaterial.mMoltenRGBa[0] = (short) GregTech_API.sMaterialProperties.get(aConfigPath.toString(), "MatRed", aMaterial. mRGBa[0]);
aMaterial.mRGBa[1] = aMaterial.mMoltenRGBa[1] = (short) GregTech_API.sMaterialProperties.get(aConfigPath.toString(), "MatGreen", aMaterial.mRGBa[1]);
aMaterial.mRGBa[2] = aMaterial.mMoltenRGBa[2] = (short) GregTech_API.sMaterialProperties.get(aConfigPath.toString(), "MatBlue", aMaterial.mRGBa[2]);
aMaterial.mRGBa[3] = aMaterial.mMoltenRGBa[3] = (short) GregTech_API.sMaterialProperties.get(aConfigPath.toString(), "MatAlpha", aMaterial.mRGBa[3]);
aMaterial.mTypes = GregTech_API.sMaterialProperties.get(aConfigPath.toString(), "MaterialTypes", aMaterial.mCustomOre ? 1|2|4|8|16|32|64|128 : aMaterial.mTypes);
aMaterial.mUnificatable = GregTech_API.sMaterialProperties.get(aConfigPath.toString(), "Unificatable", aMaterial.mUnificatable);
List<String> aAspects = new ArrayList<>();
ArrayList<String> aAspectAmounts = new ArrayList<>();
for (TC_Aspects.TC_AspectStack aAspectStack : aMaterial.mAspects) {
aAspects.add(aAspectStack.mAspect.toString());
aAspectAmounts.add(String.valueOf(aAspectStack.mAmount));
}
String aAspectsString = GregTech_API.sMaterialProperties.get(aConfigPath.toString(), "TCAspects", aAspects.toString().replace(" ", "").replace("[", "").replace("]", ""));
String aAspectAmountsString = GregTech_API.sMaterialProperties.get(aConfigPath.toString(), "TCAspectAmounts", aAspectAmounts.toString().replace(" ", "").replace("[", "").replace("]", ""));
aAspects = new ArrayList<>(Arrays.asList(aAspectsString.split(",")));
aAspectAmounts = new ArrayList<>(Arrays.asList(aAspectAmountsString.split(",")));
for (int x = 0; x < aAspects.size(); x++) {
String str = aAspects.get(x);
if (!str.isEmpty()) {
TC_AspectStack aAspectStack = new TC_AspectStack(TC_Aspects.valueOf(str), Long.parseLong(aAspectAmounts.get(x)));
if (!aMaterial.mAspects.contains(aAspectStack)) aMaterial.mAspects.add(aAspectStack);
}
}
}
aConfigPath.setLength(0);
}
}
public Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aDurability, int aToolQuality, boolean aUnificatable) {
this(aMetaItemSubID, aIconSet, aToolSpeed, aDurability, aToolQuality, aUnificatable, "ore", false, "null");
}
public Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aDurability, int aToolQuality, boolean aUnificatable, String aConfigSection, boolean aCustomOre, String aCustomID) {
VALUES.add(this);
mUnificatable = aUnificatable;
mMaterialInto = this;
if (aCustomOre) VALUES_CUSTOM.add(this);
mCustomOre = aCustomOre;
mCustomID = aCustomID;
mConfigSection = aConfigSection;
mMetaItemSubID = aMetaItemSubID;
mToolQuality = (byte) aToolQuality;
mDurability = aToolDurability;
mUnificatable = aUnificatable;
mDurability = aDurability;
mToolSpeed = aToolSpeed;
mToolQuality = (byte) aToolQuality;
mMaterialInto = this;
mIconSet = aIconSet;
if (aMetaItemSubID >= 0) {
if (aMetaItemSubID < 1000) {
if (GregTech_API.sGeneratedMaterials[aMetaItemSubID] == null) {
GregTech_API.sGeneratedMaterials[aMetaItemSubID] = this;
} else {
throw new IllegalArgumentException("The Index " + aMetaItemSubID + " is already used!");
}
} else throw new IllegalArgumentException("The Material Index " + aMetaItemSubID + " is already used!");
} else throw new IllegalArgumentException("The Material Index " + aMetaItemSubID + " is over the maximum of 1000");
}
}
@ -1310,34 +1368,45 @@ public class Materials implements IColorModulationContainer, ISubTagContainer {
}
public Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aDefaultLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor) {
this(aMetaItemSubID, aIconSet, aToolSpeed, aDurability, aToolQuality, true);
mName = aDefaultLocalName.replaceAll(" ", "");
this(aMetaItemSubID, aIconSet, aToolSpeed, aDurability, aToolQuality, aTypes, aR, aG, aB, aA, aDefaultLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor, "ore", false, "null");
}
public Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aDefaultLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, String aConfigSection) {
this(aMetaItemSubID, aIconSet, aToolSpeed, aDurability, aToolQuality, aTypes, aR, aG, aB, aA, aDefaultLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor, aConfigSection, false, "null");
}
public Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aDefaultLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, String aConfigSection, boolean aCustomOre, String aCustomID) {
this(aMetaItemSubID, aIconSet, aToolSpeed, aDurability, aToolQuality, true, aConfigSection, aCustomOre, aCustomID);
mDefaultLocalName = aDefaultLocalName;
mName = mDefaultLocalName.contains(" ") ? mDefaultLocalName.replaceAll(" ", "") : mDefaultLocalName;
mMeltingPoint = (short) aMeltingPoint;
mBlastFurnaceTemp = (short) aBlastFurnaceTemp;
mBlastFurnaceRequired = aBlastFurnaceRequired;
if (aTransparent) add(SubTag.TRANSPARENT);
mBlastFurnaceTemp = (short) aBlastFurnaceTemp;
mTransparent = aTransparent;
mFuelPower = aFuelPower;
mFuelType = aFuelType;
mOreValue = aOreValue;
mDensity = (M * aDensityMultiplier) / aDensityDivider;
mColor = aColor == null ? Dyes._NULL : aColor;
if (mColor != null) add(SubTag.HAS_COLOR);
mDensityMultiplier = aDensityMultiplier;
mDensityDivider = aDensityDivider;
mDensity = (M * mDensityMultiplier) / mDensityDivider;
mColor = aColor;
mRGBa[0] = mMoltenRGBa[0] = (short) aR;
mRGBa[1] = mMoltenRGBa[1] = (short) aG;
mRGBa[2] = mMoltenRGBa[2] = (short) aB;
mRGBa[3] = mMoltenRGBa[3] = (short) aA;
mTypes = aTypes;
if (mColor != null) add(SubTag.HAS_COLOR);
if (mTransparent) add(SubTag.TRANSPARENT);
if ((mTypes & 2) != 0) add(SubTag.SMELTING_TO_FLUID);
}
public Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aToolDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, List<TC_Aspects.TC_AspectStack> aAspects) {
this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, aR, aG, aB, aA, aLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor);
public Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aDefaultLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, List<TC_Aspects.TC_AspectStack> aAspects) {
this(aMetaItemSubID, aIconSet, aToolSpeed, aDurability, aToolQuality, aTypes, aR, aG, aB, aA, aDefaultLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor);
mAspects.addAll(aAspects);
}
public Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aToolDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, Element aElement, List<TC_Aspects.TC_AspectStack> aAspects) {
this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, aR, aG, aB, aA, aLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor);
public Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aDefaultLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, Element aElement, List<TC_Aspects.TC_AspectStack> aAspects) {
this(aMetaItemSubID, aIconSet, aToolSpeed, aDurability, aToolQuality, aTypes, aR, aG, aB, aA, aDefaultLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor);
mElement = aElement;
mElement.mLinkedMaterials.add(this);
if (aElement == Element._NULL) {
@ -1349,12 +1418,12 @@ public class Materials implements IColorModulationContainer, ISubTagContainer {
mAspects.addAll(aAspects);
}
public Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aToolDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, int aExtraData, List<MaterialStack> aMaterialList) {
this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, aR, aG, aB, aA, aLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor, aExtraData, aMaterialList, null);
public Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aDefaultLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, int aExtraData, List<MaterialStack> aMaterialList) {
this(aMetaItemSubID, aIconSet, aToolSpeed, aDurability, aToolQuality, aTypes, aR, aG, aB, aA, aDefaultLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor, aExtraData, aMaterialList, null);
}
public Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aToolDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, int aExtraData, List<MaterialStack> aMaterialList, List<TC_Aspects.TC_AspectStack> aAspects) {
this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, aR, aG, aB, aA, aLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor);
public Materials(int aMetaItemSubID, TextureSet aIconSet, float aToolSpeed, int aDurability, int aToolQuality, int aTypes, int aR, int aG, int aB, int aA, String aDefaultLocalName, int aFuelType, int aFuelPower, int aMeltingPoint, int aBlastFurnaceTemp, boolean aBlastFurnaceRequired, boolean aTransparent, int aOreValue, int aDensityMultiplier, int aDensityDivider, Dyes aColor, int aExtraData, List<MaterialStack> aMaterialList, List<TC_Aspects.TC_AspectStack> aAspects) {
this(aMetaItemSubID, aIconSet, aToolSpeed, aDurability, aToolQuality, aTypes, aR, aG, aB, aA, aDefaultLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor);
mExtraData = aExtraData;
mMaterialList.addAll(aMaterialList);
mChemicalFormula = "";

File diff suppressed because it is too large Load diff

View file

@ -1,60 +0,0 @@
package gregtech.loaders.misc;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Materials;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
import java.io.File;
import java.util.HashMap;
public class OreProcessingConfiguration
implements Runnable
{
private final Configuration mConfiguration;
private final HashMap<String, Boolean> mEnabledMaterials;
public OreProcessingConfiguration(File aModConfigurationDirectory)
{
this.mEnabledMaterials = new HashMap<String, Boolean>();
this.mConfiguration =
new Configuration(new File(new File(aModConfigurationDirectory, "GregTech"), "OreProcessing.cfg"));
this.mConfiguration.load();
this.loadConfiguration();
if (this.mConfiguration.hasChanged())
{
this.mConfiguration.save();
}
}
private void loadConfiguration()
{
for (Materials tMaterial : GregTech_API.sGeneratedMaterials)
{
if (tMaterial != null && tMaterial != Materials._NULL)
{
String tMaterialName = tMaterial.mName;
boolean tDefaultValue = (tMaterial.mTypes & 8) != 0;
Property tProperty =
this.mConfiguration.get("processores", tMaterialName + "_" + tDefaultValue, tDefaultValue);
this.mEnabledMaterials.put(tMaterialName, tProperty.getBoolean(tDefaultValue));
}
}
}
@Override
public void run()
{
//TODO Reimplement
/*for (String tMaterialName : this.mEnabledMaterials.keySet())
{
if (this.mEnabledMaterials.get(tMaterialName))
{
Materials.valueOf(tMaterialName).mTypes |= 8;
}
else if ((Materials.valueOf(tMaterialName).mTypes & 8) != 0)
{
Materials.VALUES.valueOf(tMaterialName).mTypes ^= 8;
}
Materials.VALUES.
}*/
}
}