From 6205a2088bbbc31a09d0a2a3d460add1a7622801 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Mon, 29 Oct 2018 05:09:01 +0000 Subject: + Added recipe for heating Titanium Ingots, required for Krypton processing. + Added custom GT TextureSets. $ Lots of small fixes to Material, Material Generation & Recipe Generation. $ Lots of small fixes to Fluids, Fluid Generation and Fluid Cell Generation. $ Fixed Creative Tabs. $ Possibly fixed issue where tickable items would instantly tick to 0. $ Fixed display names of Throwable Potions. $ Fixed NPE in removeCrudeTurbineRotors(). % Adjusted lots of textures. % Adjusted handling of Thermal Foundation Fluids. % Moved Furnace/EBF and Maceration recipes out of BaseItemDust.java. % Made Tooltips of GT++ Material Blocks, Frames and ores more informational. % Made Bromine a Fluid Material, this will remove all Bromine solid material items from the world. (Ingots, Blocks, etc.) % Increased cost of GT++ Ores in processing. - Broke lots of recipes. > EBF/ABS & All Table Crafting. TBA~ --- .../gregtech/loaders/RecipeGen_DustGeneration.java | 88 +++++++++++++++++++++- .../xmod/gregtech/loaders/RecipeGen_Ore.java | 26 ++++--- 2 files changed, 102 insertions(+), 12 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech/loaders') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java index 1bef648bd2..b588613224 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java @@ -14,11 +14,13 @@ import gregtech.api.util.GT_Utility; import gtPlusPlus.api.interfaces.RunnableWithInfo; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.MaterialGenerator; import gtPlusPlus.core.material.MaterialStack; import gtPlusPlus.core.material.state.MaterialState; import gtPlusPlus.core.recipe.common.CI; +import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.RecipeUtils; import net.minecraftforge.fluids.FluidStack; @@ -118,7 +120,13 @@ public class RecipeGen_DustGeneration extends RecipeGen_Base { if (smallDust != null && tinyDust != null) { generatePackagerRecipes(material); } - + + ItemStack ingot = material.getIngot(1); + if (normalDust != null && ingot != null) { + addFurnaceRecipe(material); + addMacerationRecipe(material); + } + //Is this a composite? if ((inputStacks != null) && !disableOptional){ //Is this a composite? @@ -352,5 +360,83 @@ public class RecipeGen_DustGeneration extends RecipeGen_Base { return true; } + private void addMacerationRecipe(Material aMatInfo){ + try { + Logger.MATERIALS("Adding Maceration recipe for "+aMatInfo.getLocalizedName()+" Ingot -> Dusts"); + final int chance = (aMatInfo.vTier*10)/MathUtils.randInt(10, 20); + GT_ModHandler.addPulverisationRecipe(aMatInfo.getIngot(1), aMatInfo.getDust(1), null, chance); + } + catch (Throwable t) { + t.printStackTrace(); + } + } + + private void addFurnaceRecipe(Material aMatInfo){ + + ItemStack aDust = aMatInfo.getDust(1); + ItemStack aOutput; + try { + if (aMatInfo.requiresBlastFurnace()) { + aOutput = aMatInfo.getHotIngot(1); + if (aOutput != null) { + if (addBlastFurnaceRecipe(aMatInfo, aDust, null, aOutput, null, aMatInfo.getMeltingPointK())){ + Logger.MATERIALS("Successfully added a blast furnace recipe for "+aMatInfo.getLocalizedName()); + } + else { + Logger.MATERIALS("Failed to add a blast furnace recipe for "+aMatInfo.getLocalizedName()); + } + } + else { + Logger.MATERIALS("Failed to add a blast furnace recipe for "+aMatInfo.getLocalizedName()); + } + } + else { + aOutput = aMatInfo.getIngot(1); + if (aOutput != null) { + if (CORE.GT_Recipe.addSmeltingAndAlloySmeltingRecipe(aDust, aOutput)){ + Logger.MATERIALS("Successfully added a furnace recipe for "+aMatInfo.getLocalizedName()); + } + else { + Logger.MATERIALS("Failed to add a furnace recipe for "+aMatInfo.getLocalizedName()); + } + } + } + } + catch (Throwable t) { + t.printStackTrace(); + } + + } + + private boolean addBlastFurnaceRecipe(Material aMatInfo, final ItemStack input1, final ItemStack input2, final ItemStack output1, final ItemStack output2, final int tempRequired){ + + try { + int timeTaken = 125*aMatInfo.vTier*10; + + if (aMatInfo.vTier <= 4){ + timeTaken = 25*aMatInfo.vTier*10; + } + int aSlot = aMatInfo.vTier - 1; + if (aSlot < 2) { + aSlot = 2; + } + long aVoltage = GT_Values.V[aSlot >= 2 ? aSlot : 2]; + + return GT_Values.RA.addBlastRecipe( + input1, + input2, + GT_Values.NF, GT_Values.NF, + output1, + output2, + timeTaken, + (int) aVoltage, + tempRequired); + } + catch (Throwable t) { + t.printStackTrace(); + return false; + } + } + } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java index 771a48c809..99984d98bf 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java @@ -44,7 +44,11 @@ public class RecipeGen_Ore implements Runnable{ //if (material.getMaterialComposites().length > 1){ Logger.MATERIALS("[Recipe Generator Debug] ["+material.getLocalizedName()+"]"); - final int tVoltageMultiplier = material.getMeltingPointK() >= 2800 ? 120 : 30; + int tVoltageMultiplier = MaterialUtils.getVoltageForTier(material.vTier); + if (tVoltageMultiplier < 120) { + tVoltageMultiplier = material.getMeltingPointK() >= 2800 ? 480 : 120; + } + final ItemStack dustStone = ItemUtils.getItemStackOfAmountFromOreDict("dustStone", 1); Material bonusA = null; //Ni Material bonusB = null; //Tin @@ -101,19 +105,19 @@ public class RecipeGen_Ore implements Runnable{ * Macerate */ //Macerate ore to Crushed - if (GT_Values.RA.addPulveriserRecipe(material.getOre(1), new ItemStack[]{material.getCrushed(2)}, new int[]{10000}, 20*20, 2)){ + if (GT_Values.RA.addPulveriserRecipe(material.getOre(1), new ItemStack[]{material.getCrushed(2)}, new int[]{10000}, 20*20, tVoltageMultiplier/2)){ Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate ore to Crushed ore'"); } //Macerate Crushed to Impure Dust - if (GT_Values.RA.addPulveriserRecipe(material.getCrushed(1), new ItemStack[]{material.getDustImpure(1), bonusA.getDust(1)}, new int[]{10000, 1000}, 20*20, 2)){ + if (GT_Values.RA.addPulveriserRecipe(material.getCrushed(1), new ItemStack[]{material.getDustImpure(1), bonusA.getDust(1)}, new int[]{10000, 1000}, 20*20, tVoltageMultiplier/2)){ Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate Crushed ore to Impure Dust'"); } //Macerate Washed to Purified Dust - if (GT_Values.RA.addPulveriserRecipe(material.getCrushedPurified(1), new ItemStack[]{material.getDustPurified(1), bonusA.getDust(1)}, new int[]{10000, 1000}, 20*20, 2)){ + if (GT_Values.RA.addPulveriserRecipe(material.getCrushedPurified(1), new ItemStack[]{material.getDustPurified(1), bonusA.getDust(1)}, new int[]{10000, 1000}, 20*20, tVoltageMultiplier/2)){ Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate Washed ore to Purified Dust'"); } //Macerate Centrifuged to Pure Dust - if (GT_Values.RA.addPulveriserRecipe(material.getCrushedCentrifuged(1), new ItemStack[]{material.getDust(1), bonusA.getDust(1)}, new int[]{10000, 1000}, 20*20, 2)){ + if (GT_Values.RA.addPulveriserRecipe(material.getCrushedCentrifuged(1), new ItemStack[]{material.getDust(1), bonusA.getDust(1)}, new int[]{10000, 1000}, 20*20, tVoltageMultiplier/2)){ Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate Centrifuged ore to Pure Dust'"); } @@ -168,13 +172,13 @@ public class RecipeGen_Ore implements Runnable{ /** * Forge Hammer */ - if (GT_Values.RA.addForgeHammerRecipe(material.getCrushedCentrifuged(1), material.getDust(1), 10, 16)){ + if (GT_Values.RA.addForgeHammerRecipe(material.getCrushedCentrifuged(1), material.getDust(1), 10, tVoltageMultiplier/4)){ Logger.MATERIALS("[ForgeHammer] Added Recipe: 'Crushed Centrifuged to Pure Dust'"); } - if (GT_Values.RA.addForgeHammerRecipe(material.getCrushedPurified(1), material.getDustPurified(1), 10, 16)){ + if (GT_Values.RA.addForgeHammerRecipe(material.getCrushedPurified(1), material.getDustPurified(1), 10, tVoltageMultiplier/4)){ Logger.MATERIALS("[ForgeHammer] Added Recipe: 'Crushed Purified to Purified Dust'"); } - if (GT_Values.RA.addForgeHammerRecipe(material.getOre(1), material.getCrushed(1), 10, 16)){ + if (GT_Values.RA.addForgeHammerRecipe(material.getOre(1), material.getCrushed(1), 10, tVoltageMultiplier/4)){ Logger.MATERIALS("[ForgeHammer] Added Recipe: 'Ore to Crushed'"); } @@ -190,7 +194,7 @@ public class RecipeGen_Ore implements Runnable{ null, null,null, new int[]{10000, 10000}, //Chances 5*20, //Eu - 5)){ //Time + tVoltageMultiplier/2)){ //Time Logger.MATERIALS("[Centrifuge] Added Recipe: Purified Dust to Clean Dust"); } @@ -203,7 +207,7 @@ public class RecipeGen_Ore implements Runnable{ null, null,null, new int[]{10000, 10000}, //Chances 5*20, //Eu - 5)){ //Time + tVoltageMultiplier/2)){ //Time Logger.MATERIALS("[Centrifuge] Added Recipe: Inpure Dust to Clean Dust"); } @@ -287,7 +291,7 @@ public class RecipeGen_Ore implements Runnable{ mInternalOutputs[4], mInternalOutputs[5], mChances, - 20*90, + 20*1*(tVoltageMultiplier/10), tVoltageMultiplier)){ Logger.MATERIALS("[Electrolyzer] Generated Electrolyzer recipe for "+material.getDust(1).getDisplayName()); } -- cgit