From 0669f5eb9d5029a8b94ec552171b0837605f7747 Mon Sep 17 00:00:00 2001 From: draknyte1 Date: Fri, 4 Nov 2016 15:23:26 +1000 Subject: $ Cleaned up the entire project. > Much neat, very nices. --- .../xmod/gregtech/loaders/Gregtech_Blocks.java | 32 ++- .../loaders/ProcessingToolHeadChoocher.java | 136 ++++++----- .../loaders/Processing_Textures_Items.java | 5 +- .../gregtech/loaders/RecipeGen_BlastSmelter.java | 265 ++++++++++++--------- .../gregtech/loaders/RecipeGen_BlastSmelterGT.java | 225 +++++++++-------- .../gregtech/loaders/RecipeGen_DustGeneration.java | 153 +++++------- .../xmod/gregtech/loaders/RecipeGen_Extruder.java | 126 ++++------ .../xmod/gregtech/loaders/RecipeGen_Plates.java | 162 ++++++------- .../gregtech/loaders/RecipeGen_ShapedCrafting.java | 259 +++++++++----------- 9 files changed, 666 insertions(+), 697 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech/loaders') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java index 3bd5b2e0cf..cc6f07f494 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java @@ -11,24 +11,11 @@ import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks2; public class Gregtech_Blocks { - public static void run(){ - - //Casing Blocks - ModBlocks.blockCasingsMisc = new GregtechMetaCasingBlocks(); - ModBlocks.blockCasings2Misc = new GregtechMetaCasingBlocks2(); - //ModBlocks.blockMetaTileEntity = new GregtechBlockMachines(); - //registerDefailtGtTe(); - - - - - } - - //Register default Tile Entity - private static void registerDefailtGtTe(){ + // Register default Tile Entity + private static void registerDefailtGtTe() { Utils.LOG_INFO("Registering new GT TileEntities."); - BaseMetaTileEntity tBaseMetaTileEntity = Meta_GT_Proxy.constructBaseMetaTileEntity(); + final BaseMetaTileEntity tBaseMetaTileEntity = Meta_GT_Proxy.constructBaseMetaTileEntity(); Utils.LOG_INFO("Testing BaseMetaTileEntity."); if (tBaseMetaTileEntity == null) { @@ -37,7 +24,18 @@ public class Gregtech_Blocks { } Utils.LOG_INFO("Registering the BaseMetaTileEntityEx."); GameRegistry.registerTileEntity(tBaseMetaTileEntity.getClass(), "BaseMetaTileEntityEx"); - FMLInterModComms.sendMessage("appliedenergistics2", "whitelist-spatial", tBaseMetaTileEntity.getClass().getName()); + FMLInterModComms.sendMessage("appliedenergistics2", "whitelist-spatial", + tBaseMetaTileEntity.getClass().getName()); + } + + public static void run() { + + // Casing Blocks + ModBlocks.blockCasingsMisc = new GregtechMetaCasingBlocks(); + ModBlocks.blockCasings2Misc = new GregtechMetaCasingBlocks2(); + // ModBlocks.blockMetaTileEntity = new GregtechBlockMachines(); + // registerDefailtGtTe(); + } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java index 7928907db1..076188e33b 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java @@ -12,78 +12,94 @@ import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools; import net.minecraft.item.ItemStack; public class ProcessingToolHeadChoocher implements Interface_OreRecipeRegistrator, Runnable { - public ProcessingToolHeadChoocher() { - GregtechOrePrefixes.toolSkookumChoocher.add(this); - } + public ProcessingToolHeadChoocher() { + GregtechOrePrefixes.toolSkookumChoocher.add(this); + } + + public void materialsLoops() { + final Materials[] i = Materials.values(); + final int size = i.length; + Utils.LOG_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."); + // Input 1 + final ItemStack plate = GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L); + final ItemStack ingot = GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L); + final ItemStack screw = GT_OreDictUnificator.get(OrePrefixes.screw, aMaterial, 1L); + final ItemStack longrod = GT_OreDictUnificator.get(OrePrefixes.stickLong, aMaterial, 1L); + final ItemStack hammerhead = GT_OreDictUnificator.get(OrePrefixes.toolHeadHammer, aMaterial, 1L); + + if (null != plate && null != ingot && null != hammerhead && null != longrod && null != screw) { + RecipeUtils.recipeBuilder(hammerhead, ToolDictNames.craftingToolScrewdriver.name(), plate, + ingot, plate, plate, longrod, screw, null, + MetaGeneratedGregtechTools.INSTANCE.getToolWithStats( + MetaGeneratedGregtechTools.SKOOKUM_CHOOCHER, 1, aMaterial, null, null)); + 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."); + } + // 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."); + } + } + else { + Utils.LOG_WARNING("" + aMaterial.name() + " was not a valid Skookum Choocher Material."); + } - @Override - public void registerOre(GregtechOrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { - if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint)) { - if (aMaterial != Materials.Rubber) - if ((!aMaterial.contains(SubTag.WOOD)) && (!aMaterial.contains(SubTag.BOUNCY)) && (!aMaterial.contains(SubTag.NO_SMASHING))) { - GT_ModHandler.addCraftingRecipe(MetaGeneratedGregtechTools.INSTANCE.getToolWithStats(16, 1, aMaterial, aMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"IhI", "III", " I ", Character.valueOf('I'), OrePrefixes.ingot.get(aMaterial)}); - } - } - } + } + + Utils.LOG_INFO("Materials used for tool gen: " + used); + } @Override - public void registerOre(GregtechOrePrefixes aPrefix, - GT_Materials aMaterial, String aOreDictName, String aModName, - ItemStack aStack) { + public void registerOre(final GregtechOrePrefixes aPrefix, final GT_Materials aMaterial, final String aOreDictName, + final String aModName, final ItemStack aStack) { // TODO Auto-generated method stub - + } - - public void materialsLoops(){ - Materials[] i = Materials.values(); - int size = i.length; - Utils.LOG_WARNING("Materials to attempt tool gen. with: "+size); - int used = 0; - Materials aMaterial = null; - for (int r=0;r tMaterial = new ArrayList(); - short counter=0; - int inputStackCount=0; - int fluidAmount=0; - boolean doTest = true; - tMaterial = M.getComposites(); + short counter = 0; + int inputStackCount = 0; + int fluidAmount = 0; + final boolean doTest = true; + tMaterial = M.getComposites(); - //This Bad boy here is what dictates unique recipes. Fuck life, right? + // This Bad boy here is what dictates unique recipes. Fuck life, + // right? ItemStack circuitGT = ItemUtils.getGregtechCircuit(0); - - //Set a duration + // Set a duration int duration = 0; - if (M.getMeltingPointK() > 150){ + if (M.getMeltingPointK() > 150) { duration = (int) Math.max(M.getMass() / 50L, 1L) * M.getMeltingPointK(); } else { - duration = (int) Math.max(M.getMass() / 50L, 1L) * 150; + duration = (int) Math.max(M.getMass() / 50L, 1L) * 150; } - - int mMaterialListSize=0; - if (M.getComposites() != null){ - for (gtPlusPlus.core.material.MaterialStack ternkfsdf : M.getComposites()){ - if (ternkfsdf != null) - mMaterialListSize++; + int mMaterialListSize = 0; + if (M.getComposites() != null) { + for (final gtPlusPlus.core.material.MaterialStack ternkfsdf : M.getComposites()) { + if (ternkfsdf != null) { + mMaterialListSize++; + } } } else { - mMaterialListSize = 1; - } - - Utils.LOG_WARNING("Size: "+mMaterialListSize); + mMaterialListSize = 1; + } + Utils.LOG_WARNING("Size: " + mMaterialListSize); - //Make a simple one Material Materialstack[] and log it for validity. + // Make a simple one Material Materialstack[] and log it for + // validity. circuitGT = ItemUtils.getGregtechCircuit(1); - ItemStack[] tItemStackTest = new ItemStack[]{circuitGT, tStack}; + final ItemStack[] tItemStackTest = new ItemStack[] { + circuitGT, tStack + }; inputStackCount = 1; - fluidAmount = 144*inputStackCount; - Utils.LOG_WARNING("Adding an Alloy Blast Smelter Recipe for "+M.getLocalizedName()+". Gives "+fluidAmount+"L of molten metal."); - for (int das=0;das 1); - //Generate Recipes for all singular materials that can be made molten. - if (hasMoreInputThanACircuit){ + final boolean hasMoreInputThanACircuit = tItemStackTest.length > 1; + + // Generate Recipes for all singular materials that can be made + // molten. + if (hasMoreInputThanACircuit) { if (M.requiresBlastFurnace()) { - if (CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getFluid(fluidAmount), 100, duration, 240)){ + if (CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getFluid(fluidAmount), 100, duration, 240)) { Utils.LOG_WARNING("Success."); - if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), M.getFluid(144), M.getIngot(1), duration, 120)){ + if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), M.getFluid(144), + M.getIngot(1), duration, 120)) { Utils.LOG_INFO("Success, Also added a Fluid solidifier recipe."); - if (GT_Values.RA.addFluidExtractionRecipe(M.getIngot(1), null, M.getFluid(144), 100, duration, 120)){ + if (GT_Values.RA.addFluidExtractionRecipe(M.getIngot(1), null, M.getFluid(144), 100, + duration, 120)) { Utils.LOG_INFO("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)){ + if (GT_Values.RA + .addFluidExtractionRecipe( + ItemUtils.getItemStackOfAmountFromOreDictNoBroken( + "nugget" + M.getUnlocalizedName(), 1), + null, M.getFluid(16), 100, duration / 9, 120)) { Utils.LOG_INFO("Success, Also added a Fluid Extractor recipe."); } - if (GT_Values.RA.addFluidExtractionRecipe(M.getSmallDust(1), null, M.getFluid(36), 100, duration/4, 120)){ + if (GT_Values.RA.addFluidExtractionRecipe(M.getSmallDust(1), null, M.getFluid(36), 100, + duration / 4, 120)) { Utils.LOG_INFO("Success, Also added a Fluid Extractor recipe."); } - if (GT_Values.RA.addFluidExtractionRecipe(M.getTinyDust(1), null, M.getFluid(16), 100, duration/9, 120)){ + if (GT_Values.RA.addFluidExtractionRecipe(M.getTinyDust(1), null, M.getFluid(16), 100, + duration / 9, 120)) { Utils.LOG_INFO("Success, Also added a Fluid Extractor recipe."); } } @@ -107,103 +110,117 @@ public class RecipeGen_BlastSmelter implements Runnable{ } } else { - if (CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getFluid(fluidAmount), 100, duration/2, 120)){ + if (CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getFluid(fluidAmount), 100, duration / 2, 120)) { Utils.LOG_WARNING("Success."); - if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), M.getFluid(144), M.getIngot(1), duration/2, 60)){ + if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), M.getFluid(144), + M.getIngot(1), duration / 2, 60)) { Utils.LOG_INFO("Success, Also added a Fluid solidifier recipe."); - if (GT_Values.RA.addFluidExtractionRecipe(M.getIngot(1), null, M.getFluid(144), 100, duration/2, 60)){ + if (GT_Values.RA.addFluidExtractionRecipe(M.getIngot(1), null, M.getFluid(144), 100, + duration / 2, 60)) { Utils.LOG_INFO("Success, Also added a Fluid Extractor recipe."); } - 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)){ + 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_INFO("Success, Also added a Fluid Extractor recipe."); } - } - if (GT_Values.RA.addFluidExtractionRecipe(M.getSmallDust(1), null, M.getFluid(36), 100, duration/2/4, 60)){ + } + if (GT_Values.RA.addFluidExtractionRecipe(M.getSmallDust(1), null, M.getFluid(36), 100, + duration / 2 / 4, 60)) { Utils.LOG_INFO("Success, Also added a Fluid Extractor recipe."); } - if (GT_Values.RA.addFluidExtractionRecipe(M.getTinyDust(1), null, M.getFluid(16), 100, duration/2/9, 60)){ + if (GT_Values.RA.addFluidExtractionRecipe(M.getTinyDust(1), null, M.getFluid(16), 100, + duration / 2 / 9, 60)) { Utils.LOG_INFO("Success, Also added a Fluid Extractor recipe."); } } - } + } else { Utils.LOG_WARNING("Failed."); - } - } - - if (tMaterial != null){ - //Reset the Variables for compounds if last recipe was a success. - inputStackCount=0; - counter=0; - + } + } + if (tMaterial != null) { + // Reset the Variables for compounds if last recipe was a + // success. + inputStackCount = 0; + counter = 0; - //If this Material has some kind of compound list, proceed - if (mMaterialListSize > 1){ - gtPlusPlus.core.material.MaterialStack[] tempStack = new gtPlusPlus.core.material.MaterialStack[mMaterialListSize]; + // If this Material has some kind of compound list, proceed + if (mMaterialListSize > 1) { + final gtPlusPlus.core.material.MaterialStack[] tempStack = new gtPlusPlus.core.material.MaterialStack[mMaterialListSize]; circuitGT = ItemUtils.getGregtechCircuit(mMaterialListSize); - //Just double checking - if (tempStack.length > 1){ - - //Builds me a MaterialStack[] from the MaterialList of M. - int ooo=0; - for (gtPlusPlus.core.material.MaterialStack xMaterial : M.getComposites()){ - if (xMaterial != null){ - if (xMaterial.getStackMaterial() != null){ - Utils.LOG_WARNING("FOUND: "+xMaterial.getStackMaterial().getLocalizedName()); - Utils.LOG_WARNING("ADDING: "+xMaterial.getStackMaterial().getLocalizedName()); - } - tempStack[ooo] = xMaterial; - } + // Just double checking + if (tempStack.length > 1) { + + // Builds me a MaterialStack[] from the MaterialList of + // M. + int ooo = 0; + for (final gtPlusPlus.core.material.MaterialStack xMaterial : M.getComposites()) { + if (xMaterial != null) { + if (xMaterial.getStackMaterial() != null) { + Utils.LOG_WARNING("FOUND: " + xMaterial.getStackMaterial().getLocalizedName()); + Utils.LOG_WARNING("ADDING: " + xMaterial.getStackMaterial().getLocalizedName()); + } + tempStack[ooo] = xMaterial; + } ooo++; } - //Builds me an ItemStack[] of the materials. - Without a circuit - this gets a good count for the 144L fluid multiplier + // Builds me an ItemStack[] of the materials. - Without + // a circuit - this gets a good count for the 144L fluid + // multiplier components = new ItemStack[9]; - inputStackCount=0; - for (int irc=0;irc 150){ + if (M.mBlastFurnaceTemp > 150) { duration = (int) Math.max(M.getMass() / 50L, 1L) * M.mBlastFurnaceTemp; } else { - duration = (int) Math.max(M.getMass() / 50L, 1L) * 150; + duration = (int) Math.max(M.getMass() / 50L, 1L) * 150; } - - //Make a simple one Material Materialstack[] and log it for validity. - tMaterial = new MaterialStack[]{new MaterialStack(M, 1)}; + // Make a simple one Material Materialstack[] and log it for + // validity. + tMaterial = new MaterialStack[] { + new MaterialStack(M, 1) + }; circuitGT = ItemUtils.getGregtechCircuit(1); - ItemStack[] tItemStackTest = new ItemStack[]{circuitGT, ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dust"+M, 1)}; + final ItemStack[] tItemStackTest = new ItemStack[] { + circuitGT, ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dust" + M, 1) + }; inputStackCount = 1; - fluidAmount = 144*inputStackCount; - Utils.LOG_WARNING("Adding an Alloy Blast Smelter Recipe for "+M+". Gives "+fluidAmount+"L of molten metal."); - Utils.LOG_WARNING("tMaterial.length: "+tMaterial.length+"."); - for (int das=0;das 1){ - MaterialStack[] tempStack = new MaterialStack[mMaterialListSize]; + Utils.LOG_WARNING("Size: " + mMaterialListSize); + // If this Material has some kind of compound list, + // proceed + if (mMaterialListSize > 1) { + final MaterialStack[] tempStack = new MaterialStack[mMaterialListSize]; circuitGT = ItemUtils.getGregtechCircuit(mMaterialListSize); - //Just double checking - if (tempStack.length > 1){ - - //Builds me a MaterialStack[] from the MaterialList of M. - int ooo=0; - for (MaterialStack xMaterial : M.mMaterialList){ - Utils.LOG_WARNING("FOUND: "+xMaterial.mMaterial); - Utils.LOG_WARNING("ADDING: "+xMaterial.mMaterial); + // Just double checking + if (tempStack.length > 1) { + + // Builds me a MaterialStack[] from the + // MaterialList of M. + int ooo = 0; + for (final MaterialStack xMaterial : M.mMaterialList) { + Utils.LOG_WARNING("FOUND: " + xMaterial.mMaterial); + Utils.LOG_WARNING("ADDING: " + xMaterial.mMaterial); tempStack[ooo] = M.mMaterialList.get(ooo); ooo++; } - //Builds me an ItemStack[] of the materials. - Without a circuit - this gets a good count for the 144L fluid multiplier + // Builds me an ItemStack[] of the materials. - + // Without a circuit - this gets a good count + // for the 144L fluid multiplier components = new ItemStack[tempStack.length]; - for (MaterialStack aOutputPart : tempStack){ - if (aOutputPart != null){ - Utils.LOG_WARNING("Finding dust: "+aOutputPart.mMaterial); - ItemStack rStack = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dust"+aOutputPart.mMaterial, (int) aOutputPart.mAmount); - if (rStack != null){ - Utils.LOG_WARNING("Found dust: "+aOutputPart.mMaterial); + for (final MaterialStack aOutputPart : tempStack) { + if (aOutputPart != null) { + Utils.LOG_WARNING("Finding dust: " + aOutputPart.mMaterial); + final ItemStack rStack = ItemUtils.getItemStackOfAmountFromOreDictNoBroken( + "dust" + aOutputPart.mMaterial, (int) aOutputPart.mAmount); + if (rStack != null) { + Utils.LOG_WARNING("Found dust: " + aOutputPart.mMaterial); components[counter] = rStack; - inputStackCount = inputStackCount+rStack.stackSize; + inputStackCount = inputStackCount + rStack.stackSize; } - } - counter++; + } + counter++; } - - if (mMaterialListSize > 0 && mMaterialListSize < 9){ - ItemStack[] components_NoCircuit = components; - //Builds me an ItemStack[] of the materials. - With a circuit - components = new ItemStack[components_NoCircuit.length+1]; - for (int fr=0;fr 0 && mMaterialListSize < 9) { + final ItemStack[] components_NoCircuit = components; + // Builds me an ItemStack[] of the + // materials. - With a circuit + components = new ItemStack[components_NoCircuit.length + 1]; + for (int fr = 0; fr < components.length; fr++) { + if (fr == 0) { components[0] = circuitGT; } else { - components[fr] = components_NoCircuit[fr-1]; - } + components[fr] = components_NoCircuit[fr - 1]; + } } } - /*//Add a shapeless recipe for each dust this way - Compat mode. - ItemStack outputStack = tStack; - outputStack.stackSize = mMaterialListSize; - RecipeUtils.buildShapelessRecipe(outputStack, components);*/ - - - - //Set Fluid output - fluidAmount = 144*inputStackCount; - - - Utils.LOG_WARNING("Adding an Alloy Blast Smelter Recipe for "+M+" using it's compound dusts. This material has "+ inputStackCount+" parts. Gives "+fluidAmount+"L of molten metal."); - Utils.LOG_WARNING("tMaterial.length: "+components.length+"."); - for (int das=0;das= 2800 ? 64 : 16; - Utils.LOG_WARNING("Generating Shaped Crafting recipes for "+material.getLocalizedName()); //TODO - //Ring Recipe + Utils.LOG_WARNING("Generating Shaped Crafting recipes for " + material.getLocalizedName()); // TODO + // Ring Recipe - if (RecipeUtils.addShapedGregtechRecipe( - "craftingToolWrench", null, null, - null, material.getRod(1), null, - null, null, null, - material.getRing(1))){ - Utils.LOG_WARNING("Ring Recipe: "+material.getLocalizedName()+" - Success"); + if (RecipeUtils.addShapedGregtechRecipe("craftingToolWrench", null, null, null, material.getRod(1), null, null, + null, null, material.getRing(1))) { + Utils.LOG_WARNING("Ring Recipe: " + material.getLocalizedName() + " - Success"); } else { - Utils.LOG_WARNING("Ring Recipe: "+material.getLocalizedName()+" - Failed"); + Utils.LOG_WARNING("Ring Recipe: " + material.getLocalizedName() + " - Failed"); } - final ItemStack normalDust = material.getDust(1); final ItemStack smallDust = material.getSmallDust(1); final ItemStack tinyDust = material.getTinyDust(1); @@ -45,101 +30,87 @@ public class RecipeGen_DustGeneration implements Runnable{ final ItemStack[] inputStacks = material.getMaterialComposites(); final ItemStack outputStacks = material.getDust(material.smallestStackSizeWhenProcessing); - if (RecipeUtils.recipeBuilder( - tinyDust, tinyDust, tinyDust, - tinyDust, tinyDust, tinyDust, - tinyDust, tinyDust, tinyDust, - normalDust)){ - Utils.LOG_WARNING("9 Tiny dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Success"); + if (RecipeUtils.recipeBuilder(tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, + tinyDust, normalDust)) { + Utils.LOG_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"); + Utils.LOG_WARNING("9 Tiny dust to 1 Dust Recipe: " + material.getLocalizedName() + " - Failed"); } - if (RecipeUtils.recipeBuilder( - normalDust, null, null, - null, null, null, - null, null, null, - material.getTinyDust(9))){ - Utils.LOG_WARNING("9 Tiny dust from 1 Recipe: "+material.getLocalizedName()+" - Success"); + if (RecipeUtils.recipeBuilder(normalDust, null, null, null, null, null, null, null, null, + material.getTinyDust(9))) { + Utils.LOG_WARNING("9 Tiny dust from 1 Recipe: " + material.getLocalizedName() + " - Success"); } else { - Utils.LOG_WARNING("9 Tiny dust from 1 Recipe: "+material.getLocalizedName()+" - Failed"); + Utils.LOG_WARNING("9 Tiny dust from 1 Recipe: " + material.getLocalizedName() + " - Failed"); } - - if (RecipeUtils.recipeBuilder( - smallDust, smallDust, null, - smallDust, smallDust, null, - null, null, null, - normalDust)){ - Utils.LOG_WARNING("4 Small dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Success"); + if (RecipeUtils.recipeBuilder(smallDust, smallDust, null, smallDust, smallDust, null, null, null, null, + normalDust)) { + Utils.LOG_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"); + Utils.LOG_WARNING("4 Small dust to 1 Dust Recipe: " + material.getLocalizedName() + " - Failed"); } - - if (RecipeUtils.recipeBuilder( - null, normalDust, null, - null, null, null, - null, null, null, - material.getSmallDust(4))){ - Utils.LOG_WARNING("4 Small dust from 1 Dust Recipe: "+material.getLocalizedName()+" - Success"); + if (RecipeUtils.recipeBuilder(null, normalDust, null, null, null, null, null, null, null, + material.getSmallDust(4))) { + Utils.LOG_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"); + Utils.LOG_WARNING("4 Small dust from 1 Dust Recipe: " + material.getLocalizedName() + " - Failed"); } - //Is this a composite? - if (inputStacks != null){ - //Is this a composite? - Utils.LOG_INFO("mixer length: "+inputStacks.length); - if (inputStacks.length != 0 && inputStacks.length <= 4){ - //Log Input items + // Is this a composite? + if (inputStacks != null) { + // Is this a composite? + Utils.LOG_INFO("mixer length: " + inputStacks.length); + if (inputStacks.length != 0 && inputStacks.length <= 4) { + // Log Input items Utils.LOG_WARNING(ItemUtils.getArrayStackNames(inputStacks)); final long[] inputStackSize = material.vSmallestRatio; - Utils.LOG_INFO("mixer is stacksizeVar null? "+(inputStackSize != null)); - //Is smallest ratio invalid? - if (inputStackSize != null){ - //set stack sizes on an input ItemStack[] - for (short x=0;x= 1) ? (input1 = (inputStacks[0] == null) ? null : inputStacks[0]) : null; - input2 = (inputStacks.length >= 2) ? (input2 = (inputStacks[1] == null) ? null : inputStacks[1]) : null; - input3 = (inputStacks.length >= 3) ? (input3 = (inputStacks[2] == null) ? null : inputStacks[2]) : null; - input4 = (inputStacks.length >= 4) ? (input4 = (inputStacks[3] == null) ? null : inputStacks[3]) : null; - - //Add mixer Recipe - if (GT_Values.RA.addMixerRecipe( - input1, input2, - input3, input4, - null, null, - outputStacks, - (int) Math.max(material.getMass() * 2L * 1, 1), - 6 * material.vVoltageMultiplier)) - { - Utils.LOG_INFO("Dust Mixer Recipe: "+material.getLocalizedName()+" - Success"); + input1 = inputStacks.length >= 1 ? (input1 = inputStacks[0] == null ? null : inputStacks[0]) : null; + input2 = inputStacks.length >= 2 ? (input2 = inputStacks[1] == null ? null : inputStacks[1]) : null; + input3 = inputStacks.length >= 3 ? (input3 = inputStacks[2] == null ? null : inputStacks[2]) : null; + input4 = inputStacks.length >= 4 ? (input4 = inputStacks[3] == null ? null : inputStacks[3]) : null; + + // Add mixer Recipe + if (GT_Values.RA.addMixerRecipe(input1, input2, input3, input4, null, null, outputStacks, + (int) Math.max(material.getMass() * 2L * 1, 1), 6 * material.vVoltageMultiplier)) { + Utils.LOG_INFO("Dust Mixer Recipe: " + material.getLocalizedName() + " - Success"); } else { - Utils.LOG_INFO("Dust Mixer Recipe: "+material.getLocalizedName()+" - Failed"); + Utils.LOG_INFO("Dust Mixer Recipe: " + material.getLocalizedName() + " - Failed"); } } } } - - - - - } -} + final Material toGenerate; + + public RecipeGen_DustGeneration(final Material M) { + this.toGenerate = M; + } + + @Override + public void run() { + RecipeGen_DustGeneration.generateRecipes(this.toGenerate); + } +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java index f0ebec9c67..626dbbe004 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java @@ -7,20 +7,25 @@ import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; import net.minecraft.item.ItemStack; -public class RecipeGen_Extruder implements Runnable{ +public class RecipeGen_Extruder implements Runnable { - final Material toGenerate; - - public RecipeGen_Extruder(final Material M){ - this.toGenerate = M; - } - - @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 void generateRecipes(final Material material){ + public static void generateRecipes(final Material material) { final int tVoltageMultiplier = material.getMeltingPointK() >= 2800 ? 64 : 16; final ItemStack itemIngot = material.getIngot(1); @@ -33,96 +38,69 @@ public class RecipeGen_Extruder implements Runnable{ final ItemStack shape_Rod = ItemList.Shape_Extruder_Rod.get(0); final ItemStack shape_Bolt = ItemList.Shape_Extruder_Bolt.get(0); - Utils.LOG_WARNING("Generating Extruder recipes for "+material.getLocalizedName()); + Utils.LOG_WARNING("Generating Extruder recipes for " + material.getLocalizedName()); - - //Plate Recipe - if (addExtruderRecipe( - itemIngot, - shape_Plate, - plate_Single, - 10, 4 * tVoltageMultiplier)){ - Utils.LOG_WARNING("Extruder Plate Recipe: "+material.getLocalizedName()+" - Success"); + // Plate Recipe + if (RecipeGen_Extruder.addExtruderRecipe(itemIngot, shape_Plate, plate_Single, 10, 4 * tVoltageMultiplier)) { + Utils.LOG_WARNING("Extruder Plate Recipe: " + material.getLocalizedName() + " - Success"); } else { - Utils.LOG_WARNING("Extruder Plate Recipe: "+material.getLocalizedName()+" - Failed"); + Utils.LOG_WARNING("Extruder Plate Recipe: " + material.getLocalizedName() + " - Failed"); } - //Ring Recipe - if (!material.isRadioactive){ - if (addExtruderRecipe( - itemIngot, - shape_Ring, - material.getRing(4), - (int) Math.max(material.getMass() * 2L * 1, 1), - 6 * material.vVoltageMultiplier)){ - Utils.LOG_WARNING("Extruder Ring Recipe: "+material.getLocalizedName()+" - Success"); + // Ring Recipe + if (!material.isRadioactive) { + if (RecipeGen_Extruder.addExtruderRecipe(itemIngot, shape_Ring, material.getRing(4), + (int) Math.max(material.getMass() * 2L * 1, 1), 6 * material.vVoltageMultiplier)) { + Utils.LOG_WARNING("Extruder Ring Recipe: " + material.getLocalizedName() + " - Success"); } else { - Utils.LOG_WARNING("Extruder Ring Recipe: "+material.getLocalizedName()+" - Failed"); + Utils.LOG_WARNING("Extruder Ring Recipe: " + material.getLocalizedName() + " - Failed"); } } - - //Gear Recipe - if (!material.isRadioactive){ - if (addExtruderRecipe( - material.getIngot(8), - shape_Gear, - itemGear, - (int) Math.max(material.getMass() * 5L, 1), - 8 * material.vVoltageMultiplier)){ - Utils.LOG_WARNING("Extruder Gear Recipe: "+material.getLocalizedName()+" - Success"); + // Gear Recipe + if (!material.isRadioactive) { + if (RecipeGen_Extruder.addExtruderRecipe(material.getIngot(8), shape_Gear, itemGear, + (int) Math.max(material.getMass() * 5L, 1), 8 * material.vVoltageMultiplier)) { + Utils.LOG_WARNING("Extruder Gear Recipe: " + material.getLocalizedName() + " - Success"); } else { - Utils.LOG_WARNING("Extruder Gear Recipe: "+material.getLocalizedName()+" - Failed"); + Utils.LOG_WARNING("Extruder Gear Recipe: " + material.getLocalizedName() + " - Failed"); } } - - //Rod Recipe - if (addExtruderRecipe( - itemIngot, - shape_Rod, - material.getRod(2), - (int) Math.max(material.getMass() * 2L * 1, 1), - 6 * material.vVoltageMultiplier)){ - Utils.LOG_WARNING("Extruder Rod Recipe: "+material.getLocalizedName()+" - Success"); + // Rod Recipe + if (RecipeGen_Extruder.addExtruderRecipe(itemIngot, shape_Rod, material.getRod(2), + (int) Math.max(material.getMass() * 2L * 1, 1), 6 * material.vVoltageMultiplier)) { + Utils.LOG_WARNING("Extruder Rod Recipe: " + material.getLocalizedName() + " - Success"); } else { - Utils.LOG_WARNING("Extruder Rod Recipe: "+material.getLocalizedName()+" - Failed"); + Utils.LOG_WARNING("Extruder Rod Recipe: " + material.getLocalizedName() + " - Failed"); } - - //Bolt Recipe - if (!material.isRadioactive){ - if (addExtruderRecipe( - itemIngot, - shape_Bolt, - material.getBolt(8), - (int) Math.max(material.getMass() * 2L * 1, 1), - 6 * material.vVoltageMultiplier)){ - Utils.LOG_WARNING("Extruder Bolt Recipe: "+material.getLocalizedName()+" - Success"); + // Bolt Recipe + if (!material.isRadioactive) { + if (RecipeGen_Extruder.addExtruderRecipe(itemIngot, shape_Bolt, material.getBolt(8), + (int) Math.max(material.getMass() * 2L * 1, 1), 6 * material.vVoltageMultiplier)) { + Utils.LOG_WARNING("Extruder Bolt Recipe: " + material.getLocalizedName() + " - Success"); } else { - Utils.LOG_WARNING("Extruder Bolt Recipe: "+material.getLocalizedName()+" - Failed"); + Utils.LOG_WARNING("Extruder Bolt Recipe: " + material.getLocalizedName() + " - Failed"); } } - } + } + final Material toGenerate; - 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 RecipeGen_Extruder(final Material M) { + this.toGenerate = M; } - + @Override + public void run() { + RecipeGen_Extruder.generateRecipes(this.toGenerate); + } } 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); + } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java index 6eaa164342..1667f8abe3 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java @@ -6,191 +6,152 @@ import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.recipe.RecipeUtils; import net.minecraft.item.ItemStack; -public class RecipeGen_ShapedCrafting implements Runnable{ - - final Material toGenerate; - - public RecipeGen_ShapedCrafting(final Material M){ - this.toGenerate = M; - } - - @Override - public void run() { - generateRecipes(toGenerate); - } - - public static void generateRecipes(final Material material){ - Utils.LOG_WARNING("Generating Shaped Crafting recipes for "+material.getLocalizedName()); //TODO - - //Plates - - //Single Plate Shaped/Shapeless - GT_ModHandler.addCraftingRecipe( - material.getPlate(1), - gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED, - new Object[]{"h", "B", "I", - Character.valueOf('I'), - material.getIngot(1), - Character.valueOf('B'), - material.getIngot(1)}); - - GT_ModHandler.addShapelessCraftingRecipe( - material.getPlate(1), - new Object[]{gregtech.api.enums.ToolDictNames.craftingToolForgeHammer, - material.getIngot(1), - material.getIngot(1)}); - - //Double Plate Shaped/Shapeless - GT_ModHandler.addCraftingRecipe( - material.getPlateDouble(1), - gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED, - new Object[]{"I", "B", "h", - Character.valueOf('I'), - material.getPlate(1), - Character.valueOf('B'), - material.getPlate(1)}); - - GT_ModHandler.addShapelessCraftingRecipe( - material.getPlateDouble(1), - new Object[]{gregtech.api.enums.ToolDictNames.craftingToolForgeHammer, - material.getPlate(1), - material.getPlate(1)}); - - //Ring Recipe - if (!material.isRadioactive){ - if (RecipeUtils.recipeBuilder( - "craftingToolHardHammer", null, null, - null, material.getRod(1), null, - null, null, null, - material.getRing(1))){ - Utils.LOG_WARNING("Ring Recipe: "+material.getLocalizedName()+" - Success"); +public class RecipeGen_ShapedCrafting implements Runnable { + + public static void generateRecipes(final Material material) { + Utils.LOG_WARNING("Generating Shaped Crafting recipes for " + material.getLocalizedName()); // TODO + + // Plates + + // Single Plate Shaped/Shapeless + GT_ModHandler.addCraftingRecipe(material.getPlate(1), + gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "h", "B", "I", Character.valueOf('I'), material.getIngot(1), Character.valueOf('B'), + material.getIngot(1) + }); + + GT_ModHandler.addShapelessCraftingRecipe(material.getPlate(1), new Object[] { + gregtech.api.enums.ToolDictNames.craftingToolForgeHammer, material.getIngot(1), material.getIngot(1) + }); + + // Double Plate Shaped/Shapeless + GT_ModHandler.addCraftingRecipe(material.getPlateDouble(1), + gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "I", "B", "h", Character.valueOf('I'), material.getPlate(1), Character.valueOf('B'), + material.getPlate(1) + }); + + GT_ModHandler.addShapelessCraftingRecipe(material.getPlateDouble(1), new Object[] { + gregtech.api.enums.ToolDictNames.craftingToolForgeHammer, material.getPlate(1), material.getPlate(1) + }); + + // Ring Recipe + if (!material.isRadioactive) { + if (RecipeUtils.recipeBuilder("craftingToolHardHammer", null, null, null, material.getRod(1), null, null, + null, null, material.getRing(1))) { + Utils.LOG_WARNING("Ring Recipe: " + material.getLocalizedName() + " - Success"); } else { - Utils.LOG_WARNING("Ring Recipe: "+material.getLocalizedName()+" - Failed"); + Utils.LOG_WARNING("Ring Recipe: " + material.getLocalizedName() + " - Failed"); } } - - //Framebox Recipe - if (!material.isRadioactive){ + // Framebox Recipe + if (!material.isRadioactive) { final ItemStack stackStick = material.getRod(1); - if (RecipeUtils.recipeBuilder( - stackStick, stackStick, stackStick, - stackStick, "craftingToolWrench", stackStick, - stackStick, stackStick, stackStick, - material.getFrameBox(2))){ - Utils.LOG_WARNING("Framebox Recipe: "+material.getLocalizedName()+" - Success"); + if (RecipeUtils.recipeBuilder(stackStick, stackStick, stackStick, stackStick, "craftingToolWrench", + stackStick, stackStick, stackStick, stackStick, material.getFrameBox(2))) { + Utils.LOG_WARNING("Framebox Recipe: " + material.getLocalizedName() + " - Success"); } else { - Utils.LOG_WARNING("Framebox Recipe: "+material.getLocalizedName()+" - Failed"); + Utils.LOG_WARNING("Framebox Recipe: " + material.getLocalizedName() + " - Failed"); } } - - //Add a shapeless recipe for each dust this way - Compat mode. - /*ItemStack[] inputStacks = material.getMaterialComposites(); - ItemStack outputStacks = material.getDust(material.smallestStackSizeWhenProcessing); - - if (inputStacks.length > 0){ - Utils.LOG_WARNING(ItemUtils.getArrayStackNames(inputStacks)); - long[] inputStackSize = material.vSmallestRatio; - if (inputStackSize != null){ - for (short x=0;x 0){ + * Utils.LOG_WARNING(ItemUtils.getArrayStackNames(inputStacks)); long[] + * inputStackSize = material.vSmallestRatio; if (inputStackSize != + * null){ for (short x=0;x