aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/loaders
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/loaders')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/GT_Material_Loader.java292
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java8
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java16
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java60
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_Ex.java5
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java58
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java32
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java42
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java24
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java142
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java44
11 files changed, 525 insertions, 198 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/GT_Material_Loader.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/GT_Material_Loader.java
new file mode 100644
index 0000000000..c57ad71fc7
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/GT_Material_Loader.java
@@ -0,0 +1,292 @@
+package gtPlusPlus.xmod.gregtech.loaders;
+
+import java.lang.reflect.*;
+import java.util.HashMap;
+import java.util.Map;
+
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.array.AutoMap;
+import gtPlusPlus.core.util.materials.MaterialUtils;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
+
+public class GT_Material_Loader {
+
+ private volatile static GT_Material_Loader instance = new GT_Material_Loader();
+ private volatile Object mProxyObject;
+ private static AutoMap<Materials> mMaterials = new AutoMap<Materials>();
+ private static volatile boolean mHasRun = false;
+
+ public synchronized GT_Material_Loader getInstance(){
+ return GT_Material_Loader.instance;
+ }
+
+ public synchronized boolean getRunAbility(){
+ return (mHasRun ? false : true);
+ }
+ public synchronized void setRunAbility(boolean b){
+ mHasRun = Utils.invertBoolean(b);
+ }
+
+ public GT_Material_Loader() {
+ if (getRunAbility()){
+ //Set Singleton Instance
+ instance = this;
+
+ //Try Reflectively add ourselves to the GT loader.
+ try {
+ Class mInterface = Class.forName("gregtech.api.interfaces.IMaterialHandler");
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && mInterface != null){
+
+ //Make this class Dynamically implement IMaterialHandler
+ if (mProxyObject == null){
+ mProxyObject = Proxy.newProxyInstance(
+ mInterface.getClassLoader(), new Class[] { mInterface },
+ new MaterialHandler(getInstance()));
+ }
+
+ if (ReflectionUtils.invoke(Materials.class, "add", new Class[]{Class.forName("gregtech.api.interfaces.IMaterialHandler")}, new Object[]{mProxyObject})){
+ Logger.REFLECTION("Successfully invoked add, on the proxied object implementing IMaterialHandler.");
+
+
+ Logger.REFLECTION("Examining Proxy to ensure it implements the correct Interface.");
+ Class[] i = mProxyObject.getClass().getInterfaces();
+ for (int r=0;r<i.length;r++){
+ Logger.REFLECTION("Contains "+i[r].getCanonicalName()+".");
+ if (i[r] == mInterface){
+ Logger.REFLECTION("Found gregtech.api.interfaces.IMaterialHandler. This Proxy is valid.");
+ }
+ }
+ }
+ else {
+ Logger.REFLECTION("Failed to invoke add, on the proxied object implementing IMaterialHandler.");
+ }
+ }
+ }
+ catch (ClassNotFoundException e) {}
+ //Materials.add(this);
+
+ //Stupid shit running twice, I don't think so.
+ setRunAbility(false);
+ }
+ }
+
+ public void onMaterialsInit() {
+ Logger.DEBUG_MATERIALS("onMaterialsInit()");
+ }
+
+ public void onComponentInit() {
+ Logger.DEBUG_MATERIALS("onComponentInit()");
+ if (!mMaterials.isEmpty()){
+ Logger.DEBUG_MATERIALS("Found "+mMaterials.size()+" materials to re-enable.");
+ for (Materials M : mMaterials.values()){
+ String name = MaterialUtils.getMaterialName(M);
+ Logger.DEBUG_MATERIALS("Trying to enable "+name+".");
+ boolean success = tryEnableAllComponentsForMaterial(M);
+ if (success){
+ Logger.DEBUG_MATERIALS("Success! Enabled "+name+".");
+ }
+ else {
+ Logger.DEBUG_MATERIALS("Failure... Did not enable "+name+".");
+ }
+ }
+ }
+ }
+
+ public void onComponentIteration(Materials aMaterial) {
+ Logger.DEBUG_MATERIALS("onComponentIteration()");
+ }
+
+ public synchronized boolean enableMaterial(Materials m){
+ if (mMaterials.setValue(m)){
+ Logger.DEBUG_MATERIALS("Added "+MaterialUtils.getMaterialName(m)+" to internal Map.");
+ return true;
+ }
+ Logger.DEBUG_MATERIALS("Failed to add "+MaterialUtils.getMaterialName(m)+" to internal Map.");
+ return false;
+ }
+
+
+
+
+
+
+ /*
+ * Static internal handler methods
+ */
+
+ private static synchronized boolean tryEnableMaterial(Materials mMaterial){
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
+ return false;
+ }
+
+ boolean value = ReflectionUtils.setField(mMaterial, "mHasParentMod", true);
+ if (value){
+ Logger.DEBUG_MATERIALS("Set mHasParentMod true for "+mMaterial.mDefaultLocalName);
+ }
+ else {
+ Logger.DEBUG_MATERIALS("Failed to set mHasParentMod true for "+mMaterial.mDefaultLocalName);
+ }
+ return value;
+ }
+
+ private static synchronized boolean tryEnableMaterialPart(OrePrefixes prefix, Materials mMaterial){
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
+ return false;
+ }
+ try {
+ Method enableComponent = Class.forName("gregtech.api.enums.OrePrefixes").getDeclaredMethod("enableComponent", Materials.class);
+ enableComponent.invoke(prefix, mMaterial);
+ Logger.DEBUG_MATERIALS("Enabled "+prefix.name()+" for "+mMaterial.mDefaultLocalName+".");
+ return true;
+ }
+ catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException | ClassNotFoundException error) {
+ Logger.DEBUG_MATERIALS("Failed to enabled "+prefix.name()+" for "+mMaterial.mDefaultLocalName+". Caught "+error.getCause().toString()+".");
+ error.printStackTrace();
+ }
+ Logger.DEBUG_MATERIALS("Did not enable "+prefix.name()+" for "+mMaterial.mDefaultLocalName+". Report this error to Alkalus on Github.");
+ return false;
+ }
+
+ private static synchronized boolean tryEnableAllComponentsForMaterial(Materials material){
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
+ return false;
+ }
+ try {
+ tryEnableMaterial(material);
+ int mValid = 0;
+ for(OrePrefixes ore:OrePrefixes.values()){
+ if (tryEnableMaterialPart(ore, material)){
+ mValid++;
+ }
+ }
+ if (mValid > 0){
+ Logger.DEBUG_MATERIALS("Success - Re-enabled all components for "+MaterialUtils.getMaterialName(material));
+ }
+ else {
+ Logger.DEBUG_MATERIALS("Failure - Did not enable any components for "+MaterialUtils.getMaterialName(material));
+ }
+ return mValid > 0;
+ }
+ catch (SecurityException | IllegalArgumentException e) {
+ Logger.DEBUG_MATERIALS("Total Failure - Unable to re-enable "+MaterialUtils.getMaterialName(material)+". Most likely an IllegalArgumentException, but small chance it's a SecurityException.");
+ return false;
+ }
+ }
+
+
+
+
+
+
+
+
+
+ /**
+ * Special Dynamic Interface Class
+ */
+
+ public class MaterialHandler implements InvocationHandler {
+
+ private final Map<String, Method> methods = new HashMap<String, Method>();
+ private Object target;
+
+ public MaterialHandler(Object target) {
+ Logger.REFLECTION("Created a Proxy Interface which implements IMaterialHandler.");
+ this.target = target;
+ for(Method method: target.getClass().getDeclaredMethods()) {
+ Logger.REFLECTION("Adding "+method.getName()+" to internal method map.");
+ this.methods.put(method.getName(), method);
+ }
+ }
+
+ @Override
+ public Object invoke(Object proxy, Method method, Object[] args)
+ throws Throwable {
+ long start = System.nanoTime();
+ Object result = methods.get(method.getName()).invoke(target, args);
+ long elapsed = System.nanoTime() - start;
+ Logger.INFO("[Debug] Executed "+method.getName()+" in "+elapsed+" ns");
+ return result;
+ }
+ }
+
+
+ /*
+ public static class ProxyListener implements java.lang.reflect.InvocationHandler {
+
+ public static Object IMaterialHandlerProxy;
+
+ ProxyListener(){
+
+ Logger.REFLECTION("Failed setting IMaterialHandler Proxy instance.");
+ }
+
+ //Loading the class at runtime
+ public static void main(String[] args) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException, ClassNotFoundException {
+ Class<?> someInterface = Class.forName("gregtech.api.interfaces.IMaterialHandler");
+ Object instance = Proxy.newProxyInstance(someInterface.getClassLoader(), new Class<?>[]{someInterface}, new InvocationHandler() {
+
+ @Override
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+ //Handle the invocations
+ if(method.getName().equals("onMaterialsInit")){
+ Logger.REFLECTION("Invoked onMaterialsInit() via IMaterialHandler proxy");
+ return 1;
+ }
+ else if(method.getName().equals("onComponentInit")){
+ Logger.REFLECTION("Invoked onComponentInit() via IMaterialHandler proxy");
+ return 2;
+ }
+ else if(method.getName().equals("onComponentIteration")){
+ Logger.REFLECTION("Invoked onComponentIteration() via IMaterialHandler proxy");
+ return 3;
+ }
+ else {
+ return -1;
+ }
+ }
+ });
+ System.out.println(instance.getClass().getDeclaredMethod("someMethod", (Class<?>[])null).invoke(instance, new Object[]{}));
+ }
+
+ private static class MaterialHandler implements InvocationHandler {
+ private final Object original;
+
+ public MaterialHandler(Object original) {
+ this.original = original;
+ }
+
+ @Override
+ public Object invoke(Object proxy, Method method, Object[] args)
+ throws IllegalAccessException, IllegalArgumentException,
+ InvocationTargetException {
+ System.out.println("BEFORE");
+ method.invoke(original, args);
+ System.out.println("AFTER");
+ return null;
+ }
+ }
+
+ public static void init(){
+
+ Class<?> someInterface = Class.forName("gregtech.api.interfaces.IMaterialHandler");
+ GT_Material_Loader original = GT_Material_Loader.instance;
+ MaterialHandler handler = new MaterialHandler(original);
+
+ Object f = Proxy.newProxyInstance(someInterface.getClassLoader(),
+ new Class[] { someInterface },
+ handler);
+
+ f.originalMethod("Hallo");
+ }
+
+
+
+ }
+
+ */
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java
index aff10c9b37..90faa9b83a 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java
@@ -2,8 +2,8 @@ package gtPlusPlus.xmod.gregtech.loaders;
import gregtech.api.enums.TAE;
import gregtech.api.enums.Textures;
+import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.ModBlocks;
-import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks;
import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks2;
@@ -11,10 +11,10 @@ public class Gregtech_Blocks {
public static void run(){
- Utils.LOG_INFO("Expanding Gregtech Texture Array from 128 -> 1024.");
+ Logger.INFO("Expanding Gregtech Texture Array from 128 -> 1024.");
boolean didExpand = TAE.hookGtTextures();
- Utils.LOG_INFO("Did Texture Array expand correctly? "+didExpand);
- Utils.LOG_INFO("|======| Texture Array New Length: "+Textures.BlockIcons.CASING_BLOCKS.length+" |======|");
+ Logger.INFO("Did Texture Array expand correctly? "+didExpand);
+ Logger.INFO("|======| Texture Array New Length: "+Textures.BlockIcons.CASING_BLOCKS.length+" |======|");
//Casing Blocks
ModBlocks.blockCasingsMisc = new GregtechMetaCasingBlocks();
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java
index 190cf416f3..332fa18281 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java
@@ -3,7 +3,7 @@ package gtPlusPlus.xmod.gregtech.loaders;
import gregtech.api.enums.*;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
-import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.util.recipe.RecipeUtils;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
@@ -38,14 +38,14 @@ public class ProcessingToolHeadChoocher implements Interface_OreRecipeRegistrato
public void materialsLoops(){
final Materials[] i = Materials.values();
final int size = i.length;
- Utils.LOG_WARNING("Materials to attempt tool gen. with: "+size);
+ Logger.WARNING("Materials to attempt tool gen. with: "+size);
int used = 0;
Materials aMaterial = null;
for (int r=0;r<size;r++){
aMaterial = i[r];
if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint) && (aMaterial != Materials.Rubber) && (aMaterial != Materials._NULL)) {
if ((!aMaterial.contains(SubTag.WOOD)) && (!aMaterial.contains(SubTag.BOUNCY)) && (!aMaterial.contains(SubTag.NO_SMASHING))&& (!aMaterial.contains(SubTag.TRANSPARENT))&& (!aMaterial.contains(SubTag.FLAMMABLE))&& (!aMaterial.contains(SubTag.MAGICAL))&& (!aMaterial.contains(SubTag.NO_SMELTING))) {
- Utils.LOG_WARNING("Found "+aMaterial.name()+" as a valid Skookum Choocher Material.");
+ Logger.WARNING("Found "+aMaterial.name()+" as a valid Skookum Choocher Material.");
//Input 1
final ItemStack plate = GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L);
final ItemStack ingot = GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L);
@@ -62,27 +62,27 @@ public class ProcessingToolHeadChoocher implements Interface_OreRecipeRegistrato
used++;
}
else {
- Utils.LOG_WARNING(""+aMaterial.name()+" could not be used for all input compoenents. [3x"+aMaterial.name()+" plates, 2x"+aMaterial.name()+" ingots, 1x"+aMaterial.name()+" Hard Hammer Head.");
+ Logger.WARNING(""+aMaterial.name()+" could not be used for all input compoenents. [3x"+aMaterial.name()+" plates, 2x"+aMaterial.name()+" ingots, 1x"+aMaterial.name()+" Hard Hammer Head.");
}
//GT_ModHandler.addCraftingRecipe(, GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"P H", "PIP", " I ", Character.valueOf('I'), OrePrefixes.ingot.get(aMaterial), Character.valueOf('P'), OrePrefixes.plate.get(aMaterial), Character.valueOf('H'), OrePrefixes.toolHeadHammer.get(aMaterial)});
}
else {
- Utils.LOG_WARNING(""+aMaterial.name()+" was not a valid Skookum Choocher Material.");
+ Logger.WARNING(""+aMaterial.name()+" was not a valid Skookum Choocher Material.");
}
}
else {
- Utils.LOG_WARNING(""+aMaterial.name()+" was not a valid Skookum Choocher Material.");
+ Logger.WARNING(""+aMaterial.name()+" was not a valid Skookum Choocher Material.");
}
}
- Utils.LOG_INFO("Materials used for tool gen: "+used);
+ Logger.INFO("Materials used for tool gen: "+used);
}
@Override
public void run() {
- Utils.LOG_INFO("Generating Skookum Choochers of all GT Materials.");
+ Logger.INFO("Generating Skookum Choochers of all GT Materials.");
this.materialsLoops();
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java
index 6d1da0881e..ed8b4b9a82 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java
@@ -4,6 +4,7 @@ import java.util.ArrayList;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
+import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.ALLOY;
@@ -12,7 +13,6 @@ import gtPlusPlus.core.material.MaterialStack;
import gtPlusPlus.core.material.nuclear.FLUORIDES;
import gtPlusPlus.core.material.nuclear.NUCLIDE;
import gtPlusPlus.core.material.state.MaterialState;
-import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.fluid.FluidUtils;
import gtPlusPlus.core.util.item.ItemUtils;
import net.minecraft.item.ItemStack;
@@ -97,7 +97,7 @@ public class RecipeGen_BlastSmelter implements Runnable{
duration = 14*second*mMaterialListSize;
}
- Utils.LOG_WARNING("[BAS] Size: "+mMaterialListSize);
+ Logger.WARNING("[BAS] Size: "+mMaterialListSize);
//Make a simple one Material Materialstack[] and log it for validity.
@@ -105,10 +105,10 @@ public class RecipeGen_BlastSmelter implements Runnable{
final ItemStack[] tItemStackTest = new ItemStack[]{circuitGT, tStack};
inputStackCount = 1;
fluidAmount = 144*inputStackCount;
- Utils.LOG_WARNING("[BAS] Adding an Alloy Blast Smelter Recipe for "+M.getLocalizedName()+". Gives "+fluidAmount+"L of molten metal.");
+ Logger.WARNING("[BAS] Adding an Alloy Blast Smelter Recipe for "+M.getLocalizedName()+". Gives "+fluidAmount+"L of molten metal.");
for (int das=0;das<tItemStackTest.length;das++){
if (tItemStackTest[das] != null) {
- Utils.LOG_WARNING("[BAS] tMaterial["+das+"]: "+tItemStackTest[das].getDisplayName()+" Meta: "+tItemStackTest[das].getItemDamage()+", Amount: "+tItemStackTest[das].stackSize);
+ Logger.WARNING("[BAS] tMaterial["+das+"]: "+tItemStackTest[das].getDisplayName()+" Meta: "+tItemStackTest[das].getItemDamage()+", Amount: "+tItemStackTest[das].stackSize);
}
}
@@ -118,50 +118,50 @@ public class RecipeGen_BlastSmelter implements Runnable{
if (hasMoreInputThanACircuit){
if (M.requiresBlastFurnace()) {
if (CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getFluid(fluidAmount), 100, duration, 240)){
- Utils.LOG_WARNING("[BAS] Success.");
- Utils.LOG_WARNING("[BAS] Success, Also added a Fluid solidifier recipe.");
+ Logger.WARNING("[BAS] Success.");
+ Logger.WARNING("[BAS] Success, Also added a Fluid solidifier recipe.");
if (GT_Values.RA.addFluidExtractionRecipe(M.getIngot(1), null, M.getFluid(144), 100, duration, 120)){
- Utils.LOG_WARNING("[BAS] Success, Also added a Fluid Extractor recipe.");
+ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe.");
}
if (GT_Values.RA.addFluidExtractionRecipe(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("nugget"+M.getUnlocalizedName(), 1), null, M.getFluid(16), 100, duration/9, 120)){
- Utils.LOG_WARNING("[BAS] Success, Also added a Fluid Extractor recipe.");
+ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe.");
}
if (GT_Values.RA.addFluidExtractionRecipe(M.getSmallDust(1), null, M.getFluid(36), 100, duration/4, 120)){
- Utils.LOG_WARNING("[BAS] Success, Also added a Fluid Extractor recipe.");
+ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe.");
}
if (GT_Values.RA.addFluidExtractionRecipe(M.getTinyDust(1), null, M.getFluid(16), 100, duration/9, 120)){
- Utils.LOG_WARNING("[BAS] Success, Also added a Fluid Extractor recipe.");
+ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe.");
}
}
}
else {
- Utils.LOG_WARNING("[BAS] Failed.");
+ Logger.WARNING("[BAS] Failed.");
}
}
else {
if (CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getFluid(fluidAmount), 100, duration/2, 120)){
- Utils.LOG_WARNING("[BAS] Success.");
+ Logger.WARNING("[BAS] Success.");
if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), M.getFluid(144), M.getIngot(1), duration/2, 60)){
- Utils.LOG_WARNING("[BAS] Success, Also added a Fluid solidifier recipe.");
+ Logger.WARNING("[BAS] Success, Also added a Fluid solidifier recipe.");
if (GT_Values.RA.addFluidExtractionRecipe(M.getIngot(1), null, M.getFluid(144), 100, duration/2, 60)){
- Utils.LOG_WARNING("[BAS] Success, Also added a Fluid Extractor recipe.");
+ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe.");
}
final ItemStack tempitem = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("nugget"+M.getUnlocalizedName(), 1);
if (tempitem != null){
if (GT_Values.RA.addFluidExtractionRecipe(tempitem, null, M.getFluid(16), 100, duration/2/9, 60)){
- Utils.LOG_WARNING("[BAS] Success, Also added a Fluid Extractor recipe.");
+ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe.");
}
}
if (GT_Values.RA.addFluidExtractionRecipe(M.getSmallDust(1), null, M.getFluid(36), 100, duration/2/4, 60)){
- Utils.LOG_WARNING("[BAS] Success, Also added a Fluid Extractor recipe.");
+ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe.");
}
if (GT_Values.RA.addFluidExtractionRecipe(M.getTinyDust(1), null, M.getFluid(16), 100, duration/2/9, 60)){
- Utils.LOG_WARNING("[BAS] Success, Also added a Fluid Extractor recipe.");
+ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe.");
}
}
}
else {
- Utils.LOG_WARNING("[BAS] Failed.");
+ Logger.WARNING("[BAS] Failed.");
}
}
@@ -184,8 +184,8 @@ public class RecipeGen_BlastSmelter implements Runnable{
for (final gtPlusPlus.core.material.MaterialStack xMaterial : M.getComposites()){
if (xMaterial != null){
if (xMaterial.getStackMaterial() != null){
- Utils.LOG_WARNING("[BAS] FOUND: "+xMaterial.getStackMaterial().getLocalizedName());
- Utils.LOG_WARNING("[BAS] ADDING: "+xMaterial.getStackMaterial().getLocalizedName());
+ Logger.WARNING("[BAS] FOUND: "+xMaterial.getStackMaterial().getLocalizedName());
+ Logger.WARNING("[BAS] ADDING: "+xMaterial.getStackMaterial().getLocalizedName());
}
tempStack[ooo] = xMaterial;
}
@@ -227,45 +227,45 @@ public class RecipeGen_BlastSmelter implements Runnable{
components[fr] = components_NoCircuit[fr-1];
}
}
- Utils.LOG_WARNING("[BAS] Should have added a circuit. mMaterialListSize: "+mMaterialListSize+" | circuit: "+components[0].getDisplayName());
+ Logger.WARNING("[BAS] Should have added a circuit. mMaterialListSize: "+mMaterialListSize+" | circuit: "+components[0].getDisplayName());
}
else {
- Utils.LOG_WARNING("[BAS] Did not add a circuit. mMaterialListSize: "+mMaterialListSize);
+ Logger.WARNING("[BAS] Did not add a circuit. mMaterialListSize: "+mMaterialListSize);
}
//Set Fluid output
fluidAmount = 144*inputStackCount;
- Utils.LOG_WARNING("[BAS] Adding an Alloy Blast Smelter Recipe for "+M.getLocalizedName()+" using it's compound dusts. This material has "+ inputStackCount+" parts. Gives "+fluidAmount+"L of molten metal.");
- Utils.LOG_WARNING("[BAS] tMaterial.length: "+components.length+".");
+ Logger.WARNING("[BAS] Adding an Alloy Blast Smelter Recipe for "+M.getLocalizedName()+" using it's compound dusts. This material has "+ inputStackCount+" parts. Gives "+fluidAmount+"L of molten metal.");
+ Logger.WARNING("[BAS] tMaterial.length: "+components.length+".");
for (int das=0;das<components.length;das++){
if (components[das] != null) {
- Utils.LOG_WARNING("[BAS] tMaterial["+das+"]: "+components[das].getDisplayName()+" Meta: "+components[das].getItemDamage()+", Amount: "+components[das].stackSize);
+ Logger.WARNING("[BAS] tMaterial["+das+"]: "+components[das].getDisplayName()+" Meta: "+components[das].getItemDamage()+", Amount: "+components[das].stackSize);
}
}
//Adds Recipe
if (M.requiresBlastFurnace()) {
if (CORE.RA.addBlastSmelterRecipe(components, componentsFluid, M.getFluid(fluidAmount), 100, duration, 500)){
- Utils.LOG_WARNING("[BAS] Success.");
+ Logger.WARNING("[BAS] Success.");
}
else {
- Utils.LOG_WARNING("[BAS] Failed.");
+ Logger.WARNING("[BAS] Failed.");
}
}
else {
if (CORE.RA.addBlastSmelterRecipe(components, componentsFluid, M.getFluid(fluidAmount), 100, duration, 240)){
- Utils.LOG_WARNING("[BAS] Success.");
+ Logger.WARNING("[BAS] Success.");
}
else {
- Utils.LOG_WARNING("[BAS] Failed.");
+ Logger.WARNING("[BAS] Failed.");
}
}
}
}
}
else {
- Utils.LOG_WARNING("[BAS] doTest: "+doTest+" | tMaterial != null: "+(tMaterial != null));
+ Logger.WARNING("[BAS] doTest: "+doTest+" | tMaterial != null: "+(tMaterial != null));
}
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_Ex.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_Ex.java
index 873987544a..ee5ac63f38 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_Ex.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_Ex.java
@@ -2,9 +2,7 @@ package gtPlusPlus.xmod.gregtech.loaders;
import gregtech.api.enums.*;
import gregtech.api.interfaces.IOreRecipeRegistrator;
-import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.api.util.GT_Utility;
+import gregtech.api.util.*;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.core.util.math.MathUtils;
@@ -30,6 +28,7 @@ public class RecipeGen_BlastSmelterGT_Ex implements IOreRecipeRegistrator {
for (OrePrefixes tPrefix : this.mSmeltingPrefixes) tPrefix.add(this);
}
+ @Override
public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) {
boolean keepHighTempRecipes = !CORE.GTNH;
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java
index 46bf36c445..426b73f0d8 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java
@@ -2,10 +2,10 @@ package gtPlusPlus.xmod.gregtech.loaders;
import gregtech.api.enums.GT_Values;
import gregtech.api.util.GT_ModHandler;
+import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.material.MaterialStack;
import gtPlusPlus.core.material.state.MaterialState;
-import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.core.util.recipe.RecipeUtils;
import net.minecraft.item.ItemStack;
@@ -31,7 +31,7 @@ public class RecipeGen_DustGeneration implements Runnable{
public static void generateRecipes(final Material material, final boolean disableOptional){
final int tVoltageMultiplier = material.getMeltingPointK() >= 2800 ? 60 : 15;
- Utils.LOG_WARNING("Generating Shaped Crafting recipes for "+material.getLocalizedName()); //TODO
+ Logger.WARNING("Generating Shaped Crafting recipes for "+material.getLocalizedName()); //TODO
//Ring Recipe
if (RecipeUtils.addShapedGregtechRecipe(
@@ -39,10 +39,10 @@ public class RecipeGen_DustGeneration implements Runnable{
null, material.getRod(1), null,
null, null, null,
material.getRing(1))){
- Utils.LOG_WARNING("Ring Recipe: "+material.getLocalizedName()+" - Success");
+ Logger.WARNING("Ring Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Utils.LOG_WARNING("Ring Recipe: "+material.getLocalizedName()+" - Failed");
+ Logger.WARNING("Ring Recipe: "+material.getLocalizedName()+" - Failed");
}
@@ -58,10 +58,10 @@ public class RecipeGen_DustGeneration implements Runnable{
tinyDust, tinyDust, tinyDust,
tinyDust, tinyDust, tinyDust,
normalDust)){
- Utils.LOG_WARNING("9 Tiny dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Success");
+ Logger.WARNING("9 Tiny dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Utils.LOG_WARNING("9 Tiny dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Failed");
+ Logger.WARNING("9 Tiny dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Failed");
}
if (RecipeUtils.recipeBuilder(
@@ -69,10 +69,10 @@ public class RecipeGen_DustGeneration implements Runnable{
null, null, null,
null, null, null,
material.getTinyDust(9))){
- Utils.LOG_WARNING("9 Tiny dust from 1 Recipe: "+material.getLocalizedName()+" - Success");
+ Logger.WARNING("9 Tiny dust from 1 Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Utils.LOG_WARNING("9 Tiny dust from 1 Recipe: "+material.getLocalizedName()+" - Failed");
+ Logger.WARNING("9 Tiny dust from 1 Recipe: "+material.getLocalizedName()+" - Failed");
}
@@ -81,10 +81,10 @@ public class RecipeGen_DustGeneration implements Runnable{
smallDust, smallDust, null,
null, null, null,
normalDust)){
- Utils.LOG_WARNING("4 Small dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Success");
+ Logger.WARNING("4 Small dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Utils.LOG_WARNING("4 Small dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Failed");
+ Logger.WARNING("4 Small dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Failed");
}
@@ -93,10 +93,10 @@ public class RecipeGen_DustGeneration implements Runnable{
null, null, null,
null, null, null,
material.getSmallDust(4))){
- Utils.LOG_WARNING("4 Small dust from 1 Dust Recipe: "+material.getLocalizedName()+" - Success");
+ Logger.WARNING("4 Small dust from 1 Dust Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Utils.LOG_WARNING("4 Small dust from 1 Dust Recipe: "+material.getLocalizedName()+" - Failed");
+ Logger.WARNING("4 Small dust from 1 Dust Recipe: "+material.getLocalizedName()+" - Failed");
}
//Macerate blocks back to dusts.
@@ -114,12 +114,12 @@ public class RecipeGen_DustGeneration implements Runnable{
//Is this a composite?
if ((inputStacks != null) && !disableOptional){
//Is this a composite?
- Utils.LOG_INFO("mixer length: "+inputStacks.length);
+ Logger.WARNING("mixer length: "+inputStacks.length);
if ((inputStacks.length != 0) && (inputStacks.length <= 4)){
//Log Input items
- Utils.LOG_WARNING(ItemUtils.getArrayStackNames(inputStacks));
+ Logger.WARNING(ItemUtils.getArrayStackNames(inputStacks));
final long[] inputStackSize = material.vSmallestRatio;
- Utils.LOG_INFO("mixer is stacksizeVar null? "+(inputStackSize != null));
+ Logger.WARNING("mixer is stacksizeVar null? "+(inputStackSize != null));
//Is smallest ratio invalid?
if (inputStackSize != null){
//set stack sizes on an input ItemStack[]
@@ -129,7 +129,7 @@ public class RecipeGen_DustGeneration implements Runnable{
}
}
//Relog input values, with stack sizes
- Utils.LOG_WARNING(ItemUtils.getArrayStackNames(inputStacks));
+ Logger.WARNING(ItemUtils.getArrayStackNames(inputStacks));
//Get us four ItemStacks to input into the mixer
ItemStack input1, input2, input3, input4;
@@ -168,19 +168,19 @@ public class RecipeGen_DustGeneration implements Runnable{
(int) Math.max(material.getMass() * 2L * 1, 1),
2 * material.vVoltageMultiplier)) //Was 6, but let's try 2. This makes Potin LV, for example.
{
- Utils.LOG_INFO("Dust Mixer Recipe: "+material.getLocalizedName()+" - Success");
+ Logger.WARNING("Dust Mixer Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Utils.LOG_INFO("Dust Mixer Recipe: "+material.getLocalizedName()+" - Failed");
+ Logger.WARNING("Dust Mixer Recipe: "+material.getLocalizedName()+" - Failed");
}
//Add Shapeless recipe for low tier alloys.
if (tVoltageMultiplier <= 30){
if (RecipeUtils.addShapedGregtechRecipe(inputStacks, outputStacks)){
- Utils.LOG_INFO("Dust Shapeless Recipe: "+material.getLocalizedName()+" - Success");
+ Logger.WARNING("Dust Shapeless Recipe: "+material.getLocalizedName()+" - Success");
}
else {
- Utils.LOG_INFO("Dust Shapeless Recipe: "+material.getLocalizedName()+" - Failed");
+ Logger.WARNING("Dust Shapeless Recipe: "+material.getLocalizedName()+" - Failed");
}
}
}
@@ -200,12 +200,12 @@ public class RecipeGen_DustGeneration implements Runnable{
//Is this a composite?
if ((inputStacks != null)){
//Is this a composite?
- Utils.LOG_INFO("mixer length: "+inputStacks.length);
+ Logger.WARNING("mixer length: "+inputStacks.length);
if ((inputStacks.length >= 1) && (inputStacks.length <= 4)){
//Log Input items
- Utils.LOG_WARNING(ItemUtils.getArrayStackNames(inputStacks));
+ Logger.WARNING(ItemUtils.getArrayStackNames(inputStacks));
final long[] inputStackSize = material.vSmallestRatio;
- Utils.LOG_INFO("mixer is stacksizeVar not null? "+(inputStackSize != null));
+ Logger.WARNING("mixer is stacksizeVar not null? "+(inputStackSize != null));
//Is smallest ratio invalid?
if (inputStackSize != null){
//set stack sizes on an input ItemStack[]
@@ -215,7 +215,7 @@ public class RecipeGen_DustGeneration implements Runnable{
}
}
//Relog input values, with stack sizes
- Utils.LOG_INFO(ItemUtils.getArrayStackNames(inputStacks));
+ Logger.WARNING(ItemUtils.getArrayStackNames(inputStacks));
//Get us four ItemStacks to input into the mixer
ItemStack input1, input2, input3, input4;
@@ -254,24 +254,24 @@ public class RecipeGen_DustGeneration implements Runnable{
(int) Math.max(material.getMass() * 2L * 1, 1),
2 * material.vVoltageMultiplier)) //Was 6, but let's try 2. This makes Potin LV, for example.
{
- Utils.LOG_INFO("Dust Mixer Recipe: "+material.getLocalizedName()+" - Success");
+ Logger.WARNING("Dust Mixer Recipe: "+material.getLocalizedName()+" - Success");
return true;
}
else {
- Utils.LOG_INFO("Dust Mixer Recipe: "+material.getLocalizedName()+" - Failed");
+ Logger.WARNING("Dust Mixer Recipe: "+material.getLocalizedName()+" - Failed");
return false;
}
}
else {
- Utils.LOG_INFO("inputStackSize == NUll - "+material.getLocalizedName());
+ Logger.WARNING("inputStackSize == NUll - "+material.getLocalizedName());
}
}
else {
- Utils.LOG_INFO("InputStacks is out range 1-4 - "+material.getLocalizedName());
+ Logger.WARNING("InputStacks is out range 1-4 - "+material.getLocalizedName());
}
}
else {
- Utils.LOG_INFO("InputStacks == NUll - "+material.getLocalizedName());
+ Logger.WARNING("InputStacks == NUll - "+material.getLocalizedName());
}
return false;
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java
index 5cf36796bb..198c22fb8e 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java
+++ b/src/Jav