diff options
author | draknyte1 <draknyte1@hotmail.com> | 2016-11-04 15:23:26 +1000 |
---|---|---|
committer | draknyte1 <draknyte1@hotmail.com> | 2016-11-04 15:23:26 +1000 |
commit | 0669f5eb9d5029a8b94ec552171b0837605f7747 (patch) | |
tree | 6b40e64c04d51b7a33cf2f0b35f7232cf37c4247 /src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java | |
parent | 3654052fb63a571c5eaca7f20714b87c17f7e966 (diff) | |
download | GT5-Unofficial-0669f5eb9d5029a8b94ec552171b0837605f7747.tar.gz GT5-Unofficial-0669f5eb9d5029a8b94ec552171b0837605f7747.tar.bz2 GT5-Unofficial-0669f5eb9d5029a8b94ec552171b0837605f7747.zip |
$ Cleaned up the entire project.
> Much neat, very nices.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java')
-rw-r--r-- | src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java | 162 |
1 files changed, 77 insertions, 85 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java index 0502156525..96d7fdd5f2 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java @@ -8,20 +8,53 @@ import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; import net.minecraft.item.ItemStack; -public class RecipeGen_Plates implements Runnable{ +public class RecipeGen_Plates implements Runnable { - final Material toGenerate; - - public RecipeGen_Plates(final Material M){ - this.toGenerate = M; + public static boolean addBenderRecipe(final ItemStack aInput1, final ItemStack aOutput1, int aDuration, + final int aEUt) { + if (aInput1 == null || aOutput1 == null) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("bender", aInput1, aDuration)) <= 0) { + return false; + } + new GT_Recipe(aEUt, aDuration, aInput1, aOutput1); + return true; } - - @Override - public void run() { - generateRecipes(toGenerate); + + public static boolean addExtruderRecipe(final ItemStack aInput, final ItemStack aShape, final ItemStack aOutput, + int aDuration, final int aEUt) { + if (aInput == null || aShape == null || aOutput == null) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("extruder", aOutput, aDuration)) <= 0) { + return false; + } + GT_Recipe.GT_Recipe_Map.sExtruderRecipes.addRecipe(true, new ItemStack[] { + aInput, aShape + }, new ItemStack[] { + aOutput + }, null, null, null, aDuration, aEUt, 0); + return true; + } + + public static boolean addForgeHammerRecipe(final ItemStack aInput1, final ItemStack aOutput1, final int aDuration, + final int aEUt) { + if (aInput1 == null || aOutput1 == null) { + return false; + } + if (!GregTech_API.sRecipeFile.get("forgehammer", aOutput1, true)) { + return false; + } + GT_Recipe.GT_Recipe_Map.sHammerRecipes.addRecipe(true, new ItemStack[] { + aInput1 + }, new ItemStack[] { + aOutput1 + }, null, null, null, aDuration, aEUt, 0); + return true; } - - public static void generateRecipes(final Material material){ + + public static void generateRecipes(final Material material) { final int tVoltageMultiplier = material.getMeltingPointK() >= 2800 ? 64 : 16; final ItemStack ingotStackOne = material.getIngot(1); @@ -31,100 +64,59 @@ 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()); - - //Forge Hammer - if (addForgeHammerRecipe( - ingotStackTwo, - plate_Single, - (int) Math.max(material.getMass(), 1L), - 16)){ - Utils.LOG_WARNING("Forge Hammer Recipe: "+material.getLocalizedName()+" - Success"); + Utils.LOG_WARNING("Generating Plate recipes for " + material.getLocalizedName()); + + // Forge Hammer + if (RecipeGen_Plates.addForgeHammerRecipe(ingotStackTwo, plate_Single, (int) Math.max(material.getMass(), 1L), + 16)) { + Utils.LOG_WARNING("Forge Hammer Recipe: " + material.getLocalizedName() + " - Success"); } else { - Utils.LOG_WARNING("Forge Hammer Recipe: "+material.getLocalizedName()+" - Failed"); + Utils.LOG_WARNING("Forge Hammer Recipe: " + material.getLocalizedName() + " - Failed"); } - //Bender - if (addBenderRecipe( - ingotStackOne, - plate_Single, - (int) Math.max(material.getMass() * 1L, 1L), - 24)){ - Utils.LOG_WARNING("Bender Recipe: "+material.getLocalizedName()+" - Success"); + // Bender + if (RecipeGen_Plates.addBenderRecipe(ingotStackOne, plate_Single, (int) Math.max(material.getMass() * 1L, 1L), + 24)) { + Utils.LOG_WARNING("Bender Recipe: " + material.getLocalizedName() + " - Success"); } else { - Utils.LOG_WARNING("Bender Recipe: "+material.getLocalizedName()+" - Failed"); + Utils.LOG_WARNING("Bender Recipe: " + material.getLocalizedName() + " - Failed"); } - //Alloy Smelter - if (GT_Values.RA.addAlloySmelterRecipe( - ingotStackTwo, - shape_Mold, - plate_Single, - (int) Math.max(material.getMass() * 2L, 1L), - 2 * tVoltageMultiplier)){ - Utils.LOG_WARNING("Alloy Smelter Recipe: "+material.getLocalizedName()+" - Success"); + // Alloy Smelter + if (GT_Values.RA.addAlloySmelterRecipe(ingotStackTwo, shape_Mold, plate_Single, + (int) Math.max(material.getMass() * 2L, 1L), 2 * tVoltageMultiplier)) { + Utils.LOG_WARNING("Alloy Smelter Recipe: " + material.getLocalizedName() + " - Success"); } else { - Utils.LOG_WARNING("Alloy Smelter Recipe: "+material.getLocalizedName()+" - Failed"); + Utils.LOG_WARNING("Alloy Smelter Recipe: " + material.getLocalizedName() + " - Failed"); } - - //Making Double Plates - if (addBenderRecipe( - ingotStackTwo, - plate_Double, - (int) Math.max(material.getMass() * 2L, 1L), - 96)){ - Utils.LOG_WARNING("Bender Recipe: "+material.getLocalizedName()+" - Success"); + // Making Double Plates + if (RecipeGen_Plates.addBenderRecipe(ingotStackTwo, plate_Double, (int) Math.max(material.getMass() * 2L, 1L), + 96)) { + Utils.LOG_WARNING("Bender Recipe: " + material.getLocalizedName() + " - Success"); } else { - Utils.LOG_WARNING("Bender Recipe: "+material.getLocalizedName()+" - Failed"); + Utils.LOG_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"); + if (RecipeGen_Plates.addBenderRecipe(plate_SingleTwo, plate_Double, (int) Math.max(material.getMass() * 2L, 1L), + 96)) { + Utils.LOG_WARNING("Bender Recipe: " + material.getLocalizedName() + " - Success"); } else { - Utils.LOG_WARNING("Bender Recipe: "+material.getLocalizedName()+" - Failed"); - } - } - - public static boolean addBenderRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt) { - if ((aInput1 == null) || (aOutput1 == null)) { - return false; - } - if ((aDuration = GregTech_API.sRecipeFile.get("bender", aInput1, aDuration)) <= 0) { - return false; + Utils.LOG_WARNING("Bender Recipe: " + material.getLocalizedName() + " - Failed"); } - new GT_Recipe(aEUt, aDuration, aInput1, aOutput1); - return true; } - public static boolean addExtruderRecipe(ItemStack aInput, ItemStack aShape, ItemStack aOutput, int aDuration, int aEUt) { - if ((aInput == null) || (aShape == null) || (aOutput == null)) { - return false; - } - if ((aDuration = GregTech_API.sRecipeFile.get("extruder", aOutput, aDuration)) <= 0) { - return false; - } - GT_Recipe.GT_Recipe_Map.sExtruderRecipes.addRecipe(true, new ItemStack[]{aInput, aShape}, new ItemStack[]{aOutput}, null, null, null, aDuration, aEUt, 0); - return true; - } + final Material toGenerate; - public static boolean addForgeHammerRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt) { - if ((aInput1 == null) || (aOutput1 == null)) { - return false; - } - if (!GregTech_API.sRecipeFile.get("forgehammer", aOutput1, true)) { - return false; - } - GT_Recipe.GT_Recipe_Map.sHammerRecipes.addRecipe(true, new ItemStack[]{aInput1}, new ItemStack[]{aOutput1}, null, null, null, aDuration, aEUt, 0); - return true; + public RecipeGen_Plates(final Material M) { + this.toGenerate = M; } - + @Override + public void run() { + RecipeGen_Plates.generateRecipes(this.toGenerate); + } } |