diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2016-10-07 02:03:46 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2016-10-07 02:03:46 +1000 |
commit | 676a51a4c93713b3498508e13fae0869045f6f49 (patch) | |
tree | ac08d69405c23baadbcc37e9103153f6c06b1324 /src/Java/gtPlusPlus/xmod/gregtech/loaders | |
parent | 8c6406887cbe6b2d27cead77c6605639d73012ef (diff) | |
download | GT5-Unofficial-676a51a4c93713b3498508e13fae0869045f6f49.tar.gz GT5-Unofficial-676a51a4c93713b3498508e13fae0869045f6f49.tar.bz2 GT5-Unofficial-676a51a4c93713b3498508e13fae0869045f6f49.zip |
+ Added the Bronze and Advanced Work benches from GT4, still hell buggy but a WIP.
// Temporarily added Workbench registration to the Tiered Tanks Loader.
% Added some logging to the Plate Generation.
$ Fixed getTexture() in BaseMetaTileEntityEx.java to now support all branches of Gregtech.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/loaders')
-rw-r--r-- | src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java | 93 |
1 files changed, 80 insertions, 13 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java index 35fc715a6f..6d84abe37b 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java @@ -1,8 +1,10 @@ package gtPlusPlus.xmod.gregtech.loaders; +import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Recipe; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; import net.minecraft.item.ItemStack; @@ -20,47 +22,79 @@ public class RecipeGen_Plates { ItemStack plate_SingleTwo = material.getPlate(2); ItemStack plate_Double = material.getPlateDouble(1); + Utils.LOG_INFO("Generating Plate recipes for "+material.getLocalizedName()); + //Forge Hammer - GT_Values.RA.addForgeHammerRecipe( + if (addForgeHammerRecipe( ingotStackTwo, plate_Single, (int) Math.max(material.getMass(), 1L), - 16); + 16)){ + Utils.LOG_INFO("Forge Hammer Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Utils.LOG_INFO("Forge Hammer Recipe: "+material.getLocalizedName()+" - Failed"); + } //Bender - GT_Values.RA.addBenderRecipe( + if (addBenderRecipe( ingotStackOne, plate_Single, (int) Math.max(material.getMass() * 1L, 1L), - 24); + 24)){ + Utils.LOG_INFO("Bender Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Utils.LOG_INFO("Bender Recipe: "+material.getLocalizedName()+" - Failed"); + } //Extruder - GT_Values.RA.addExtruderRecipe( + if (addExtruderRecipe( ingotStackOne, shape_Extruder, plate_Single, - 10, 4 * tVoltageMultiplier); + 10, 4 * tVoltageMultiplier)){ + Utils.LOG_INFO("Extruder Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Utils.LOG_INFO("Extruder Recipe: "+material.getLocalizedName()+" - Failed"); + } //Alloy Smelter - GT_Values.RA.addAlloySmelterRecipe( + if (GT_Values.RA.addAlloySmelterRecipe( ingotStackTwo, shape_Mold, plate_Single, (int) Math.max(material.getMass() * 2L, 1L), - 2 * tVoltageMultiplier); + 2 * tVoltageMultiplier)){ + Utils.LOG_INFO("Alloy Smelter Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Utils.LOG_INFO("Alloy Smelter Recipe: "+material.getLocalizedName()+" - Failed"); + } //Making Double Plates - GT_Values.RA.addBenderRecipe( + if (addBenderRecipe( ingotStackTwo, plate_Double, (int) Math.max(material.getMass() * 2L, 1L), - 96); - GT_Values.RA.addBenderRecipe( + 96)){ + Utils.LOG_INFO("Bender Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Utils.LOG_INFO("Bender Recipe: "+material.getLocalizedName()+" - Failed"); + } + if (addBenderRecipe( plate_SingleTwo, plate_Double, (int) Math.max(material.getMass() * 2L, 1L), - 96); + 96)){ + Utils.LOG_INFO("Bender Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Utils.LOG_INFO("Bender Recipe: "+material.getLocalizedName()+" - Failed"); + } - Utils.LOG_WARNING("Adding crafting recipes for "+material.getLocalizedName()+" Plates - Single & Double"); + Utils.LOG_INFO("Adding crafting recipes for "+material.getLocalizedName()+" Plates - Single & Double"); //Single Plate Shaped/Shapeless GT_ModHandler.addCraftingRecipe( @@ -94,6 +128,39 @@ public class RecipeGen_Plates { plate_Single}); } + 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; + } + 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; + } + + 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; + } + } |