General cleanup & MaterialProcessing
This commit is contained in:
parent
96b402648b
commit
a0066b4a26
11 changed files with 810 additions and 727 deletions
|
@ -241,16 +241,6 @@ public class GT_Mod
|
|||
GregTech_API.mRFExplosions = GregTech_API.sOPStuff.get(ConfigCategories.general, "RFExplosions", false);
|
||||
GregTech_API.meIOLoaded = Loader.isModLoaded("EnderIO");
|
||||
|
||||
gregtechproxy.mChangeHarvestLevels = GregTech_API.sMaterialProperties.get("havestLevel", "activateHarvestLevelChange", false);
|
||||
if(gregtechproxy.mChangeHarvestLevels){
|
||||
gregtechproxy.mGraniteHavestLevel = (int) GregTech_API.sMaterialProperties.get("havestLevel", "graniteHarvestLevel", 3);
|
||||
gregtechproxy.mMaxHarvestLevel=(int) Math.min(15, GregTech_API.sMaterialProperties.get("havestLevel", "maxLevel",7));
|
||||
for(Materials tMaterial : Materials.MATERIALS.values()){
|
||||
if(tMaterial!=null&&tMaterial.mToolQuality>0&&tMaterial.mMetaItemSubID<gregtechproxy.mHarvestLevel.length&&tMaterial.mMetaItemSubID>=0){
|
||||
gregtechproxy.mHarvestLevel[tMaterial.mMetaItemSubID] = GregTech_API.sMaterialProperties.get("materialHavestLevel", tMaterial.mDefaultLocalName,tMaterial.mToolQuality);
|
||||
}
|
||||
}}
|
||||
|
||||
if (tMainConfig.get("general", "hardermobspawners", true).getBoolean(true)) {
|
||||
Blocks.mob_spawner.setHardness(500.0F).setResistance(6000000.0F);
|
||||
}
|
||||
|
@ -269,11 +259,8 @@ public class GT_Mod
|
|||
}
|
||||
}
|
||||
//GT_Config.troll = (Calendar.getInstance().get(2) + 1 == 4) && (Calendar.getInstance().get(5) >= 1) && (Calendar.getInstance().get(5) <= 2);
|
||||
Materials Muranium = new Materials(378, TextureSet.SET_NONE, 1.0F, 0, 2, 1|2|4|8|16|32|64|128, 92, 0, 168, 0, "Muranium", 0, 0, -1, 0, false, false, 3, 1, 1, Dyes._NULL, "takpak");
|
||||
//SubTag.METAL.addTo(Muranium);
|
||||
Materials.initCustomMaterials();
|
||||
Materials.initMaterialProperties();
|
||||
Materials.initGeneratedMaterials();
|
||||
new GT_Loader_MaterialProcessing().run();
|
||||
Materials.init();
|
||||
|
||||
GT_Log.out.println("GT_Mod: Saving Main Config");
|
||||
tMainConfig.save();
|
||||
|
@ -646,7 +633,7 @@ public class GT_Mod
|
|||
GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.Tool_DataOrb.getWithName(1L, "Orb to overwrite", new Object[0])}, new ItemStack[]{ItemList.Tool_DataOrb.getWithName(1L, "Copy of the Orb", new Object[0])}, ItemList.Tool_DataOrb.getWithName(0L, "Orb to copy", new Object[0]), null, null, 512, 32, 0);
|
||||
GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Stick to overwrite", new Object[0])}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Copy of the Stick", new Object[0])}, ItemList.Tool_DataStick.getWithName(0L, "Stick to copy", new Object[0]), null, null, 128, 32, 0);
|
||||
GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(false, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Raw Prospection Data", new Object[0])}, new ItemStack[]{ItemList.Tool_DataStick.getWithName(1L, "Analyzed Prospection Data", new Object[0])}, null, null, null, 1000, 32, 0);
|
||||
for (Materials tMaterial : Materials.MATERIALS.values()) {
|
||||
for (Materials tMaterial : Materials.values()) {
|
||||
if ((tMaterial.mElement != null) && (!tMaterial.mElement.mIsIsotope) && (tMaterial != Materials.Magic) && (tMaterial.getMass() > 0L)) {
|
||||
ItemStack tOutput = ItemList.Tool_DataOrb.get(1L, new Object[0]);
|
||||
Behaviour_DataOrb.setDataTitle(tOutput, "Elemental-Scan");
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,5 @@
|
|||
package gregtech.api.interfaces;
|
||||
|
||||
public interface IMaterialRegistrator {
|
||||
void onMaterialsInit();
|
||||
}
|
|
@ -492,7 +492,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
|
|||
GT_Log.out.println("GT_Mod: Adding Tool Usage Crafting Recipes for OreDict Items.");
|
||||
long tBits = GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED
|
||||
| GT_ModHandler.RecipeBits.ONLY_ADD_IF_RESULT_IS_NOT_NULL | GT_ModHandler.RecipeBits.NOT_REMOVABLE;
|
||||
for (Materials aMaterial : Materials.MATERIALS.values()) {
|
||||
for (Materials aMaterial : Materials.values()) {
|
||||
if ((aMaterial.mUnificatable) && (aMaterial.mMaterialInto == aMaterial)) {
|
||||
if (!aMaterial.contains(SubTag.NO_SMASHING)) {
|
||||
if (GregTech_API.sRecipeFile.get(ConfigCategories.Tools.hammerplating, aMaterial.toString(), true)) {
|
||||
|
|
|
@ -13,8 +13,6 @@ import gregtech.common.items.behaviors.Behaviour_DataOrb;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
public class GT_MetaTileEntity_Replicator
|
||||
extends GT_MetaTileEntity_BasicMachine {
|
||||
private static int sHeaviestElementMass = 0;
|
||||
|
@ -83,12 +81,13 @@ public class GT_MetaTileEntity_Replicator
|
|||
|
||||
public int getCapacity() {
|
||||
if ((sHeaviestElementMass == 0) && (GregTech_API.sPostloadFinished)) {
|
||||
Materials tMaterial;
|
||||
for (Materials aMaterial : Materials.values()) sHeaviestElementMass = Math.max(sHeaviestElementMass, (int) aMaterial.getMass());
|
||||
/*Materials tMaterial;
|
||||
for (Iterator i$ = Materials.MATERIALS.values().iterator(); i$.hasNext(); sHeaviestElementMass = Math.max(sHeaviestElementMass, (int) tMaterial.getMass())) {
|
||||
tMaterial = (Materials) i$.next();
|
||||
if ((tMaterial.mElement == null) || (tMaterial.mElement.mIsIsotope)) {
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
return sHeaviestElementMass;
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ import java.util.Iterator;
|
|||
public class GT_ItemIterator
|
||||
implements Runnable {
|
||||
public void run() {
|
||||
System.out.println("##### Started Item Iter");
|
||||
GT_Log.out.println("GT_Mod: Scanning for certain kinds of compatible Machineblocks.");
|
||||
ItemStack tStack2;
|
||||
ItemStack tStack;
|
||||
|
@ -180,7 +181,9 @@ public class GT_ItemIterator
|
|||
GT_OreDictUnificator.registerOre("bookThaumonomicon", new ItemStack(tItem, 1, 32767));
|
||||
}
|
||||
if (tName.equals("item.ligniteCoal")) {
|
||||
System.out.println("#### Started Lignite");
|
||||
GT_OreDictUnificator.set(OrePrefixes.gem, Materials.Lignite, new ItemStack(tItem, 1, 0));
|
||||
System.out.println("#### Ended Lignite");
|
||||
}
|
||||
if ((tName.equals("tile.extrabiomes.redrock")) || (tName.equals("tile.bop.redRocks"))) {
|
||||
GT_OreDictUnificator.registerOre(OrePrefixes.stone, Materials.Redrock, new ItemStack(tItem, 1, 0));
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
package gregtech.loaders.materialprocessing;
|
||||
|
||||
import gregtech.api.GregTech_API;
|
||||
import gregtech.api.enums.Dyes;
|
||||
import gregtech.api.enums.Materials;
|
||||
import gregtech.api.enums.TextureSet;
|
||||
|
||||
public class ProcessingConfig implements gregtech.api.interfaces.IMaterialRegistrator {
|
||||
public ProcessingConfig() {
|
||||
Materials.add(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMaterialsInit() {
|
||||
int i = 0;
|
||||
for (int j = GregTech_API.sMaterialProperties.get("general", "AmountOfCustomMaterialSlots", 16); i < j; i++) {
|
||||
String aID = (i < 10 ? "0" : "") + i;
|
||||
new Materials(-1, TextureSet.SET_METALLIC, 1.0F, 0, 0, 0, 255, 255, 255, 0, "CustomMat" + aID, 0, 0, 0, 0, false, false, 1, 1, 1, Dyes._NULL, "custom", true, aID);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package gregtech.loaders.materialprocessing;
|
||||
|
||||
import gregtech.api.GregTech_API;
|
||||
import gregtech.api.enums.Dyes;
|
||||
import gregtech.api.enums.Materials;
|
||||
import gregtech.api.enums.TextureSet;
|
||||
|
||||
public class ProcessingTest implements gregtech.api.interfaces.IMaterialRegistrator {
|
||||
public ProcessingTest() {
|
||||
Materials.add(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Just a test class to fill the empty spaces in sGeneratedMaterials for performance testing.
|
||||
* This is disabled in GT_Loader_MaterialProcessing, but can be enabled for testing.
|
||||
*/
|
||||
@Override
|
||||
public void onMaterialsInit() {
|
||||
for (int i = 0; i < GregTech_API.sGeneratedMaterials.length; i++) {
|
||||
if (!Materials.USED_IDS.contains(i)) {
|
||||
new Materials(i, TextureSet.SET_NONE, 1.0F, 0, 2, 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128, 92, 0, 168, 0, "TestMat" + i, 0, 0, -1, 0, false, false, 3, 1, 1, Dyes._NULL, "testmat");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -410,7 +410,7 @@ if(Loader.isModLoaded("Railcraft")){
|
|||
GT_Values.RA.addFormingPressRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Lazurite, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Glowstone, 1L), ItemList.Circuit_Parts_Advanced.get(2L, new Object[0]), 32, 64);
|
||||
GT_Values.RA.addFormingPressRecipe(ItemList.Food_Dough_Sugar.get(4L, new Object[0]), ItemList.Shape_Mold_Cylinder.get(0L, new Object[0]), ItemList.Food_Raw_Cake.get(1L, new Object[0]), 384, 4);
|
||||
GT_Values.RA.addFormingPressRecipe(new ItemStack(Blocks.glass, 1, 32767), ItemList.Shape_Mold_Arrow.get(0L, new Object[0]), ItemList.Arrow_Head_Glass_Emtpy.get(1L, new Object[0]), 64, 4);
|
||||
for (Materials tMat : Materials.MATERIALS.values()) {
|
||||
for (Materials tMat : Materials.values()) {
|
||||
if ((tMat.mStandardMoltenFluid != null) && (tMat.contains(SubTag.SOLDERING_MATERIAL))) {
|
||||
int tMultiplier = tMat.contains(SubTag.SOLDERING_MATERIAL_GOOD) ? 1 : tMat.contains(SubTag.SOLDERING_MATERIAL_BAD) ? 4 : 2;
|
||||
|
||||
|
|
|
@ -462,7 +462,7 @@ public class GT_Loader_Item_Block_And_Fluid
|
|||
GT_Mod.gregtechproxy.addFluid("molten.redstone", "Molten Redstone", Materials.Redstone, 4, 500);
|
||||
GT_Mod.gregtechproxy.addFluid("molten.blaze", "Molten Blaze", Materials.Blaze, 4, 6400);
|
||||
GT_Mod.gregtechproxy.addFluid("molten.concrete", "Wet Concrete", Materials.Concrete, 4, 300);
|
||||
for (Materials tMaterial : Materials.MATERIALS.values()) {
|
||||
for (Materials tMaterial : Materials.values()) {
|
||||
if ((tMaterial.mStandardMoltenFluid == null) && (tMaterial.contains(SubTag.SMELTING_TO_FLUID)) && (!tMaterial.contains(SubTag.NO_SMELTING))) {
|
||||
GT_Mod.gregtechproxy.addAutogeneratedMoltenFluid(tMaterial);
|
||||
if ((tMaterial.mSmeltInto != tMaterial) && (tMaterial.mSmeltInto.mStandardMoltenFluid == null)) {
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
package gregtech.loaders.preload;
|
||||
|
||||
import gregtech.api.util.GT_Log;
|
||||
import gregtech.loaders.materialprocessing.ProcessingConfig;
|
||||
|
||||
public class GT_Loader_MaterialProcessing implements Runnable {
|
||||
public void run() {
|
||||
GT_Log.out.println("GT_Mod: Register Material processing.");
|
||||
new ProcessingConfig();
|
||||
//new ProcessingTest();
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue