diff options
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/loaders')
4 files changed, 211 insertions, 60 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java index fe27c09fef..b34aead51e 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java @@ -7,7 +7,7 @@ import gregtech.api.enums.ToolDictNames; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.recipe.UtilsRecipe; +import gtPlusPlus.core.util.recipe.RecipeUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_OreRecipeRegistrator; @@ -56,7 +56,7 @@ public class ProcessingToolHeadChoocher implements Interface_OreRecipeRegistrato ItemStack hammerhead = GT_OreDictUnificator.get(OrePrefixes.toolHeadHammer, aMaterial, 1L); if (null != plate && null != ingot && null != hammerhead && null != longrod && null != screw){ - UtilsRecipe.recipeBuilder( + RecipeUtils.recipeBuilder( hammerhead, ToolDictNames.craftingToolScrewdriver.name(), plate, ingot, plate, plate, longrod, screw, null, diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java index 875375cc12..4c5606b125 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java @@ -6,8 +6,10 @@ import gregtech.api.enums.SubTag; import gregtech.api.objects.MaterialStack; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.item.ItemUtils; +import gtPlusPlus.core.util.recipe.RecipeUtils; import net.minecraft.item.ItemStack; public class RecipeGen_BlastSmelter { @@ -18,10 +20,13 @@ public class RecipeGen_BlastSmelter { for (Materials M : GregMaterials){ - if (!M.equals(Materials.Osmiridium)){ + if (M.equals(Materials.Iridium) || M.equals(Materials.Osmium) || M.equals(Materials.Osmiridium) + /*|| !M.equals(Materials.Osmiridium) || !M.equals(Materials.Osmiridium) || !M.equals(Materials.Osmiridium) + || !M.equals(Materials.Osmiridium) || !M.equals(Materials.Osmiridium) || !M.equals(Materials.Osmiridium) + || !M.equals(Materials.Osmiridium) || !M.equals(Materials.Osmiridium) || !M.equals(Materials.Osmiridium) + || !M.equals(Materials.Osmiridium) || !M.equals(Materials.Osmiridium) || !M.equals(Materials.Osmiridium)*/ + ){ - } - else { //Add a Blast Smelting Recipe, Let's go! ItemStack tStack; @@ -33,26 +38,26 @@ public class RecipeGen_BlastSmelter { short counter=0; int inputStackCount=0; int fluidAmount=0; - boolean doTest = false; + boolean doTest = true; //This Bad boy here is what dictates unique recipes. Fuck life, right? - ItemStack circuitGT = UtilsItems.getGregtechCircuit(0); + ItemStack circuitGT = ItemUtils.getGregtechCircuit(0); //Set a duration int duration = 0; - if (M.mBlastFurnaceTemp > 100){ - duration = (int) Math.max(M.getMass() / 30L, 1L) * M.mBlastFurnaceTemp; + if (M.mBlastFurnaceTemp > 150){ + duration = (int) Math.max(M.getMass() / 50L, 1L) * M.mBlastFurnaceTemp; } else { - duration = (int) Math.max(M.getMass() / 30L, 1L) * 200; + 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)}; - circuitGT = UtilsItems.getGregtechCircuit(1); - ItemStack[] tItemStackTest = new ItemStack[]{circuitGT, UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dust"+M, 1)}; + circuitGT = ItemUtils.getGregtechCircuit(1); + ItemStack[] tItemStackTest = new ItemStack[]{circuitGT, ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dust"+M, 1)}; inputStackCount = 1; fluidAmount = 144*inputStackCount; Utils.LOG_INFO("Adding an Alloy Blast Smelter Recipe for "+M+". Gives "+fluidAmount+"L of molten metal."); @@ -64,10 +69,10 @@ public class RecipeGen_BlastSmelter { //Generate Recipes for all singular materials that can be made molten. if (M.mBlastFurnaceRequired) { - doTest = CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getMolten(fluidAmount), 100, duration, 240); + //doTest = CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getMolten(fluidAmount), 100, duration, 240); } else { - doTest = CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getMolten(fluidAmount), 100, duration/2, 120); + //doTest = CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getMolten(fluidAmount), 100, duration/2, 120); } if (doTest){ @@ -84,7 +89,7 @@ public class RecipeGen_BlastSmelter { //If this Material has some kind of compound list, proceed if (mMaterialListSize > 1){ MaterialStack[] tempStack = new MaterialStack[mMaterialListSize]; - circuitGT = UtilsItems.getGregtechCircuit(mMaterialListSize); + circuitGT = ItemUtils.getGregtechCircuit(mMaterialListSize); //Just double checking if (tempStack.length > 1){ @@ -102,7 +107,7 @@ public class RecipeGen_BlastSmelter { for (MaterialStack aOutputPart : tempStack){ if (aOutputPart != null){ Utils.LOG_INFO("Finding dust: "+aOutputPart.mMaterial); - ItemStack rStack = UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dust"+aOutputPart.mMaterial, (int) aOutputPart.mAmount); + ItemStack rStack = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dust"+aOutputPart.mMaterial, (int) aOutputPart.mAmount); if (rStack != null){ Utils.LOG_INFO("Found dust: "+aOutputPart.mMaterial); components[counter] = rStack; @@ -112,20 +117,28 @@ public class RecipeGen_BlastSmelter { counter++; } - 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; + 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<components.length;fr++){ + if (fr==0){ + components[0] = circuitGT; + } + else { + components[fr] = components_NoCircuit[fr-1]; + } } - else { - 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; @@ -137,10 +150,10 @@ public class RecipeGen_BlastSmelter { Utils.LOG_INFO("tMaterial["+das+"]: "+components[das].getDisplayName()+" Meta: "+components[das].getItemDamage()+", Amount: "+components[das].stackSize); } if (M.mBlastFurnaceRequired) { - CORE.RA.addBlastSmelterRecipe(components, M.getMolten(fluidAmount), 100, duration, 500); + //CORE.RA.addBlastSmelterRecipe(components, M.getMolten(fluidAmount), 100, duration, 500); } else { - CORE.RA.addBlastSmelterRecipe(components, M.getMolten(fluidAmount), 100, duration, 240); + //CORE.RA.addBlastSmelterRecipe(components, M.getMolten(fluidAmount), 100, duration, 240); } } } @@ -148,6 +161,120 @@ public class RecipeGen_BlastSmelter { } } } + } + + + public static void generateARecipe(Material M){ + + //Add a Blast Smelting Recipe, Let's go! + ItemStack tStack; + if (null != (tStack = M.getDust(1))) { + + //Prepare some Variables + ItemStack[] components; + gtPlusPlus.core.material.MaterialStack[] tMaterial; + short counter=0; + int inputStackCount=0; + int fluidAmount=0; + boolean doTest = true; + tMaterial = M.getComposites(); + + //This Bad boy here is what dictates unique recipes. Fuck life, right? + ItemStack circuitGT = ItemUtils.getGregtechCircuit(0); + + + //Set a duration + int duration = 0; + if (M.getMeltingPoint_K() > 150){ + duration = (int) Math.max(M.getMass() / 50L, 1L) * M.getMeltingPoint_K(); + } + else { + duration = (int) Math.max(M.getMass() / 50L, 1L) * 150; + } + + + //Make a simple one Material Materialstack[] and log it for validity. + circuitGT = ItemUtils.getGregtechCircuit(1); + ItemStack[] tItemStackTest = new ItemStack[]{/*circuitGT,*/ tStack}; + inputStackCount = 1; + fluidAmount = 144*inputStackCount; + Utils.LOG_INFO("Adding an Alloy Blast Smelter Recipe for "+M.getLocalizedName()+". Gives "+fluidAmount+"L of molten metal."); + for (int das=0;das<tItemStackTest.length;das++){ + if (tItemStackTest[das] != null) + Utils.LOG_INFO("tMaterial["+das+"]: "+tItemStackTest[das].getDisplayName()+" Meta: "+tItemStackTest[das].getItemDamage()+", Amount: "+tItemStackTest[das].stackSize); + } + + //Generate Recipes for all singular materials that can be made molten. + if (M.requiresBlastFurnace()) { + CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getMolten(fluidAmount), 100, duration, 240); + } + else { + CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getMolten(fluidAmount), 100, duration/2, 120); + } + + if (tMaterial != null){ + //Reset the Variables for compounds if last recipe was a success. + inputStackCount=0; + counter=0; + + + int mMaterialListSize=0; + for (gtPlusPlus.core.material.MaterialStack ternkfsdf:M.getComposites()){ + mMaterialListSize++; + } + Utils.LOG_INFO("Size: "+mMaterialListSize); + //If this Material has some kind of compound list, proceed + if (mMaterialListSize > 1){ + 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){ + Utils.LOG_INFO("FOUND: "+xMaterial.getStackMaterial().getLocalizedName()); + Utils.LOG_INFO("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 + components = new ItemStack[9]; + inputStackCount=0; + for (int irc=0;irc<M.getComposites().length;irc++){ + if (M.getComposites()[irc] != null){ + int r = (int) M.vSmallestRatio[irc]; + inputStackCount = inputStackCount+r; + components[irc] = M.getComposites()[irc].getDustStack(r); + } + } + + //Set Fluid output + fluidAmount = 144*inputStackCount; + + + Utils.LOG_INFO("Adding an Alloy Blast Smelter Recipe for "+M.getLocalizedName()+" using it's compound dusts. This material has "+ inputStackCount+" parts. Gives "+fluidAmount+"L of molten metal."); + Utils.LOG_INFO("tMaterial.length: "+components.length+"."); + for (int das=0;das<components.length;das++){ + if (components[das] != null) + Utils.LOG_INFO("tMaterial["+das+"]: "+components[das].getDisplayName()+" Meta: "+components[das].getItemDamage()+", Amount: "+components[das].stackSize); + } + if (M.requiresBlastFurnace()) { + CORE.RA.addBlastSmelterRecipe(components, M.getMolten(fluidAmount), 100, duration, 500); + } + else { + CORE.RA.addBlastSmelterRecipe(components, M.getMolten(fluidAmount), 100, duration, 240); + } + } + } + } + else { + Utils.LOG_INFO("doTest: "+doTest+" | tMaterial != null: "+(tMaterial != null)); + } + } } @@ -157,7 +284,7 @@ public class RecipeGen_BlastSmelter { short counter=0; for (MaterialStack aOutputPart : aInput){ if (aOutputPart != null && components[counter] != null){ - ItemStack aStack = UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dust"+aOutputPart.mMaterial, (int) aOutputPart.mAmount); + ItemStack aStack = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dust"+aOutputPart.mMaterial, (int) aOutputPart.mAmount); components[counter] = aStack; } counter++; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java index 6a499a640e..2d4038c74f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java @@ -3,8 +3,8 @@ package gtPlusPlus.xmod.gregtech.loaders; import gregtech.api.enums.GT_Values; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.item.UtilsItems; -import gtPlusPlus.core.util.recipe.UtilsRecipe; +import gtPlusPlus.core.util.item.ItemUtils; +import gtPlusPlus.core.util.recipe.RecipeUtils; import net.minecraft.item.ItemStack; public class RecipeGen_DustGeneration { @@ -15,7 +15,7 @@ public class RecipeGen_DustGeneration { Utils.LOG_INFO("Generating Shaped Crafting recipes for "+material.getLocalizedName()); //TODO //Ring Recipe - if (UtilsRecipe.addShapedGregtechRecipe( + if (RecipeUtils.addShapedGregtechRecipe( "craftingToolWrench", null, null, null, material.getRod(1), null, null, null, null, @@ -34,7 +34,7 @@ public class RecipeGen_DustGeneration { ItemStack[] inputStacks = material.getMaterialComposites(); ItemStack outputStacks = material.getDust(material.smallestStackSizeWhenProcessing); - if (UtilsRecipe.recipeBuilder( + if (RecipeUtils.recipeBuilder( tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, @@ -45,7 +45,7 @@ public class RecipeGen_DustGeneration { Utils.LOG_INFO("9 Tiny dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Failed"); } - if (UtilsRecipe.recipeBuilder( + if (RecipeUtils.recipeBuilder( normalDust, null, null, null, null, null, null, null, null, @@ -57,7 +57,7 @@ public class RecipeGen_DustGeneration { } - if (UtilsRecipe.recipeBuilder( + if (RecipeUtils.recipeBuilder( smallDust, smallDust, null, smallDust, smallDust, null, null, null, null, @@ -69,7 +69,7 @@ public class RecipeGen_DustGeneration { } - if (UtilsRecipe.recipeBuilder( + if (RecipeUtils.recipeBuilder( null, normalDust, null, null, null, null, null, null, null, @@ -82,14 +82,14 @@ public class RecipeGen_DustGeneration { if (inputStacks.length > 0){ - Utils.LOG_INFO(UtilsItems.getArrayStackNames(inputStacks)); + Utils.LOG_INFO(ItemUtils.getArrayStackNames(inputStacks)); long[] inputStackSize = material.vSmallestRatio; if (inputStackSize != null){ for (short x=0;x<inputStacks.length;x++){ if (inputStacks[x] != null && inputStackSize[x] != 0) inputStacks[x].stackSize = (int) inputStackSize[x]; } - Utils.LOG_INFO(UtilsItems.getArrayStackNames(inputStacks)); + Utils.LOG_INFO(ItemUtils.getArrayStackNames(inputStacks)); if (GT_Values.RA.addMixerRecipe( inputStacks[0], inputStacks[1], inputStacks[2], inputStacks[3], diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java index d62e472b0d..804d226f67 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java @@ -3,25 +3,25 @@ package gtPlusPlus.xmod.gregtech.loaders; import gregtech.api.util.GT_ModHandler; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.recipe.UtilsRecipe; +import gtPlusPlus.core.util.recipe.RecipeUtils; import net.minecraft.item.ItemStack; public class RecipeGen_ShapedCrafting { public static void generateRecipes(Material material){ Utils.LOG_INFO("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)}); + Character.valueOf('I'), + material.getIngot(1), + Character.valueOf('B'), + material.getIngot(1)}); GT_ModHandler.addShapelessCraftingRecipe( material.getPlate(1), @@ -34,20 +34,20 @@ public class RecipeGen_ShapedCrafting { 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)}); - + 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 (UtilsRecipe.recipeBuilder( + if (RecipeUtils.recipeBuilder( "craftingToolHardHammer", null, null, null, material.getRod(1), null, null, null, null, @@ -59,10 +59,11 @@ public class RecipeGen_ShapedCrafting { } } + //Framebox Recipe if (!material.isRadioactive){ ItemStack stackStick = material.getRod(1); - if (UtilsRecipe.recipeBuilder( + if (RecipeUtils.recipeBuilder( stackStick, stackStick, stackStick, stackStick, "craftingToolWrench", stackStick, stackStick, stackStick, stackStick, @@ -74,9 +75,32 @@ public class RecipeGen_ShapedCrafting { } } + + //Add a shapeless recipe for each dust this way - Compat mode. + ItemStack[] shapelessInput = new ItemStack[material.getMaterialComposites().length]; + int arrayLocation=0; + if (shapelessInput.length > 1){ + for (ItemStack I : material.getMaterialComposites()){ + if (I != null && material.vSmallestRatio != null){ + shapelessInput[arrayLocation] = I; + shapelessInput[arrayLocation].stackSize = (int) material.vSmallestRatio[arrayLocation]; + } + } + if (RecipeUtils.buildShapelessRecipe( + material.getDust(material.smallestStackSizeWhenProcessing), + shapelessInput + )){ + Utils.LOG_INFO("Shapeless Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Utils.LOG_INFO("Shapeless Recipe: "+material.getLocalizedName()+" - Failed"); + } + } + + //Shaped Recipe - Bolts if (!material.isRadioactive){ - if (UtilsRecipe.recipeBuilder( + if (RecipeUtils.recipeBuilder( "craftingToolSaw", null, null, null, material.getRod(1), null, null, null, null, @@ -90,7 +114,7 @@ public class RecipeGen_ShapedCrafting { //Shaped Recipe - Ingot to Rod - if (UtilsRecipe.recipeBuilder( + if (RecipeUtils.recipeBuilder( "craftingToolFile", null, null, null, material.getIngot(1), null, null, null, null, @@ -103,7 +127,7 @@ public class RecipeGen_ShapedCrafting { //Shaped Recipe - Long Rod to two smalls - if (UtilsRecipe.recipeBuilder( + if (RecipeUtils.recipeBuilder( "craftingToolSaw", null, null, material.getLongRod(1), null, null, null, null, null, @@ -115,7 +139,7 @@ public class RecipeGen_ShapedCrafting { } //Two small to long rod - if (UtilsRecipe.recipeBuilder( + if (RecipeUtils.recipeBuilder( material.getRod(1), "craftingToolHardHammer", material.getRod(1), null, null, null, null, null, null, @@ -128,7 +152,7 @@ public class RecipeGen_ShapedCrafting { //Rotor Recipe if (!material.isRadioactive){ - if (UtilsRecipe.recipeBuilder( + if (RecipeUtils.recipeBuilder( material.getPlate(1), "craftingToolHardHammer", material.getPlate(1), material.getScrew(1), material.getRing(1), "craftingToolFile", material.getPlate(1), "craftingToolScrewdriver", material.getPlate(1), @@ -142,7 +166,7 @@ public class RecipeGen_ShapedCrafting { //Screws if (!material.isRadioactive){ - if (UtilsRecipe.recipeBuilder( + if (RecipeUtils.recipeBuilder( "craftingToolFile", material.getBolt(1), null, material.getBolt(1), null, null, null, null, null, |