diff options
author | Jordan Byrne <draknyte1@hotmail.com> | 2017-12-24 11:54:30 +1000 |
---|---|---|
committer | Jordan Byrne <draknyte1@hotmail.com> | 2017-12-24 11:54:30 +1000 |
commit | ecf908e98ccee72a713091e8ab547e35a41d7436 (patch) | |
tree | f0dade1481aa02fd0ac4fcf8a672cc7a761a0547 /src/Java/gtPlusPlus/xmod/gregtech/loaders | |
parent | b9fe3352840abe0846834cefd578895ec6f5e520 (diff) | |
parent | fa5de3584ce7bc97ce6f32b31f6062b5b6e89e75 (diff) | |
download | GT5-Unofficial-ecf908e98ccee72a713091e8ab547e35a41d7436.tar.gz GT5-Unofficial-ecf908e98ccee72a713091e8ab547e35a41d7436.tar.bz2 GT5-Unofficial-ecf908e98ccee72a713091e8ab547e35a41d7436.zip |
> Why does Git make me do these? arghhh...
Merge branch 'master' of https://github.com/draknyte1/GTplusplus
# Conflicts:
# src/Java/gtPlusPlus/core/material/ALLOY.java
# src/Java/gtPlusPlus/core/material/ELEMENT.java
# src/Java/gtPlusPlus/core/material/Material.java
# src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/loaders')
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/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java @@ -3,8 +3,8 @@ package gtPlusPlus.xmod.gregtech.loaders; import gregtech.api.GregTech_API; import gregtech.api.enums.ItemList; import gregtech.api.util.GT_Recipe; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.util.Utils; import net.minecraft.item.ItemStack; public class RecipeGen_Extruder implements Runnable{ @@ -35,7 +35,7 @@ public class RecipeGen_Extruder implements Runnable{ final ItemStack shape_Block = ItemList.Shape_Extruder_Block.get(0); final ItemStack shape_Ingot = ItemList.Shape_Extruder_Ingot.get(0); - Utils.LOG_WARNING("Generating Extruder recipes for "+material.getLocalizedName()); + Logger.WARNING("Generating Extruder recipes for "+material.getLocalizedName()); //Ingot Recipe if (addExtruderRecipe( @@ -44,10 +44,10 @@ public class RecipeGen_Extruder implements Runnable{ material.getIngot(9), (int) Math.max(material.getMass() * 2L * 1, 1), 4 * material.vVoltageMultiplier)){ - Utils.LOG_WARNING("Extruder Ingot Recipe: "+material.getLocalizedName()+" - Success"); + Logger.WARNING("Extruder Ingot Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_WARNING("Extruder Ingot Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING("Extruder Ingot Recipe: "+material.getLocalizedName()+" - Failed"); } //Block Recipe @@ -57,10 +57,10 @@ public class RecipeGen_Extruder implements Runnable{ material.getBlock(1), (int) Math.max(material.getMass() * 2L * 1, 1), 8 * material.vVoltageMultiplier)){ - Utils.LOG_WARNING("Extruder Block Recipe: "+material.getLocalizedName()+" - Success"); + Logger.WARNING("Extruder Block Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_WARNING("Extruder Block Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING("Extruder Block Recipe: "+material.getLocalizedName()+" - Failed"); } //Plate Recipe @@ -69,10 +69,10 @@ public class RecipeGen_Extruder implements Runnable{ shape_Plate, plate_Single, 10, 4 * tVoltageMultiplier)){ - Utils.LOG_WARNING("Extruder Plate Recipe: "+material.getLocalizedName()+" - Success"); + Logger.WARNING("Extruder Plate Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_WARNING("Extruder Plate Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING("Extruder Plate Recipe: "+material.getLocalizedName()+" - Failed"); } //Ring Recipe @@ -83,10 +83,10 @@ public class RecipeGen_Extruder implements Runnable{ material.getRing(4), (int) Math.max(material.getMass() * 2L * 1, 1), 6 * material.vVoltageMultiplier)){ - Utils.LOG_WARNING("Extruder Ring Recipe: "+material.getLocalizedName()+" - Success"); + Logger.WARNING("Extruder Ring Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_WARNING("Extruder Ring Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING("Extruder Ring Recipe: "+material.getLocalizedName()+" - Failed"); } } @@ -99,10 +99,10 @@ public class RecipeGen_Extruder implements Runnable{ itemGear, (int) Math.max(material.getMass() * 5L, 1), 8 * material.vVoltageMultiplier)){ - Utils.LOG_WARNING("Extruder Gear Recipe: "+material.getLocalizedName()+" - Success"); + Logger.WARNING("Extruder Gear Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_WARNING("Extruder Gear Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING("Extruder Gear Recipe: "+material.getLocalizedName()+" - Failed"); } } @@ -114,10 +114,10 @@ public class RecipeGen_Extruder implements Runnable{ material.getRod(2), (int) Math.max(material.getMass() * 2L * 1, 1), 6 * material.vVoltageMultiplier)){ - Utils.LOG_WARNING("Extruder Rod Recipe: "+material.getLocalizedName()+" - Success"); + Logger.WARNING("Extruder Rod Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_WARNING("Extruder Rod Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING("Extruder Rod Recipe: "+material.getLocalizedName()+" - Failed"); } @@ -129,10 +129,10 @@ public class RecipeGen_Extruder implements Runnable{ material.getBolt(8), (int) Math.max(material.getMass() * 2L * 1, 1), 6 * material.vVoltageMultiplier)){ - Utils.LOG_WARNING("Extruder Bolt Recipe: "+material.getLocalizedName()+" - Success"); + Logger.WARNING("Extruder Bolt Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_WARNING("Extruder Bolt Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING("Extruder Bolt Recipe: "+material.getLocalizedName()+" - Failed"); } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java index 1b9247ee3e..5388f68146 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java @@ -2,8 +2,8 @@ package gtPlusPlus.xmod.gregtech.loaders; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.util.Utils; public class RecipeGen_Fluids implements Runnable{ @@ -48,10 +48,10 @@ public class RecipeGen_Fluids implements Runnable{ 1*20, //Duration 16 //Eu Tick )){ - Utils.LOG_WARNING("144l fluid extractor from 1 ingot Recipe: "+material.getLocalizedName()+" - Success"); + Logger.WARNING("144l fluid extractor from 1 ingot Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_WARNING("144l fluid extractor from 1 ingot Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING("144l fluid extractor from 1 ingot Recipe: "+material.getLocalizedName()+" - Failed"); } //Plate @@ -62,10 +62,10 @@ public class RecipeGen_Fluids implements Runnable{ 1*20, //Duration 16 //Eu Tick )){ - Utils.LOG_WARNING("144l fluid extractor from 1 plate Recipe: "+material.getLocalizedName()+" - Success"); + Logger.WARNING("144l fluid extractor from 1 plate Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_WARNING("144l fluid extractor from 1 plate Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING("144l fluid extractor from 1 plate Recipe: "+material.getLocalizedName()+" - Failed"); } //Double Plate @@ -76,10 +76,10 @@ public class RecipeGen_Fluids implements Runnable{ 1*20, //Duration 16 //Eu Tick )){ - Utils.LOG_WARNING("144l fluid extractor from 1 double plate Recipe: "+material.getLocalizedName()+" - Success"); + Logger.WARNING("144l fluid extractor from 1 double plate Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_WARNING("144l fluid extractor from 1 double plate Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING("144l fluid extractor from 1 double plate Recipe: "+material.getLocalizedName()+" - Failed"); } //Nugget @@ -90,10 +90,10 @@ public class RecipeGen_Fluids implements Runnable{ 16, //Duration 8 //Eu Tick )){ - Utils.LOG_WARNING("16l fluid extractor from 1 nugget Recipe: "+material.getLocalizedName()+" - Success"); + Logger.WARNING("16l fluid extractor from 1 nugget Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_WARNING("16l fluid extractor from 1 nugget Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING("16l fluid extractor from 1 nugget Recipe: "+material.getLocalizedName()+" - Failed"); } //Block @@ -104,10 +104,10 @@ public class RecipeGen_Fluids implements Runnable{ 288, //Duration 16 //Eu Tick )){ - Utils.LOG_WARNING((144*9)+"l fluid extractor from 1 block Recipe: "+material.getLocalizedName()+" - Success"); + Logger.WARNING((144*9)+"l fluid extractor from 1 block Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_WARNING((144*9)+"l fluid extractor from 1 block Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING((144*9)+"l fluid extractor from 1 block Recipe: "+material.getLocalizedName()+" - Failed"); } @@ -126,10 +126,10 @@ public class RecipeGen_Fluids implements Runnable{ 32, //Duration 8 //Eu Tick )){ - Utils.LOG_WARNING("144l fluid molder for 1 ingot Recipe: "+material.getLocalizedName()+" - Success"); + Logger.WARNING("144l fluid molder for 1 ingot Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_WARNING("144l fluid molder for 1 ingot Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING("144l fluid molder for 1 ingot Recipe: "+material.getLocalizedName()+" - Failed"); } //Plate @@ -140,10 +140,10 @@ public class RecipeGen_Fluids implements Runnable{ 32, //Duration 8 //Eu Tick )){ - Utils.LOG_WARNING("144l fluid molder for 1 plate Recipe: "+material.getLocalizedName()+" - Success"); + Logger.WARNING("144l fluid molder for 1 plate Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_WARNING("144l fluid molder for 1 plate Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING("144l fluid molder for 1 plate Recipe: "+material.getLocalizedName()+" - Failed"); } //Nugget @@ -154,10 +154,10 @@ public class RecipeGen_Fluids implements Runnable{ 16, //Duration 4 //Eu Tick )){ - Utils.LOG_WARNING("16l fluid molder for 1 nugget Recipe: "+material.getLocalizedName()+" - Success"); + Logger.WARNING("16l fluid molder for 1 nugget Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_WARNING("16l fluid molder for 1 nugget Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING("16l fluid molder for 1 nugget Recipe: "+material.getLocalizedName()+" - Failed"); } //Gears @@ -168,10 +168,10 @@ public class RecipeGen_Fluids implements Runnable{ 128, //Duration 8 //Eu Tick )){ - Utils.LOG_WARNING("576l fluid molder for 1 gear Recipe: "+material.getLocalizedName()+" - Success"); + Logger.WARNING("576l fluid molder for 1 gear Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_WARNING("576l fluid molder for 1 gear Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING("576l fluid molder for 1 gear Recipe: "+material.getLocalizedName()+" - Failed"); } //Blocks @@ -182,10 +182,10 @@ public class RecipeGen_Fluids implements Runnable{ 288, //Duration 16 //Eu Tick )){ - Utils.LOG_WARNING((144*9)+"l fluid molder from 1 block Recipe: "+material.getLocalizedName()+" - Success"); + Logger.WARNING((144*9)+"l fluid molder from 1 block Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_WARNING((144*9)+"l fluid molder from 1 block Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING((144*9)+"l fluid molder from 1 block Recipe: "+material.getLocalizedName()+" - Failed"); } } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java index fe9d322fde..6c54fb816b 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java @@ -4,8 +4,8 @@ import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.util.GT_Recipe; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.util.Utils; import net.minecraft.item.ItemStack; public class RecipeGen_Plates implements Runnable{ @@ -31,7 +31,7 @@ public class RecipeGen_Plates implements Runnable{ final ItemStack plate_SingleTwo = material.getPlate(2); final ItemStack plate_Double = material.getPlateDouble(1); - Utils.LOG_WARNING("Generating Plate recipes for "+material.getLocalizedName()); + Logger.WARNING("Generating Plate recipes for "+material.getLocalizedName()); //Forge Hammer if (addForgeHammerRecipe( @@ -39,10 +39,10 @@ public class RecipeGen_Plates implements Runnable{ plate_Single, (int) Math.max(material.getMass(), 1L), 16)){ - Utils.LOG_WARNING("Forge Hammer Recipe: "+material.getLocalizedName()+" - Success"); + Logger.WARNING("Forge Hammer Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_WARNING("Forge Hammer Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING("Forge Hammer Recipe: "+material.getLocalizedName()+" - Failed"); } //Bender if (addBenderRecipe( @@ -50,10 +50,10 @@ public class RecipeGen_Plates implements Runnable{ plate_Single, (int) Math.max(material.getMass() * 1L, 1L), 24)){ - Utils.LOG_WARNING("Bender Recipe: "+material.getLocalizedName()+" - Success"); + Logger.WARNING("Bender Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_WARNING("Bender Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING("Bender Recipe: "+material.getLocalizedName()+" - Failed"); } //Alloy Smelter if (GT_Values.RA.addAlloySmelterRecipe( @@ -62,10 +62,10 @@ public class RecipeGen_Plates implements Runnable{ plate_Single, (int) Math.max(material.getMass() * 2L, 1L), 2 * tVoltageMultiplier)){ - Utils.LOG_WARNING("Alloy Smelter Recipe: "+material.getLocalizedName()+" - Success"); + Logger.WARNING("Alloy Smelter Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_WARNING("Alloy Smelter Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING("Alloy Smelter Recipe: "+material.getLocalizedName()+" - Failed"); } @@ -75,20 +75,20 @@ public class RecipeGen_Plates implements Runnable{ plate_Double, (int) Math.max(material.getMass() * 2L, 1L), 96)){ - Utils.LOG_WARNING("Bender Recipe: "+material.getLocalizedName()+" - Success"); + Logger.WARNING("Bender Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_WARNING("Bender Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING("Bender Recipe: "+material.getLocalizedName()+" - Failed"); } if (addBenderRecipe( plate_SingleTwo, plate_Double, (int) Math.max(material.getMass() * 2L, 1L), 96)){ - Utils.LOG_WARNING("Bender Recipe: "+material.getLocalizedName()+" - Success"); + Logger.WARNING("Bender Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_WARNING("Bender Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING("Bender Recipe: "+material.getLocalizedName()+" - Failed"); } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java index d0651f783c..98fb6050d4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java @@ -9,10 +9,8 @@ import org.apache.commons.lang3.reflect.FieldUtils; import gregtech.api.enums.GT_Values; import gregtech.api.enums.OrePrefixes; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Utility; -import gtPlusPlus.core.item.ModItems; +import gregtech.api.util.*; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.state.MaterialState; import gtPlusPlus.core.util.Utils; @@ -20,7 +18,6 @@ import gtPlusPlus.core.util.array.Pair; import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; public class RecipeGen_Recycling implements Runnable { @@ -45,39 +42,77 @@ public class RecipeGen_Recycling implements Runnable { public static void generateRecipes(final Material material) { - Utils.LOG_INFO("Generating Recycling recipes for " + material.getLocalizedName()); + Logger.WARNING("Generating Recycling recipes for " + material.getLocalizedName()); final OrePrefixes[] mValidPrefixesAsString = { OrePrefixes.ingot, OrePrefixes.ingotHot, OrePrefixes.nugget, OrePrefixes.plate, OrePrefixes.plateDense, OrePrefixes.plateDouble, OrePrefixes.plateTriple, OrePrefixes.plateQuadruple, OrePrefixes.plateQuintuple, OrePrefixes.stick, OrePrefixes.stickLong, OrePrefixes.bolt, OrePrefixes.screw, OrePrefixes.ring, OrePrefixes.rotor, OrePrefixes.gearGt, - OrePrefixes.gearGtSmall }; + OrePrefixes.gearGtSmall, OrePrefixes.gear, OrePrefixes.block, OrePrefixes.cableGt01, OrePrefixes.cableGt02, + OrePrefixes.cableGt04, OrePrefixes.cableGt08, OrePrefixes.cableGt12, OrePrefixes.wireFine, OrePrefixes.wireGt01, + OrePrefixes.wireGt02, OrePrefixes.wireGt04, OrePrefixes.wireGt08, OrePrefixes.wireGt12, OrePrefixes.wireGt16, + OrePrefixes.foil, OrePrefixes.frameGt, OrePrefixes.pipeHuge, OrePrefixes.pipeLarge, OrePrefixes.pipeMedium, OrePrefixes.pipeSmall, OrePrefixes.pipeTiny, + }; - Utils.LOG_INFO("Found " + mValidPrefixesAsString.length + " valid OreDict prefixes."); + int mSlotIndex = 0; + Pair<OrePrefixes, ItemStack>[] mValidPairs = new Pair[mValidPrefixesAsString.length]; + + for (int r=0;r<mValidPairs.length;r++){ + ItemStack temp = ItemUtils.getItemStackOfAmountFromOreDictNoBroken(mValidPrefixesAsString[r].name()+Utils.sanitizeString(material.getLocalizedName()), 1); + if (temp != null){ + mValidPairs[mSlotIndex++] = new Pair<OrePrefixes, ItemStack>(mValidPrefixesAsString[r], temp.copy()); + } + else { + Logger.WARNING("Invalid Item: "+mValidPrefixesAsString[r].name()+Utils.sanitizeString(material.getLocalizedName())); + } + } + + if (mValidPairs.length > 0){ + int validCounter = 0; + Pair<OrePrefixes, ItemStack>[] temp = mValidPairs; + for (Pair<OrePrefixes, ItemStack> temp2 : mValidPairs){ + if (temp2 != null){ + Logger.WARNING("Valid: "+temp2.getValue().getDisplayName()); + validCounter++; + } + } + Pair<OrePrefixes, ItemStack> temp3[] = new Pair[validCounter]; + int temp4 = 0; + for (Pair<OrePrefixes, ItemStack> r : mValidPairs){ + if (r != null){ + temp3[temp4++] = r; + } + } + if (temp3.length > 0){ + mValidPairs = temp3.clone(); + } + } + + Logger.WARNING("Found " + mValidPairs.length + " valid OreDict prefixes."); if (mValidPrefixesAsString.length >= 1) { - for (final OrePrefixes validPrefix : mValidPrefixesAsString) { + for (final Pair<OrePrefixes, ItemStack> validPrefix : mValidPairs) { try { if (material.getState() != MaterialState.SOLID){ continue; } - final ItemStack tempStack = get(validPrefix, material, 1); - final ItemStack mDust = getDust(material, validPrefix); - final Pair<OrePrefixes, ItemStack> mData = getDustData(material, validPrefix); - int mFluidAmount = (int) GT_Utility.translateMaterialToFluidAmount(mData.getKey().mMaterialAmount, true); + final ItemStack tempStack = validPrefix.getValue(); + final ItemStack mDust = getDust(material, validPrefix.getKey()); + final Pair<OrePrefixes, ItemStack> mData = getDustData(material, validPrefix.getKey()); + int mFluidAmount = (int) GT_Utility.translateMaterialToFluidAmount(validPrefix.getKey().mMaterialAmount, true); //Maceration if (tempStack != null) { // mValidItems[mSlotIndex++] = tempStack; if ((mDust != null) && GT_ModHandler.addPulverisationRecipe(tempStack, mDust)) { - Utils.LOG_INFO("Recycle Recipe: " + material.getLocalizedName() + " - Success - Recycle " + Logger.WARNING("Recycle Recipe: " + material.getLocalizedName() + " - Success - Recycle " + tempStack.getDisplayName() + " and obtain " + mDust.getDisplayName()); } else { - Utils.LOG_INFO("Recycle Recipe: " + material.getLocalizedName() + " - Failed"); + Logger.WARNING("Recycle Recipe: " + material.getLocalizedName() + " - Failed"); if (mDust == null) { - Utils.LOG_INFO("Invalid Dust output."); + Logger.WARNING("Invalid Dust output."); } } } @@ -91,13 +126,13 @@ public class RecipeGen_Recycling implements Runnable { if (tempStack != null) { // mValidItems[mSlotIndex++] = tempStack; if ((mDust != null) && GT_Values.RA.addFluidExtractionRecipe(tempStack, null, material.getFluid(mFluidAmount), 0, 30, 8)) { - Utils.LOG_INFO("Recycle Recipe: " + material.getLocalizedName() + " - Success - Recycle " - + tempStack.getDisplayName() + " and obtain " + mDust.getDisplayName()); + Logger.WARNING("Fluid Recycle Recipe: " + material.getLocalizedName() + " - Success - Recycle " + + tempStack.getDisplayName() + " and obtain " + mFluidAmount+"mb of "+material.getFluid(1).getLocalizedName()+"."); } else { - Utils.LOG_INFO("Recycle Recipe: " + material.getLocalizedName() + " - Failed"); + Logger.WARNING("Fluid Recycle Recipe: " + material.getLocalizedName() + " - Failed"); if (mDust == null) { - Utils.LOG_INFO("Invalid Dust output."); + Logger.WARNING("Invalid Dust output."); } } } @@ -105,10 +140,10 @@ public class RecipeGen_Recycling implements Runnable { } catch (final Throwable t) { t.printStackTrace(); - // Utils.LOG_INFO("Returning Null. Throwable Info: + // Utils.LOG_WARNING("Returning Null. Throwable Info: // "+t.getMessage()); - // Utils.LOG_INFO("Throwable Info: "+t.toString()); - // Utils.LOG_INFO("Throwable Info: + // Utils.LOG_WARNING("Throwable Info: "+t.toString()); + // Utils.LOG_WARNING("Throwable Info: // "+t.getCause().toString()); } @@ -141,14 +176,14 @@ public class RecipeGen_Recycling implements Runnable { } if (mPrefix != null && mDust != null){ - Utils.LOG_INFO("Built valid dust pair."); + Logger.WARNING("Built valid dust pair."); return new Pair<OrePrefixes, ItemStack>(mPrefix, mDust); } else { - Utils.LOG_INFO("mPrefix: "+(mPrefix!=null)); - Utils.LOG_INFO("mDust: "+(mDust!=null)); + Logger.WARNING("mPrefix: "+(mPrefix!=null)); + Logger.WARNING("mDust: "+(mDust!=null)); } - Utils.LOG_INFO("Failed to build valid dust pair."); + Logger.WARNING("Failed to build valid dust pair."); return null; } @@ -162,23 +197,23 @@ public class RecipeGen_Recycling implements Runnable { } ItemStack rStack = null; if ((((aMaterialAmount % M) == 0) || (aMaterialAmount >= (M * 16)))) { - Utils.LOG_INFO("Trying to get a Dust"); + Logger.WARNING("Trying to get a Dust"); rStack = get(OrePrefixes.dust, aMaterial, aMaterialAmount / M); } if ((rStack == null) && ((((aMaterialAmount * 4) % M) == 0) || (aMaterialAmount >= (M * 8)))) { - Utils.LOG_INFO("Trying to get a Small Dust"); + Logger.WARNING("Trying to get a Small Dust"); rStack = get(OrePrefixes.dustSmall, aMaterial, (aMaterialAmount * 4) / M); } if ((rStack == null) && (((aMaterialAmount * 9) >= M))) { - Utils.LOG_INFO("Trying to get a Tiny Dust"); + Logger.WARNING("Trying to get a Tiny Dust"); rStack = get(OrePrefixes.dustTiny, aMaterial, (aMaterialAmount * 9) / M); } if (rStack == null) { - Utils.LOG_INFO("Returning Null. Method: " + ReflectionUtils.getMethodName(0)); - Utils.LOG_INFO("Called from method: " + ReflectionUtils.getMethodName(1)); - Utils.LOG_INFO("Called from method: " + ReflectionUtils.getMethodName(2)); - Utils.LOG_INFO("Called from method: " + ReflectionUtils.getMethodName(3)); - Utils.LOG_INFO("Called from method: " + ReflectionUtils.getMethodName(4)); + Logger.WARNING("Returning Null. Method: " + ReflectionUtils.getMethodName(0)); + Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(1)); + Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(2)); + Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(3)); + Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(4)); } return rStack; @@ -204,15 +239,15 @@ public class RecipeGen_Recycling implements Runnable { public static ItemStack get(final Object aName, final ItemStack aReplacement, final long aAmount, final boolean aMentionPossibleTypos, final boolean aNoInvalidAmounts) { if (aNoInvalidAmounts && (aAmount < 1L)) { - Utils.LOG_INFO("Returning Null. Method: " + ReflectionUtils.getMethodName(0)); - Utils.LOG_INFO("Called from method: " + ReflectionUtils.getMethodName(1)); - Utils.LOG_INFO("Called from method: " + ReflectionUtils.getMethodName(2)); - Utils.LOG_INFO("Called from method: " + ReflectionUtils.getMethodName(3)); - Utils.LOG_INFO("Called from method: " + ReflectionUtils.getMethodName(4)); + Logger.WARNING("Returning Null. Method: " + ReflectionUtils.getMethodName(0)); + Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(1)); + Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(2)); + Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(3)); + Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(4)); return null; } if (!mNameMap.containsKey(aName.toString()) && aMentionPossibleTypos) { - Utils.LOG_INFO("Unknown Key for Unification, Typo? " + aName); + Logger.WARNING("Unknown Key for Unification, Typo? " + aName); } return GT_Utility.copyAmount(aAmount, new Object[] { mNameMap.get(aName.toString()), getFirstOre(aName, aAmount), aReplacement }); @@ -220,16 +255,16 @@ public class RecipeGen_Recycling implements Runnable { public static ItemStack getFirstOre(final Object aName, final long aAmount) { if (GT_Utility.isStringInvalid(aName)) { - Utils.LOG_INFO("Returning Null. Method: " + ReflectionUtils.getMethodName(0)); - Utils.LOG_INFO("Called from method: " + ReflectionUtils.getMethodName(1)); - Utils.LOG_INFO("Called from method: " + ReflectionUtils.getMethodName(2)); - Utils.LOG_INFO("Called from method: " + ReflectionUtils.getMethodName(3)); - Utils.LOG_INFO("Called from method: " + ReflectionUtils.getMethodName(4)); + Logger.WARNING("Returning Null. Method: " + ReflectionUtils.getMethodName(0)); + Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(1)); + Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(2)); + Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(3)); + Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(4)); return null; } - final ItemStack tStack = (ItemStack) mNameMap.get(aName.toString()); + final ItemStack tStack = mNameMap.get(aName.toString()); if (GT_Utility.isStackValid(tStack)) { - Utils.LOG_INFO("Found valid stack."); + Logger.WARNING("Found valid stack."); return GT_Utility.copyAmount(aAmount, new Object[] { tStack }); } return GT_Utility.copyAmount(aAmount, getOres(aName).toArray()); @@ -239,32 +274,33 @@ public class RecipeGen_Recycling implements Runnable { final String aName = (aOreName == null) ? "" : aOreName.toString(); final ArrayList<ItemStack> rList = new ArrayList<ItemStack>(); if (GT_Utility.isStringValid(aName)) { - Utils.LOG_INFO("Making a list of all OreDict entries for "+aOreName+"."); + Logger.WARNING("Making a list of all OreDict entries for "+aOreName+"."); if (rList.addAll(OreDictionary.getOres(aName))){ - Utils.LOG_INFO("Added "+rList.size()+" elements to list."); + Logger.WARNING("Added "+rList.size()+" elements to list."); } else { - Utils.LOG_INFO("Failed to Add Collection from oreDictionary, forcing an entry."); + Logger.WARNING("Failed to Add Collection from oreDictionary, forcing an entry."); rList.add(ItemUtils.getItemStackOfAmountFromOreDict((String) aOreName, 1)); } } return rList; } + @SuppressWarnings("unchecked") public Map<String, ItemStack> getNameMap() { Map<String, ItemStack> tempMap; try { tempMap = (Map<String, ItemStack>) FieldUtils.readStaticField(GT_OreDictUnificator.class, "sName2StackMap", true); if (tempMap != null) { - Utils.LOG_INFO("Found 'sName2StackMap' in GT_OreDictUnificator.class."); + Logger.WARNING("Found 'sName2StackMap' in GT_OreDictUnificator.class."); return tempMap; } } catch (final IllegalAccessException e) { e.printStackTrace(); } - Utils.LOG_INFO("Invalid map stored in GT_OreDictUnificator.class, unable to find sName2StackMap field."); + Logger.WARNING("Invalid map stored in GT_OreDictUnificator.class, unable to find sName2StackMap field."); return null; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java index 79ff583607..a04206ec62 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java @@ -1,9 +1,9 @@ package gtPlusPlus.xmod.gregtech.loaders; import gregtech.api.util.GT_ModHandler; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.recipe.RecipeUtils; import net.minecraft.item.ItemStack; @@ -21,7 +21,7 @@ public class RecipeGen_ShapedCrafting implements Runnable{ } public static void generateRecipes(final Material material){ - Utils.LOG_WARNING("Generating Shaped Crafting recipes for "+material.getLocalizedName()); //TODO + Logger.WARNING("Generating Shaped Crafting recipes for "+material.getLocalizedName()); //TODO //Nuggets @@ -81,10 +81,10 @@ public class RecipeGen_ShapedCrafting implements Runnable{ "craftingToolFile", material.getRod(1), null, null, null, null, material.getRing(1))){ - Utils.LOG_WARNING("GT:NH Ring Recipe: "+material.getLocalizedName()+" - Success"); + Logger.WARNING("GT:NH Ring Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_WARNING("GT:NH Ring Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING("GT:NH Ring Recipe: "+material.getLocalizedName()+" - Failed"); } } else { @@ -93,10 +93,10 @@ public class RecipeGen_ShapedCrafting 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"); } } } @@ -110,10 +110,10 @@ public class RecipeGen_ShapedCrafting implements Runnable{ stackStick, "craftingToolWrench", stackStick, stackStick, stackStick, stackStick, material.getFrameBox(2))){ - Utils.LOG_WARNING("Framebox Recipe: "+material.getLocalizedName()+" - Success"); + Logger.WARNING("Framebox Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_WARNING("Framebox Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING("Framebox Recipe: "+material.getLocalizedName()+" - Failed"); } } @@ -154,10 +154,10 @@ public class RecipeGen_ShapedCrafting implements Runnable{ null, material.getRod(1), null, null, null, null, material.getBolt(2))){ - Utils.LOG_WARNING("Bolt Recipe: "+material.getLocalizedName()+" - Success"); + Logger.WARNING("Bolt Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_WARNING("Bolt Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING("Bolt Recipe: "+material.getLocalizedName()+" - Failed"); } } @@ -168,10 +168,10 @@ public class RecipeGen_ShapedCrafting implements Runnable{ null, material.getIngot(1), null, null, null, null, material.getRod(1))){ - Utils.LOG_WARNING("Rod Recipe: "+material.getLocalizedName()+" - Success"); + Logger.WARNING("Rod Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_WARNING("Rod Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING("Rod Recipe: "+material.getLocalizedName()+" - Failed"); } @@ -181,10 +181,10 @@ public class RecipeGen_ShapedCrafting implements Runnable{ material.getLongRod(1), null, null, null, null, null, material.getRod(2))){ - Utils.LOG_WARNING("Rod Recipe: "+material.getLocalizedName()+" - Success"); + Logger.WARNING("Rod Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_WARNING("Rod Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING("Rod Recipe: "+material.getLocalizedName()+" - Failed"); } //Two small to long rod @@ -193,10 +193,10 @@ public class RecipeGen_ShapedCrafting implements Runnable{ null, null, null, null, null, null, material.getLongRod(1))){ - Utils.LOG_WARNING("Long Rod Recipe: "+material.getLocalizedName()+" - Success"); + Logger.WARNING("Long Rod Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_WARNING("Long Rod Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING("Long Rod Recipe: "+material.getLocalizedName()+" - Failed"); } //Rotor Recipe @@ -206,10 +206,10 @@ public class RecipeGen_ShapedCrafting implements Runnable{ material.getScrew(1), material.getRing(1), "craftingToolFile", material.getPlate(1), "craftingToolScrewdriver", material.getPlate(1), material.getRotor(1))){ - Utils.LOG_WARNING("Rotor Recipe: "+material.getLocalizedName()+" - Success"); + Logger.WARNING("Rotor Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_WARNING("Rotor Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING("Rotor Recipe: "+material.getLocalizedName()+" - Failed"); } } @@ -220,10 +220,10 @@ public class RecipeGen_ShapedCrafting implements Runnable{ material.getPlate(1), "craftingToolWrench", material.getPlate(1), material.getRod(1), material.getPlate(1), material.getRod(1), material.getGear(1))){ - Utils.LOG_WARNING("Gear Recipe: "+material.getLocalizedName()+" - Success"); + Logger.WARNING("Gear Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_WARNING("Gear Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING("Gear Recipe: "+material.getLocalizedName()+" - Failed"); } } @@ -234,10 +234,10 @@ public class RecipeGen_ShapedCrafting implements Runnable{ material.getBolt(1), null, null, null, null, null, material.getScrew(1))){ - Utils.LOG_WARNING("Screw Recipe: "+material.getLocalizedName()+" - Success"); + Logger.WARNING("Screw Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_WARNING("Screw Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING("Screw Recipe: "+material.getLocalizedName()+" - Failed"); } } } |