diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2016-05-15 15:25:56 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2016-05-15 15:25:56 +1000 |
commit | dce34f9ba22f173b7bf5d7c9669cf29120f14e3a (patch) | |
tree | 9327ac010bcd69c9142b5c8bf2a7bdf332f1a42c | |
parent | 83abafec38764fd6f562ce5320fc446ddaad6ff6 (diff) | |
download | GT5-Unofficial-dce34f9ba22f173b7bf5d7c9669cf29120f14e3a.tar.gz GT5-Unofficial-dce34f9ba22f173b7bf5d7c9669cf29120f14e3a.tar.bz2 GT5-Unofficial-dce34f9ba22f173b7bf5d7c9669cf29120f14e3a.zip |
Coking Oven Recipe handler working.
RA wasn't being assigned an instance of GregtechRecipeAdder, which is now fixed in CORE
-rw-r--r-- | .classpath | 1 | ||||
-rw-r--r-- | src/Java/miscutil/MiscUtils.java | 10 | ||||
-rw-r--r-- | src/Java/miscutil/core/handler/registration/RECIPES_GREGTECH.java | 43 | ||||
-rw-r--r-- | src/Java/miscutil/core/lib/CORE.java | 2 | ||||
-rw-r--r-- | src/Java/miscutil/gregtech/common/GregtechRecipeAdder.java | 62 |
5 files changed, 92 insertions, 26 deletions
diff --git a/.classpath b/.classpath index ea2ed7fe17..7152e15d22 100644 --- a/.classpath +++ b/.classpath @@ -9,6 +9,5 @@ <classpathentry kind="lib" path="libs/Waila-1.5.10_1.7.10-deobf.jar"/> <classpathentry kind="lib" path="libs/EnderIO-1.7.10-2.2.8.381-dev.jar" sourcepath="libsrc/EnderIO-1.7.10-2.2.8.381-sources.jar"/> <classpathentry kind="lib" path="libs/gregtech-5.8.50UX-dev.jar"/> - <classpathentry kind="lib" path="libs/API.jar"/> <classpathentry kind="output" path="bin"/> </classpath> diff --git a/src/Java/miscutil/MiscUtils.java b/src/Java/miscutil/MiscUtils.java index 2478f8fbb9..18ddf45884 100644 --- a/src/Java/miscutil/MiscUtils.java +++ b/src/Java/miscutil/MiscUtils.java @@ -14,6 +14,7 @@ import miscutil.core.util.PlayerCache; import miscutil.core.util.Utils; import miscutil.core.util.debug.DEBUG_ScreenOverlay; import miscutil.core.util.uptime.Uptime; +import miscutil.gregtech.common.GregtechRecipeAdder; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.living.LivingDeathEvent; import cpw.mods.fml.common.FMLCommonHandler; @@ -48,6 +49,15 @@ implements ActionListener { LoadedMods.checkLoaded(); Utils.LOG_INFO("Doing some house cleaning."); + + if (LoadedMods.Gregtech){ + try { + CORE.sRecipeAdder = CORE.RA = new GregtechRecipeAdder(); + } catch (NullPointerException e){ + + } + } + AddToCreativeTab.initialiseTabs(); proxy.registerTileEntities(); proxy.registerRenderThings(); diff --git a/src/Java/miscutil/core/handler/registration/RECIPES_GREGTECH.java b/src/Java/miscutil/core/handler/registration/RECIPES_GREGTECH.java index 07250e51fa..63360e1260 100644 --- a/src/Java/miscutil/core/handler/registration/RECIPES_GREGTECH.java +++ b/src/Java/miscutil/core/handler/registration/RECIPES_GREGTECH.java @@ -5,6 +5,7 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_OreDictUnificator; import miscutil.core.lib.CORE; import miscutil.core.util.Utils; +import miscutil.core.util.UtilsItems; public class RECIPES_GREGTECH { @@ -12,18 +13,36 @@ public class RECIPES_GREGTECH { Utils.LOG_INFO("Loading Recipes through GregAPI for Industrial Multiblocks."); execute(); } - + private static void execute(){ Utils.LOG_INFO("Loading Recipes for Industrial Coking Oven."); - - CORE.RA.addCokeOvenRecipe( - GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Emerald, 1L), //Input 1 - GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Emerald, 1L), //Input 2 - Materials.Water.getFluid(100L), //Fluid Input 1 - Materials.Lava.getFluid(500L), //Fluid Output - GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Diamond, 1L), //Item Output - 20, //Time in seconds? - 120); //EU + + try { + + //GT Logs to Charcoal Recipe + CORE.RA.addCokeOvenRecipe( + GT_OreDictUnificator.get(OrePrefixes.log, Materials.Wood, 2L), //Input 1 + GT_OreDictUnificator.get(OrePrefixes.log, Materials.Wood, 2L), //Input 2 + Materials.SulfuricAcid.getFluid(20L), //Fluid Input + Materials.Creosote.getFluid(175L), //Fluid Output + GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Charcoal, 2L), //Item Output + 800, //Time in ticks + 30); //EU + + }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");} + + try { + + //Coal -> Coke Recipe + CORE.RA.addCokeOvenRecipe( + GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 2L), //Input 1 + GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 2L), //Input 2 + Materials.SulfuricAcid.getFluid(80L), //Fluid Input + Materials.Creosote.getFluid(250L), //Fluid Output + UtilsItems.getItemStack("Railcraft:fuel.coke", 2), //Item Output + 600, //Time in ticks + 120); //EU + + }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");} } - -} +}
\ No newline at end of file diff --git a/src/Java/miscutil/core/lib/CORE.java b/src/Java/miscutil/core/lib/CORE.java index d24420f841..3f38cd9180 100644 --- a/src/Java/miscutil/core/lib/CORE.java +++ b/src/Java/miscutil/core/lib/CORE.java @@ -21,6 +21,8 @@ public class CORE { public static Map PlayerCache; public static final String[] VOLTAGES = {"ULV","LV","MV","HV","EV","IV","LuV","ZPM","UV","MAX"}; public static IGregtech_RecipeAdder RA; + @Deprecated + public static IGregtech_RecipeAdder sRecipeAdder; @SideOnly(Side.CLIENT) public static IIconRegister GT_BlockIcons, GT_ItemIcons; diff --git a/src/Java/miscutil/gregtech/common/GregtechRecipeAdder.java b/src/Java/miscutil/gregtech/common/GregtechRecipeAdder.java index e81080aaa2..8a4e7a1833 100644 --- a/src/Java/miscutil/gregtech/common/GregtechRecipeAdder.java +++ b/src/Java/miscutil/gregtech/common/GregtechRecipeAdder.java @@ -1,6 +1,7 @@ package miscutil.gregtech.common; import gregtech.api.GregTech_API; +import miscutil.core.util.Utils; import miscutil.gregtech.api.interfaces.internal.IGregtech_RecipeAdder; import miscutil.gregtech.api.util.GregtechRecipe; import net.minecraft.item.ItemStack; @@ -16,19 +17,54 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { GregtechRecipe.Gregtech_Recipe_Map.sCokeOvenRecipes.addRecipe(aOptimize, aInputs, aOutputs, aSpecial, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue); return true; }*/ - + @Override public boolean addCokeOvenRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt) { - if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput == null) && (aFluidOutput == null))) { - return false; - } - if ((aOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("cokeoven", aOutput, aDuration)) <= 0)) { - return false; - } - if ((aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("cokeoven", aFluidOutput.getFluid().getName(), aDuration)) <= 0)) { - return false; - } - GregtechRecipe.Gregtech_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0); - return true; - } + Utils.LOG_INFO("=================================================================================="); + Utils.LOG_INFO("=================================================================================="); + Utils.LOG_INFO("=================================================================================="); + Utils.LOG_INFO("=================================================================================="); + Utils.LOG_INFO("=================================================================================="); + Utils.LOG_INFO("Walking Through CokeOven Recipe Creation."); + Utils.LOG_INFO("My name is Ralph and I will be your humble host."); + if (((aInput1 == null) /*&& (aFluidInput == null)*/) || ((aOutput == null) && (aFluidOutput == null))) { + Utils.LOG_INFO("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); + Utils.LOG_INFO("Something was null, returning false"); + return false; + } + Utils.LOG_INFO("=================================================================================="); + Utils.LOG_INFO("Taking a step forward."); + Utils.LOG_INFO("aInput1 == null && aFluidInput == null || aOutput == null && aFluidOutput == null"); + Utils.LOG_INFO("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); + Utils.LOG_INFO("Passed."); + if ((aOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("cokeoven", aOutput, aDuration)) <= 0)) { + Utils.LOG_INFO("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); + Utils.LOG_INFO("Something was null, returning false"); + return false; + } + Utils.LOG_INFO("=================================================================================="); + Utils.LOG_INFO("Taking a step forward."); + Utils.LOG_INFO("(aOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aOutput, aDuration)) <= 0)"); + Utils.LOG_INFO("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); + Utils.LOG_INFO("Passed."); + if ((aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("cokeoven", aFluidOutput.getFluid().getName(), aDuration)) <= 0)) { + Utils.LOG_INFO("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); + Utils.LOG_INFO("Something was null, returning false"); + return false; + } + Utils.LOG_INFO("=================================================================================="); + Utils.LOG_INFO("Taking a step forward."); + Utils.LOG_INFO("(aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aFluidOutput.getFluid().getName(), aDuration)) <= 0)"); + Utils.LOG_INFO("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); + Utils.LOG_INFO("Passed."); + Utils.LOG_INFO("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); + GregtechRecipe.Gregtech_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0); + Utils.LOG_INFO("Successfully added a Coke Oven recipe for: "+aOutput.getDisplayName()+" & "+aFluidOutput.getFluid().getName()+", Using "+aInput1.getDisplayName()+", "+aInput2.getDisplayName()+", "+aFluidInput.getFluid().getName()); + Utils.LOG_INFO("=================================================================================="); + Utils.LOG_INFO("=================================================================================="); + Utils.LOG_INFO("=================================================================================="); + Utils.LOG_INFO("=================================================================================="); + Utils.LOG_INFO("=================================================================================="); + return true; + } } |