diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2016-08-27 01:34:08 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2016-08-27 01:34:08 +1000 |
commit | 072f6322fb789703f163030edf4b60bf5a0201af (patch) | |
tree | 9d2d9c2ba6fe3bc5139a9868ee4eca95629fdd95 /src/Java/miscutil/xmod/gregtech/recipes | |
parent | f555ac2e146e572155e176131c23e73cd74684f1 (diff) | |
download | GT5-Unofficial-072f6322fb789703f163030edf4b60bf5a0201af.tar.gz GT5-Unofficial-072f6322fb789703f163030edf4b60bf5a0201af.tar.bz2 GT5-Unofficial-072f6322fb789703f163030edf4b60bf5a0201af.zip |
+ Attempted to add custom IC2 generators.
% Refactored the xmod package to be a parent, beside core. No longer is it a child, it needs room to grow.
Diffstat (limited to 'src/Java/miscutil/xmod/gregtech/recipes')
3 files changed, 227 insertions, 0 deletions
diff --git a/src/Java/miscutil/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/Java/miscutil/xmod/gregtech/recipes/GregtechRecipeAdder.java new file mode 100644 index 0000000000..5460689ec8 --- /dev/null +++ b/src/Java/miscutil/xmod/gregtech/recipes/GregtechRecipeAdder.java @@ -0,0 +1,136 @@ +package miscutil.xmod.gregtech.recipes; + +import gregtech.api.GregTech_API; +import miscutil.core.util.Utils; +import miscutil.xmod.gregtech.api.interfaces.internal.IGregtech_RecipeAdder; +import miscutil.xmod.gregtech.api.util.GregtechRecipe; +import miscutil.xmod.gregtech.recipes.machines.RECIPEHANDLER_CokeOven; +import miscutil.xmod.gregtech.recipes.machines.RECIPEHANDLER_MatterFabricator; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +public class GregtechRecipeAdder implements IGregtech_RecipeAdder { + + + + @Override + public boolean addCokeOvenRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt) { + try { + try { + RECIPEHANDLER_CokeOven.debug1(); + if (((aInput1 == null) /*&& (aFluidInput == null)*/) || ((aOutput == null) || (aFluidOutput == null))) { + Utils.LOG_WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); + Utils.LOG_WARNING("Something was null, returning false"); + return false; + } + + } catch (NullPointerException e){e.getStackTrace();} + try { + RECIPEHANDLER_CokeOven.debug2(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aDuration, aEUt); + if ((aOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("cokeoven", aOutput, aDuration)) <= 0)) { + Utils.LOG_WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); + Utils.LOG_WARNING("Something was null, returning false"); + return false; + } + + } catch (NullPointerException e){e.getStackTrace();} + try { + RECIPEHANDLER_CokeOven.debug3(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aDuration, aEUt); + if ((aFluidOutput == null) && ((aDuration = GregTech_API.sRecipeFile.get("cokeoven", aFluidOutput.getFluid().getName(), aDuration)) <= 0)) { + Utils.LOG_WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); + Utils.LOG_WARNING("Something was null, returning false"); + return false; + } + + } catch (NullPointerException e){e.getStackTrace();} + try { + RECIPEHANDLER_CokeOven.debug4(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aDuration, aEUt); + if (aFluidInput == null){ + GregtechRecipe.Gregtech_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput}, null, null, null, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0); + } + else { + 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); + } + RECIPEHANDLER_CokeOven.debug5(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aDuration, aEUt); + + return true; + + } catch (NullPointerException e){ + return false; + } + } catch (Throwable e){ + Utils.LOG_WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); + Utils.LOG_WARNING("Failed."); + e.getStackTrace(); + return false; + } + } + + @Override + public boolean addMattrFabricatorRecipe(FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt) { + try { + try { + RECIPEHANDLER_MatterFabricator.debug1(); + if (aFluidOutput == null) { + Utils.LOG_WARNING("aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); + Utils.LOG_WARNING("Something was null, returning false"); + return false; + } + + } catch (NullPointerException e){e.getStackTrace();} + try { + RECIPEHANDLER_MatterFabricator.debug2(aFluidInput, aFluidOutput, aDuration, aEUt); + if ((aFluidOutput == null)/* && ((aDuration = GregTech_API.sRecipeFile.get("matterfab", null, aDuration)) <= 0)*/) { + Utils.LOG_WARNING("aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); + Utils.LOG_WARNING("Something was null, returning false"); + return false; + } + + } catch (NullPointerException e){e.getStackTrace();} + /*try { + + RECIPEHANDLER_MatterFabricator.debug3(aFluidInput, aFluidOutput, aDuration, aEUt); + if ((aFluidOutput == null) && ((aDuration = GregTech_API.sRecipeFile.get("matterfab", aFluidOutput.getFluid().getName(), aDuration)) <= 0)) { + Utils.LOG_WARNING("aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); + Utils.LOG_WARNING("Something was null, returning false"); + return false; + } + + } catch (NullPointerException e){e.getStackTrace();}*/ + try { + RECIPEHANDLER_MatterFabricator.debug4(aFluidInput, aFluidOutput, aDuration, aEUt); + if (aFluidInput == null){ + //GregtechRecipe.Gregtech_Recipe_Map.sMatterFabRecipes.addRecipe(true, null, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0); + GregtechRecipe.Gregtech_Recipe_Map.sMatterFab2Recipes.addRecipe(true, null, null, null, null, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0); + } + else { + //GregtechRecipe.Gregtech_Recipe_Map.sMatterFabRecipes.addRecipe(true, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0); + GregtechRecipe.Gregtech_Recipe_Map.sMatterFab2Recipes.addRecipe(true, null, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUt, 0); + } + RECIPEHANDLER_MatterFabricator.debug5(aFluidInput, aFluidOutput, aDuration, aEUt); + + return true; + + } catch (NullPointerException e){ + return false; + } + } catch (Throwable e){ + Utils.LOG_WARNING("aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); + Utils.LOG_WARNING("Failed."); + e.getStackTrace(); + return false; + } + } + + @Override + public boolean addFuel(ItemStack aInput1, ItemStack aOutput1, int aEU, int aType) { + if (aInput1 == null) { + Utils.LOG_INFO("Fuel Input is Invalid."); + return false; + } + new GregtechRecipe(aInput1, aOutput1, GregTech_API.sRecipeFile.get("fuel_" + aType, aInput1, aEU), aType); + return true; + } + + +} diff --git a/src/Java/miscutil/xmod/gregtech/recipes/machines/RECIPEHANDLER_CokeOven.java b/src/Java/miscutil/xmod/gregtech/recipes/machines/RECIPEHANDLER_CokeOven.java new file mode 100644 index 0000000000..66c761564b --- /dev/null +++ b/src/Java/miscutil/xmod/gregtech/recipes/machines/RECIPEHANDLER_CokeOven.java @@ -0,0 +1,46 @@ +package miscutil.xmod.gregtech.recipes.machines; + +import miscutil.core.util.Utils; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +public class RECIPEHANDLER_CokeOven { + + public static void debug1(){ + Utils.LOG_WARNING("=================================================================================="); + Utils.LOG_WARNING("=================================================================================="); + Utils.LOG_WARNING("=================================================================================="); + Utils.LOG_WARNING("Walking Through CokeOven Recipe Creation."); + Utils.LOG_WARNING("My name is Ralph and I will be your humble host."); + } + public static void debug2(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt){ + Utils.LOG_WARNING("=================================================================================="); + Utils.LOG_WARNING("Taking a step forward."); + Utils.LOG_WARNING("aInput1 == null && aFluidInput == null || aOutput == null && aFluidOutput == null"); + Utils.LOG_WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); + Utils.LOG_WARNING("Passed."); + } + public static void debug3(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt){ + Utils.LOG_WARNING("=================================================================================="); + Utils.LOG_WARNING("Taking a step forward."); + Utils.LOG_WARNING("(aOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aOutput, aDuration)) <= 0)"); + Utils.LOG_WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); + Utils.LOG_WARNING("Passed."); + } + public static void debug4(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt){ + Utils.LOG_WARNING("=================================================================================="); + Utils.LOG_WARNING("Taking a step forward."); + Utils.LOG_WARNING("(aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aFluidOutput.getFluid().getName(), aDuration)) <= 0)"); + Utils.LOG_WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); + Utils.LOG_WARNING("Passed."); + Utils.LOG_WARNING("aInput1:"+aInput1.toString()+" aInput2:"+aInput2.toString()+" aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aOutput:"+aOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); + + } + public static void debug5(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt){ + Utils.LOG_INFO("Successfully added a Coke Oven recipe for: "+aOutput.getDisplayName()+" & "+aFluidOutput.getFluid().getName()+", Using "+aInput1.getDisplayName()+" & "+aInput2.getDisplayName()+" & liquid "+aFluidInput.getFluid().getName()+". This takes "+(aDuration/20)+" seconds for "+aEUt+"eu/t."); + Utils.LOG_WARNING("=================================================================================="); + Utils.LOG_WARNING("=================================================================================="); + Utils.LOG_WARNING("=================================================================================="); + } + +} diff --git a/src/Java/miscutil/xmod/gregtech/recipes/machines/RECIPEHANDLER_MatterFabricator.java b/src/Java/miscutil/xmod/gregtech/recipes/machines/RECIPEHANDLER_MatterFabricator.java new file mode 100644 index 0000000000..165112451f --- /dev/null +++ b/src/Java/miscutil/xmod/gregtech/recipes/machines/RECIPEHANDLER_MatterFabricator.java @@ -0,0 +1,45 @@ +package miscutil.xmod.gregtech.recipes.machines; + +import miscutil.core.util.Utils; +import net.minecraftforge.fluids.FluidStack; + +public class RECIPEHANDLER_MatterFabricator { + + public static void debug1(){ + Utils.LOG_WARNING("=================================================================================="); + Utils.LOG_WARNING("=================================================================================="); + Utils.LOG_WARNING("=================================================================================="); + Utils.LOG_WARNING("Walking Through Matter Fabrication Recipe Creation."); + Utils.LOG_WARNING("My name is Ralph and I will be your humble host."); + } + public static void debug2(FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt){ + Utils.LOG_WARNING("=================================================================================="); + Utils.LOG_WARNING("Taking a step forward."); + Utils.LOG_WARNING("aInput1 == null && aFluidInput == null || aOutput == null && aFluidOutput == null"); + Utils.LOG_WARNING("aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); + Utils.LOG_WARNING("Passed."); + } + public static void debug3(FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt){ + Utils.LOG_WARNING("=================================================================================="); + Utils.LOG_WARNING("Taking a step forward."); + Utils.LOG_WARNING("(aOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aOutput, aDuration)) <= 0)"); + Utils.LOG_WARNING("aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); + Utils.LOG_WARNING("Passed."); + } + public static void debug4(FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt){ + Utils.LOG_WARNING("=================================================================================="); + Utils.LOG_WARNING("Taking a step forward."); + Utils.LOG_WARNING("(aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aFluidOutput.getFluid().getName(), aDuration)) <= 0)"); + Utils.LOG_WARNING("aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); + Utils.LOG_WARNING("Passed."); + Utils.LOG_WARNING("aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt); + + } + public static void debug5(FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt){ + Utils.LOG_INFO("Successfully added a Matter Fabrication recipe for: "+aFluidOutput.getFluid().getName()+", Using "+" liquid "+aFluidInput.getFluid().getName()+". This takes "+(aDuration/20)+" seconds for "+aEUt+"eu/t."); + Utils.LOG_WARNING("=================================================================================="); + Utils.LOG_WARNING("=================================================================================="); + Utils.LOG_WARNING("=================================================================================="); + } + +} |