From 6754387bca14ef3c2bdc5e69d0f4920ca7568553 Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Sun, 23 Oct 2016 16:39:30 +1000 Subject: % Moved more recipe generation to separate classes, now the order of item generation isn't important because recipe generation now happens after, not during item creation. % Most Generated Item classes are now < 10 lines. > This should slightly improve the startup time by 10-15 seconds, maybe more, maybe less. --- .../xmod/gregtech/loaders/RecipeGen_Extruder.java | 117 +++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java (limited to 'src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java new file mode 100644 index 0000000000..0f9a1bca7f --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java @@ -0,0 +1,117 @@ +package gtPlusPlus.xmod.gregtech.loaders; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.ItemList; +import gregtech.api.util.GT_Recipe; +import gtPlusPlus.core.material.Material; +import gtPlusPlus.core.util.Utils; +import net.minecraft.item.ItemStack; + +public class RecipeGen_Extruder { + + public static void generateRecipes(Material material){ + + int tVoltageMultiplier = material.getMeltingPoint_K() >= 2800 ? 64 : 16; + ItemStack itemIngot = material.getIngot(1); + ItemStack plate_Single = material.getPlate(1); + ItemStack itemGear = material.getGear(1); + + ItemStack shape_Plate = ItemList.Shape_Extruder_Plate.get(0); + ItemStack shape_Ring = ItemList.Shape_Extruder_Ring.get(0); + ItemStack shape_Gear = ItemList.Shape_Extruder_Gear.get(0); + ItemStack shape_Rod = ItemList.Shape_Extruder_Rod.get(0); + ItemStack shape_Bolt = ItemList.Shape_Extruder_Bolt.get(0); + + Utils.LOG_INFO("Generating Extruder recipes for "+material.getLocalizedName()); + + + //Plate Recipe + if (addExtruderRecipe( + itemIngot, + shape_Plate, + plate_Single, + 10, 4 * tVoltageMultiplier)){ + Utils.LOG_INFO("Extruder Plate Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Utils.LOG_INFO("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_INFO("Extruder Ring Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Utils.LOG_INFO("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_INFO("Extruder Gear Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Utils.LOG_INFO("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_INFO("Extruder Rod Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Utils.LOG_INFO("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), + 8 * material.vVoltageMultiplier)){ + Utils.LOG_INFO("Extruder Bolt Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Utils.LOG_INFO("Extruder Bolt Recipe: "+material.getLocalizedName()+" - Failed"); + } + } + + } + + + 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; + } + + + +} -- cgit From 4937f40b30d4d2ce381332b0ab5b83ddabb274b0 Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Mon, 24 Oct 2016 06:03:19 +1000 Subject: + Basically rewrote dust recipe handling. $ Fixed Ring recipes using a Wrench instead of a Hard hammer. % Adjusted some Alloy compositions, however, this has caused some overlaps which will need to be adjusted again. (Zeron, Hastelloy X/W, MS 300/350) --- .../core/item/base/dusts/BaseItemDust.java | 75 -------------- src/Java/gtPlusPlus/core/material/ALLOY.java | 59 ++++++----- src/Java/gtPlusPlus/core/material/Material.java | 38 +++++-- src/Java/gtPlusPlus/core/util/item/UtilsItems.java | 2 + .../gregtech/loaders/RecipeGen_DustGeneration.java | 109 +++++++++++++++++++++ .../xmod/gregtech/loaders/RecipeGen_Extruder.java | 2 +- .../loaders/RecipeGen_PleaseRefactorMe.java | 28 ------ .../gregtech/loaders/RecipeGen_ShapedCrafting.java | 2 +- 8 files changed, 173 insertions(+), 142 deletions(-) create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java delete mode 100644 src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_PleaseRefactorMe.java (limited to 'src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java') diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java index be020b7d05..7638da6f0a 100644 --- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java +++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java @@ -9,7 +9,6 @@ import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.UtilsItems; import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.recipe.UtilsRecipe; import java.util.List; @@ -72,7 +71,6 @@ public class BaseItemDust extends Item{ oredictName = temp; GT_OreDictUnificator.registerOre(temp, UtilsItems.getSimpleStack(this)); } - addMixerRecipe(); addFurnaceRecipe(); addMacerationRecipe(); } @@ -133,79 +131,6 @@ public class BaseItemDust extends Item{ } - - - private void addMixerRecipe(){ - - ItemStack thisItem; - ItemStack normalDust = dustInfo.getDust(1); - ItemStack smallDust = dustInfo.getSmallDust(1); - ItemStack tinyDust = dustInfo.getTinyDust(1); - - ItemStack[] inputStacks = dustInfo.getMaterialComposites(); - ItemStack outputStacks = dustInfo.getDust(10); - - if (oredictName.contains("dustTiny")){ - thisItem = tinyDust; - ItemStack normalStack = dustInfo.getDust(1); - ItemStack tinyStack = dustInfo.getTinyDust(9); - Utils.LOG_INFO("Generating a 9 Tiny dust to 1 Dust recipe for "+materialName); - UtilsRecipe.recipeBuilder( - thisItem, thisItem, thisItem, - thisItem, thisItem, thisItem, - thisItem, thisItem, thisItem, - normalStack); - - Utils.LOG_INFO("Generating a 9 Tiny dust from 1 Dust recipe for "+materialName); - UtilsRecipe.recipeBuilder( - normalStack, null, null, - null, null, null, - null, null, null, - tinyStack); - - } - else if (oredictName.contains("dustSmall")){ - thisItem = smallDust; - ItemStack normalStack = dustInfo.getDust(1); - ItemStack smallStack = dustInfo.getSmallDust(4); - - Utils.LOG_INFO("Generating a 4 Small dust to 1 Dust recipe for "+materialName); - UtilsRecipe.recipeBuilder( - thisItem, thisItem, null, - thisItem, thisItem, null, - null, null, null, - normalStack); - - Utils.LOG_INFO("Generating a 4 Small dust from 1 Dust recipe for "+materialName); - UtilsRecipe.recipeBuilder( - null, normalStack, null, - null, null, null, - null, null, null, - smallStack); - - } - else { - thisItem = normalDust; - } - - if (thisItem == normalDust){ - Utils.LOG_WARNING("Generating a Dust recipe for "+materialName+" in the mixer."); - - if (inputStacks.length != 0){ - GT_Values.RA.addMixerRecipe( - inputStacks[0], inputStacks[1], - inputStacks[2], inputStacks[3], - null, null, - outputStacks, - 8*mTier*20, 8*mTier*2); - } - else { - return; - } - } - } - - private void addMacerationRecipe(){ Utils.LOG_WARNING("Adding recipe for "+materialName+" Dusts"); diff --git a/src/Java/gtPlusPlus/core/material/ALLOY.java b/src/Java/gtPlusPlus/core/material/ALLOY.java index 0aa819ee48..ea5b90259f 100644 --- a/src/Java/gtPlusPlus/core/material/ALLOY.java +++ b/src/Java/gtPlusPlus/core/material/ALLOY.java @@ -35,7 +35,8 @@ public final class ALLOY { true, //Uses Blast furnace? //Material Stacks with Percentage of required elements. new MaterialStack[]{ - new MaterialStack(ELEMENT.URANIUM, 90), + new MaterialStack(ELEMENT.URANIUM, 45), + new MaterialStack(ELEMENT.URANIUM, 45), new MaterialStack(ELEMENT.TITANIUM, 10) }); @@ -49,9 +50,9 @@ public final class ALLOY { true, //Uses Blast furnace? //Material Stacks with Percentage of required elements. new MaterialStack[]{ - new MaterialStack(ELEMENT.TUNGSTEN, 7), - new MaterialStack(ELEMENT.TANTALUM, 90), - new MaterialStack(ELEMENT.TANTALUM, 2) + new MaterialStack(ELEMENT.TUNGSTEN, 8), + new MaterialStack(ELEMENT.TANTALUM, 46), + new MaterialStack(ELEMENT.TANTALUM, 46) }); public static final Material TANTALLOY_61 = new Material( @@ -64,10 +65,10 @@ public final class ALLOY { true, //Uses Blast furnace? //Material Stacks with Percentage of required elements. new MaterialStack[]{ - new MaterialStack(ELEMENT.TUNGSTEN, 10), - new MaterialStack(ELEMENT.TANTALUM, 70), - new MaterialStack(ELEMENT.TITANIUM, 10), - new MaterialStack(ELEMENT.YTTRIUM, 10) + new MaterialStack(ELEMENT.TUNGSTEN, 20), + new MaterialStack(ELEMENT.TANTALUM, 60), + new MaterialStack(ELEMENT.TITANIUM, 12), + new MaterialStack(ELEMENT.YTTRIUM, 8) }); public static final Material QUANTUM = new Material( @@ -91,7 +92,8 @@ public final class ALLOY { false, //Uses Blast furnace? //Material Stacks with Percentage of required elements. new MaterialStack[]{ - new MaterialStack(ELEMENT.COPPER, 75), + new MaterialStack(ELEMENT.COPPER, 35), + new MaterialStack(ELEMENT.COPPER, 40), new MaterialStack(ELEMENT.TIN, 25) }); @@ -105,7 +107,8 @@ public final class ALLOY { false, //Uses Blast furnace? //Material Stacks with Percentage of required elements. new MaterialStack[]{ - new MaterialStack(ELEMENT.GOLD, 70), + new MaterialStack(ELEMENT.GOLD, 30), + new MaterialStack(ELEMENT.GOLD, 40), new MaterialStack(ELEMENT.COPPER, 30) }); @@ -193,8 +196,10 @@ public final class ALLOY { true, //Uses Blast furnace? //Material Stacks with Percentage of required elements. new MaterialStack[]{ - new MaterialStack(ELEMENT.CARBON, 05), - new MaterialStack(ELEMENT.IRON, 95) + new MaterialStack(ELEMENT.CARBON, 10), + new MaterialStack(ELEMENT.IRON, 30), + new MaterialStack(ELEMENT.IRON, 30), + new MaterialStack(ELEMENT.IRON, 30) }); public static final Material ZERON_100 = new Material( @@ -224,9 +229,9 @@ public final class ALLOY { //Material Stacks with Percentage of required elements. new MaterialStack[]{ new MaterialStack(ELEMENT.TITANIUM, 5), - new MaterialStack(ELEMENT.NICKEL, 16), - new MaterialStack(ELEMENT.COBALT, 9), - new MaterialStack(ALLOY.STEEL, 70) + new MaterialStack(ELEMENT.NICKEL, 25), + new MaterialStack(ELEMENT.COBALT, 10), + new MaterialStack(ALLOY.STEEL, 60) }); public static final Material MARAGING300 = new Material( @@ -240,8 +245,8 @@ public final class ALLOY { //Material Stacks with Percentage of required elements. new MaterialStack[]{ new MaterialStack(ELEMENT.TITANIUM, 10), - new MaterialStack(ELEMENT.NICKEL, 21), - new MaterialStack(ELEMENT.COBALT, 14), + new MaterialStack(ELEMENT.NICKEL, 20), + new MaterialStack(ELEMENT.COBALT, 15), new MaterialStack(ALLOY.STEEL, 55) }); @@ -256,8 +261,8 @@ public final class ALLOY { //Material Stacks with Percentage of required elements. new MaterialStack[]{ new MaterialStack(ELEMENT.TITANIUM, 15), - new MaterialStack(ELEMENT.NICKEL, 21), - new MaterialStack(ELEMENT.COBALT, 9), + new MaterialStack(ELEMENT.NICKEL, 20), + new MaterialStack(ELEMENT.COBALT, 10), new MaterialStack(ALLOY.STEEL, 55) }); @@ -305,8 +310,8 @@ public final class ALLOY { new MaterialStack[]{ new MaterialStack(ELEMENT.IRON, 06), new MaterialStack(ELEMENT.MOLYBDENUM, 24), - new MaterialStack(ELEMENT.CHROMIUM, 5), - new MaterialStack(ELEMENT.NICKEL, 65) + new MaterialStack(ELEMENT.CHROMIUM, 8), + new MaterialStack(ELEMENT.NICKEL, 62) }); /*public static final Material HASTELLOY_X = new Material( @@ -351,10 +356,10 @@ public final class ALLOY { true, //Uses Blast furnace? //Material Stacks with Percentage of required elements. new MaterialStack[]{ - new MaterialStack(ELEMENT.YTTRIUM, 05), + new MaterialStack(ELEMENT.YTTRIUM, 10), new MaterialStack(ELEMENT.MOLYBDENUM, 16), - new MaterialStack(ELEMENT.CHROMIUM, 7), - new MaterialStack(ELEMENT.NICKEL, 72) + new MaterialStack(ELEMENT.CHROMIUM, 10), + new MaterialStack(ELEMENT.NICKEL, 64) }); public static final Material HASTELLOY_C276 = new Material( @@ -415,10 +420,10 @@ public final class ALLOY { true, //Uses Blast furnace? //Material Stacks with Percentage of required elements. new MaterialStack[]{ - new MaterialStack(ELEMENT.IRON, 75), - new MaterialStack(ELEMENT.ALUMINIUM, 4), + new MaterialStack(ELEMENT.IRON, 64), + new MaterialStack(ELEMENT.ALUMINIUM, 12), new MaterialStack(ELEMENT.CHROMIUM, 20), - new MaterialStack(ELEMENT.YTTRIUM, 1) + new MaterialStack(ELEMENT.YTTRIUM, 4) }); public static final Material TUNGSTEN_CARBIDE = new Material( diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index 44a8c021f9..3190486537 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -6,10 +6,6 @@ import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.UtilsItems; import gtPlusPlus.core.util.materials.MaterialUtils; import gtPlusPlus.core.util.math.MathUtils; - -import java.util.ArrayList; -import java.util.List; - import net.minecraft.item.ItemStack; public class Material { @@ -20,7 +16,7 @@ public class Material { protected Object dataVar; private MaterialStack[] materialInput = new MaterialStack[4]; - final List mMaterialList = new ArrayList(); + public final long[] vSmallestRatio; final short[] RGBA; @@ -35,7 +31,7 @@ public class Material { final long vProtons; final long vNeutrons; final long vMass; - final int smallestStackSizeWhenProcessing; //Add a check for <=0 || > 64 + public final int smallestStackSizeWhenProcessing; //Add a check for <=0 || > 64 public final int vTier; public final int vVoltageMultiplier; public final String vChemicalFormula; @@ -65,14 +61,14 @@ public class Material { this.vNeutrons = neutrons; this.vMass = getMass(); - //List inputArray = Arrays.asList(inputs); + /*//List inputArray = Arrays.asList(inputs); int tempSmallestSize = getSmallestStackForCrafting(inputs); if (tempSmallestSize <= 64 && tempSmallestSize >= 1){ this.smallestStackSizeWhenProcessing = tempSmallestSize; //Valid stacksizes } else { this.smallestStackSizeWhenProcessing = 50; //Can divide my math by 1/2 and round it~ - } + }*/ //Sets the Rad level if (radiationLevel != 0){ @@ -134,6 +130,28 @@ public class Material { } } } + + this.vSmallestRatio = getSmallestRatio(materialInput); + int tempSmallestSize = 0; + + if (vSmallestRatio != null){ + for (int v=0;v= 1){ + this.smallestStackSizeWhenProcessing = tempSmallestSize; //Valid stacksizes + } + else { + this.smallestStackSizeWhenProcessing = 50; //Can divide my math by 1/2 and round it~ + }*/ //Makes a Fancy Chemical Tooltip this.vChemicalSymbol = chemicalSymbol; @@ -152,7 +170,7 @@ public class Material { dataVar = MathUtils.generateSingularRandomHexValue(); Utils.LOG_INFO("Creating a Material instance for "+materialName); - Utils.LOG_INFO("Formula: "+vChemicalFormula); + Utils.LOG_INFO("Formula: "+vChemicalFormula + " Smallest Stack: "+smallestStackSizeWhenProcessing+" Smallest Ratio:"+vSmallestRatio); Utils.LOG_INFO("Protons: "+vProtons); Utils.LOG_INFO("Neutrons: "+vNeutrons); Utils.LOG_INFO("Mass: "+vMass+"/units"); @@ -405,7 +423,7 @@ public class Material { return null; } - public int getSmallestStackForCrafting(MaterialStack[] inputs){ + private int getSmallestStackForCrafting(MaterialStack[] inputs){ if (inputs != null){ if (inputs.length != 0){ long[] smallestRatio = getSmallestRatio(inputs); diff --git a/src/Java/gtPlusPlus/core/util/item/UtilsItems.java b/src/Java/gtPlusPlus/core/util/item/UtilsItems.java index 530ac24f98..41dccda796 100644 --- a/src/Java/gtPlusPlus/core/util/item/UtilsItems.java +++ b/src/Java/gtPlusPlus/core/util/item/UtilsItems.java @@ -32,6 +32,7 @@ import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.fluid.FluidUtils; import gtPlusPlus.core.util.materials.MaterialUtils; import gtPlusPlus.core.util.wrapper.var; +import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_DustGeneration; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Extruder; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Plates; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_ShapedCrafting; @@ -386,6 +387,7 @@ public class UtilsItems { RecipeGen_Plates.generateRecipes(matInfo); RecipeGen_Extruder.generateRecipes(matInfo); RecipeGen_ShapedCrafting.generateRecipes(matInfo); + RecipeGen_DustGeneration.generateRecipes(matInfo); FluidUtils.generateFluid(matInfo, 1); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java new file mode 100644 index 0000000000..6a499a640e --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java @@ -0,0 +1,109 @@ +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 net.minecraft.item.ItemStack; + +public class RecipeGen_DustGeneration { + + public static void generateRecipes(Material material){ + int tVoltageMultiplier = material.getMeltingPoint_K() >= 2800 ? 64 : 16; + + Utils.LOG_INFO("Generating Shaped Crafting recipes for "+material.getLocalizedName()); //TODO + //Ring Recipe + + if (UtilsRecipe.addShapedGregtechRecipe( + "craftingToolWrench", null, null, + null, material.getRod(1), null, + null, null, null, + material.getRing(1))){ + Utils.LOG_INFO("Ring Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Utils.LOG_INFO("Ring Recipe: "+material.getLocalizedName()+" - Failed"); + } + + + ItemStack normalDust = material.getDust(1); + ItemStack smallDust = material.getSmallDust(1); + ItemStack tinyDust = material.getTinyDust(1); + + ItemStack[] inputStacks = material.getMaterialComposites(); + ItemStack outputStacks = material.getDust(material.smallestStackSizeWhenProcessing); + + if (UtilsRecipe.recipeBuilder( + tinyDust, tinyDust, tinyDust, + tinyDust, tinyDust, tinyDust, + tinyDust, tinyDust, tinyDust, + normalDust)){ + Utils.LOG_INFO("9 Tiny dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Utils.LOG_INFO("9 Tiny dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Failed"); + } + + if (UtilsRecipe.recipeBuilder( + normalDust, null, null, + null, null, null, + null, null, null, + material.getTinyDust(9))){ + Utils.LOG_INFO("9 Tiny dust from 1 Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Utils.LOG_INFO("9 Tiny dust from 1 Recipe: "+material.getLocalizedName()+" - Failed"); + } + + + if (UtilsRecipe.recipeBuilder( + smallDust, smallDust, null, + smallDust, smallDust, null, + null, null, null, + normalDust)){ + Utils.LOG_INFO("4 Small dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Utils.LOG_INFO("4 Small dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Failed"); + } + + + if (UtilsRecipe.recipeBuilder( + null, normalDust, null, + null, null, null, + null, null, null, + material.getSmallDust(4))){ + Utils.LOG_INFO("4 Small dust from 1 Dust Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Utils.LOG_INFO("4 Small dust from 1 Dust Recipe: "+material.getLocalizedName()+" - Failed"); + } + + + if (inputStacks.length > 0){ + Utils.LOG_INFO(UtilsItems.getArrayStackNames(inputStacks)); + long[] inputStackSize = material.vSmallestRatio; + if (inputStackSize != null){ + for (short x=0;x= 2800 ? 64 : 16; - Utils.LOG_INFO("Generating Shaped Crafting recipes for "+material.getLocalizedName()); //TODO - //Ring Recipe - - if (UtilsRecipe.addShapedGregtechRecipe( - "craftingToolWrench", null, null, - null, material.getRod(1), null, - null, null, null, - material.getRing(1))){ - Utils.LOG_INFO("Ring Recipe: "+material.getLocalizedName()+" - Success"); - } - else { - Utils.LOG_INFO("Ring Recipe: "+material.getLocalizedName()+" - Failed"); - } - - - - } -} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java index 65eb280c2f..d62e472b0d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java @@ -48,7 +48,7 @@ public class RecipeGen_ShapedCrafting { //Ring Recipe if (!material.isRadioactive){ if (UtilsRecipe.recipeBuilder( - "craftingToolWrench", null, null, + "craftingToolHardHammer", null, null, null, material.getRod(1), null, null, null, null, material.getRing(1))){ -- cgit From 39ba9e4d5f528b21397977807eae5eb9e62988d1 Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Wed, 26 Oct 2016 06:43:17 +1000 Subject: % Turned lots of logging off, moved it to debug logging. % Changed up the Alloys a bit to make them more unique. % Tweaked Chemical Formula handling, now it brackets compounds and crashes less. % Made mixer recipes generate for materials with 4 or less input stacks. % Got every material except 3 working within the Blast Smelter. (Hastelloy X & W, Zirconium Carbide) + Added Helium Blobs to dustHydrogen oreDict name. --- src/Java/gtPlusPlus/core/item/ModItems.java | 1 + src/Java/gtPlusPlus/core/material/ALLOY.java | 61 +++++++++------- src/Java/gtPlusPlus/core/material/Material.java | 84 ++++++++++++++-------- .../core/util/materials/MaterialUtils.java | 2 +- .../gregtech/loaders/RecipeGen_BlastSmelter.java | 65 +++++++++-------- .../gregtech/loaders/RecipeGen_DustGeneration.java | 32 ++++----- .../xmod/gregtech/loaders/RecipeGen_Extruder.java | 22 +++--- .../xmod/gregtech/loaders/RecipeGen_Plates.java | 22 +++--- .../gregtech/loaders/RecipeGen_ShapedCrafting.java | 42 +++++------ 9 files changed, 186 insertions(+), 145 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java') diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index 1d1b38bcfc..05e5661c69 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -449,6 +449,7 @@ public final class ModItems { GT_OreDictUnificator.registerOre("ingotRubber", ItemUtils.getItemStack(CORE.MODID+":itemStickyRubber", 1)); itemHeliumBlob = new CoreItem("itemHeliumBlob", tabMisc).setTextureName(CORE.MODID + ":itemHeliumBlob"); + GT_OreDictUnificator.registerOre("dustHydrogen", new ItemStack(ModItems.itemHeliumBlob)); //GameRegistry.registerItem(itemHeliumBlob, "itemHeliumBlob"); itemPLACEHOLDER_Circuit = new Item().setUnlocalizedName("itemPLACEHOLDER_Circuit").setTextureName(CORE.MODID + ":itemPLACEHOLDER_Circuit"); diff --git a/src/Java/gtPlusPlus/core/material/ALLOY.java b/src/Java/gtPlusPlus/core/material/ALLOY.java index ae1928a749..642e402917 100644 --- a/src/Java/gtPlusPlus/core/material/ALLOY.java +++ b/src/Java/gtPlusPlus/core/material/ALLOY.java @@ -65,8 +65,7 @@ public final class ALLOY { true, //Uses Blast furnace? //Material Stacks with Percentage of required elements. new MaterialStack[]{ - new MaterialStack(ELEMENT.TUNGSTEN, 20), - new MaterialStack(ELEMENT.TANTALUM, 60), + new MaterialStack(ALLOY.TANTALLOY_60, 2), new MaterialStack(ELEMENT.TITANIUM, 12), new MaterialStack(ELEMENT.YTTRIUM, 8) }); @@ -212,10 +211,12 @@ public final class ALLOY { true, //Uses Blast furnace? //Material Stacks with Percentage of required elements. new MaterialStack[]{ - new MaterialStack(ELEMENT.CHROMIUM, 25), + new MaterialStack(ELEMENT.CHROMIUM, 26), new MaterialStack(ELEMENT.NICKEL, 6), - new MaterialStack(ELEMENT.COBALT, 9), - new MaterialStack(ALLOY.STEEL, 60) + new MaterialStack(ELEMENT.MOLYBDENUM, 4), + new MaterialStack(ELEMENT.COPPER, 20), + new MaterialStack(ELEMENT.TUNGSTEN, 4), + new MaterialStack(ALLOY.STEEL, 40) }); public static final Material MARAGING250 = new Material( @@ -228,10 +229,11 @@ public final class ALLOY { true, //Uses Blast furnace? //Material Stacks with Percentage of required elements. new MaterialStack[]{ - new MaterialStack(ELEMENT.TITANIUM, 5), - new MaterialStack(ELEMENT.NICKEL, 25), - new MaterialStack(ELEMENT.COBALT, 10), - new MaterialStack(ALLOY.STEEL, 60) + new MaterialStack(ALLOY.STEEL, 64), + new MaterialStack(ELEMENT.MOLYBDENUM, 4), + new MaterialStack(ELEMENT.TITANIUM, 4), + new MaterialStack(ELEMENT.NICKEL, 16), + new MaterialStack(ELEMENT.COBALT, 8), }); public static final Material MARAGING300 = new Material( @@ -244,10 +246,11 @@ public final class ALLOY { true, //Uses Blast furnace? //Material Stacks with Percentage of required elements. new MaterialStack[]{ - new MaterialStack(ELEMENT.TITANIUM, 10), - new MaterialStack(ELEMENT.NICKEL, 20), - new MaterialStack(ELEMENT.COBALT, 15), - new MaterialStack(ALLOY.STEEL, 55) + new MaterialStack(ALLOY.STEEL, 64), + new MaterialStack(ELEMENT.TITANIUM, 4), + new MaterialStack(ELEMENT.ALUMINIUM, 4), + new MaterialStack(ELEMENT.NICKEL, 16), + new MaterialStack(ELEMENT.COBALT, 8), }); public static final Material MARAGING350 = new Material( @@ -260,10 +263,11 @@ public final class ALLOY { true, //Uses Blast furnace? //Material Stacks with Percentage of required elements. new MaterialStack[]{ - new MaterialStack(ELEMENT.TITANIUM, 15), - new MaterialStack(ELEMENT.NICKEL, 20), - new MaterialStack(ELEMENT.COBALT, 10), - new MaterialStack(ALLOY.STEEL, 55) + new MaterialStack(ALLOY.STEEL, 64), + new MaterialStack(ELEMENT.ALUMINIUM, 4), + new MaterialStack(ELEMENT.MOLYBDENUM, 4), + new MaterialStack(ELEMENT.NICKEL, 16), + new MaterialStack(ELEMENT.COBALT, 8), }); public static final Material STELLITE = new Material( @@ -450,8 +454,9 @@ public final class ALLOY { false, //Uses Blast furnace? //Material Stacks with Percentage of required elements. new MaterialStack[]{ + new MaterialStack(ELEMENT.SILICON, 40), new MaterialStack(ELEMENT.CARBON, 50), - new MaterialStack(ELEMENT.SILICON, 50) + new MaterialStack(ELEMENT.OXYGEN, 10) }); public static final Material TANTALUM_CARBIDE = new Material( @@ -464,8 +469,9 @@ public final class ALLOY { true, //Uses Blast furnace? //Material Stacks with Percentage of required elements. new MaterialStack[]{ + new MaterialStack(ELEMENT.TANTALUM, 40), new MaterialStack(ELEMENT.CARBON, 50), - new MaterialStack(ELEMENT.TANTALUM, 50) + new MaterialStack(ELEMENT.OXYGEN, 10) }); public static final Material ZIRCONIUM_CARBIDE = new Material( @@ -478,8 +484,9 @@ public final class ALLOY { true, //Uses Blast furnace? //Material Stacks with Percentage of required elements. new MaterialStack[]{ + new MaterialStack(ELEMENT.ZIRCONIUM, 40), new MaterialStack(ELEMENT.CARBON, 50), - new MaterialStack(ELEMENT.ZIRCONIUM, 50) + new MaterialStack(ELEMENT.OXYGEN, 10) }); public static final Material NIOBIUM_CARBIDE = new Material( @@ -492,8 +499,9 @@ public final class ALLOY { true, //Uses Blast furnace? //Material Stacks with Percentage of required elements. new MaterialStack[]{ + new MaterialStack(ELEMENT.NIOBIUM, 40), new MaterialStack(ELEMENT.CARBON, 50), - new MaterialStack(ELEMENT.NIOBIUM, 50) + new MaterialStack(ELEMENT.OXYGEN, 10) }); @@ -506,11 +514,12 @@ public final class ALLOY { 128, //Neutrons true, //Uses Blast furnace? new MaterialStack[]{ - new MaterialStack(ELEMENT.NICKEL, 30), - new MaterialStack(ELEMENT.CHROMIUM, 10), - new MaterialStack(ELEMENT.ZIRCONIUM, 20), - new MaterialStack(ELEMENT.IRON, 30), - new MaterialStack(ELEMENT.TUNGSTEN, 10) + new MaterialStack(ELEMENT.TITANIUM, 18), + new MaterialStack(ELEMENT.CARBON, 18), + new MaterialStack(ELEMENT.POTASSIUM, 18), + new MaterialStack(ELEMENT.LITHIUM, 18), + new MaterialStack(ELEMENT.SULFUR, 18), + new MaterialStack(ELEMENT.HYDROGEN, 10) }); //Material Stacks with Percentage of required elements. diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index c79fc04636..104414ee4c 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -167,14 +167,25 @@ public class Material { Utils.LOG_WARNING("MaterialInput == null && chemicalSymbol probably equals nothing"); this.vChemicalFormula = "??"; } - + this.vMoltenFluid = generateFluid(); dataVar = MathUtils.generateSingularRandomHexValue(); + String ratio = ""; + if (vSmallestRatio != null) + for (int hu=0;hu= 1){ ItemStack[] temp = new ItemStack[vMaterialInput.length]; for (int i=0;i 0){ Utils.LOG_WARNING("length: "+inputs.length); Utils.LOG_WARNING("(inputs != null): "+(inputs != null)); - //Utils.LOG_INFO("length: "+inputs.length); + //Utils.LOG_WARNING("length: "+inputs.length); double tempPercentage=0; long[] tempRatio = new long[inputs.length]; for (int x=0;x= 101){ - Utils.LOG_INFO("The compound for "+localizedName+" doesn't equal 98-100%, this isn't good."); + Utils.LOG_WARNING("The compound for "+localizedName+" doesn't equal 98-100%, this isn't good."); }*/ long[] smallestRatio = MathUtils.simplifyNumbersToSmallestForm(tempRatio); @@ -465,19 +476,34 @@ public class Material { if (dummyFormulaArray.length >= 1){ for (int e=0;e 1){ - dummyFormula = dummyFormula + tempInput[e].stackMaterial.vChemicalSymbol + dummyFormulaArray[e]; - } - else if (dummyFormulaArray[e] == 1){ - dummyFormula = dummyFormula + tempInput[e].stackMaterial.vChemicalSymbol; - } - else if (dummyFormulaArray[e] <= 0){ - dummyFormula = dummyFormula+""; + if (tempInput[e].stackMaterial != null){ + if (!tempInput[e].stackMaterial.vChemicalSymbol.equals("??")){ + if (dummyFormulaArray[e] > 1){ + + if (tempInput[e].stackMaterial.vChemicalFormula.length() > 3){ + dummyFormula = dummyFormula + "(" + tempInput[e].stackMaterial.vChemicalFormula + ")" + dummyFormulaArray[e]; + } + else { + dummyFormula = dummyFormula + tempInput[e].stackMaterial.vChemicalFormula + dummyFormulaArray[e]; + } + } + else if (dummyFormulaArray[e] == 1){ + if (tempInput[e].stackMaterial.vChemicalFormula.length() > 3){ + dummyFormula = dummyFormula + "(" +tempInput[e].stackMaterial.vChemicalFormula + ")"; + } + else { + dummyFormula = dummyFormula + "" +tempInput[e].stackMaterial.vChemicalFormula + ""; + } + } + else if (dummyFormulaArray[e] <= 0){ + dummyFormula = dummyFormula+""; + } } - - }else - dummyFormula = dummyFormula + "??"; + else + dummyFormula = dummyFormula + "??"; + } + else + dummyFormula = dummyFormula + "▓▓"; } else { dummyFormula = dummyFormula+""; @@ -496,11 +522,11 @@ public class Material { return "??"; } - + Fluid generateFluid(){ if (Materials.get(localizedName).mFluid == null){ - Utils.LOG_INFO("Generating our own fluid."); - + Utils.LOG_WARNING("Generating our own fluid."); + //Generate a Cell if we need to if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+getUnlocalizedName(), 1) == null){ Item temp = new BaseItemCell(this); @@ -515,21 +541,21 @@ public class Material { ItemList.Cell_Empty.get(1L, new Object[0]), 1000); } - Utils.LOG_INFO("Getting the fluid from a GT material instead."); + Utils.LOG_WARNING("Getting the fluid from a GT material instead."); return Materials.get(localizedName).mFluid; } public FluidStack getFluid(int fluidAmount) { - Utils.LOG_INFO("Attempting to get "+fluidAmount+"L of "+this.vMoltenFluid.getName()); + Utils.LOG_WARNING("Attempting to get "+fluidAmount+"L of "+this.vMoltenFluid.getName()); FluidStack moltenFluid = new FluidStack(this.vMoltenFluid, fluidAmount); - - Utils.LOG_INFO("Info: "+moltenFluid.getFluid().getName()+" Info: "+moltenFluid.amount+" Info: "+moltenFluid.getFluidID()); - + + Utils.LOG_WARNING("Info: "+moltenFluid.getFluid().getName()+" Info: "+moltenFluid.amount+" Info: "+moltenFluid.getFluidID()); + //FluidStack moltenFluid = FluidUtils.getFluidStack(this.vMoltenFluid.getName(), fluidAmount); /*boolean isNull = (moltenFluid == null); - if (isNull) Utils.LOG_INFO("Did not obtain fluid."); - else Utils.LOG_INFO("Found fluid."); + if (isNull) Utils.LOG_WARNING("Did not obtain fluid."); + else Utils.LOG_WARNING("Found fluid."); if (isNull){ return null; }*/ diff --git a/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java b/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java index 52e925df0e..35605169c5 100644 --- a/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java +++ b/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java @@ -59,7 +59,7 @@ public class MaterialUtils { if (material.isRadioactive()){ radioactivity = 1; } - if (hasValidRGBA(rgba)){ + if (hasValidRGBA(rgba) || element == Element.H){ //ModItems.itemBaseDecidust = UtilsItems.generateDecidust(material); //ModItems.itemBaseCentidust = UtilsItems.generateCentidust(material); return new Material(name, rgba, melting, boiling, protons, neutrons, blastFurnace, null, chemicalFormula, radioactivity); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java index 1e69288e8e..fec8abce49 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java @@ -55,11 +55,11 @@ public class RecipeGen_BlastSmelter { 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."); - Utils.LOG_INFO("tMaterial.length: "+tMaterial.length+"."); + 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]; @@ -91,8 +91,8 @@ public class RecipeGen_BlastSmelter { //Builds me a MaterialStack[] from the MaterialList of M. int ooo=0; for (MaterialStack xMaterial : M.mMaterialList){ - Utils.LOG_INFO("FOUND: "+xMaterial.mMaterial); - Utils.LOG_INFO("ADDING: "+xMaterial.mMaterial); + Utils.LOG_WARNING("FOUND: "+xMaterial.mMaterial); + Utils.LOG_WARNING("ADDING: "+xMaterial.mMaterial); tempStack[ooo] = M.mMaterialList.get(ooo); ooo++; } @@ -101,10 +101,10 @@ public class RecipeGen_BlastSmelter { components = new ItemStack[tempStack.length]; for (MaterialStack aOutputPart : tempStack){ if (aOutputPart != null){ - Utils.LOG_INFO("Finding dust: "+aOutputPart.mMaterial); + Utils.LOG_WARNING("Finding dust: "+aOutputPart.mMaterial); ItemStack rStack = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dust"+aOutputPart.mMaterial, (int) aOutputPart.mAmount); if (rStack != null){ - Utils.LOG_INFO("Found dust: "+aOutputPart.mMaterial); + Utils.LOG_WARNING("Found dust: "+aOutputPart.mMaterial); components[counter] = rStack; inputStackCount = inputStackCount+rStack.stackSize; } @@ -138,11 +138,11 @@ public class RecipeGen_BlastSmelter { fluidAmount = 144*inputStackCount; - Utils.LOG_INFO("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_INFO("tMaterial.length: "+components.length+"."); + 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 1){ gtPlusPlus.core.material.MaterialStack[] tempStack = new gtPlusPlus.core.material.MaterialStack[mMaterialListSize]; @@ -248,9 +248,14 @@ public class RecipeGen_BlastSmelter { 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()); + if (xMaterial.getStackMaterial() != null){ + Utils.LOG_WARNING("FOUND: "+xMaterial.getStackMaterial().getLocalizedName()); + Utils.LOG_WARNING("ADDING: "+xMaterial.getStackMaterial().getLocalizedName()); + + } + tempStack[ooo] = xMaterial; + } ooo++; } @@ -270,33 +275,33 @@ public class RecipeGen_BlastSmelter { 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+"."); + Utils.LOG_WARNING("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_WARNING("tMaterial.length: "+components.length+"."); for (int das=0;das= 2800 ? 64 : 16; - Utils.LOG_INFO("Generating Shaped Crafting recipes for "+material.getLocalizedName()); //TODO + Utils.LOG_WARNING("Generating Shaped Crafting recipes for "+material.getLocalizedName()); //TODO //Ring Recipe if (RecipeUtils.addShapedGregtechRecipe( @@ -20,10 +20,10 @@ public class RecipeGen_DustGeneration { null, material.getRod(1), null, null, null, null, material.getRing(1))){ - Utils.LOG_INFO("Ring Recipe: "+material.getLocalizedName()+" - Success"); + Utils.LOG_WARNING("Ring Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_INFO("Ring Recipe: "+material.getLocalizedName()+" - Failed"); + Utils.LOG_WARNING("Ring Recipe: "+material.getLocalizedName()+" - Failed"); } @@ -39,10 +39,10 @@ public class RecipeGen_DustGeneration { tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, normalDust)){ - Utils.LOG_INFO("9 Tiny dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Success"); + Utils.LOG_WARNING("9 Tiny dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_INFO("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( @@ -50,10 +50,10 @@ public class RecipeGen_DustGeneration { null, null, null, null, null, null, material.getTinyDust(9))){ - Utils.LOG_INFO("9 Tiny dust from 1 Recipe: "+material.getLocalizedName()+" - Success"); + Utils.LOG_WARNING("9 Tiny dust from 1 Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_INFO("9 Tiny dust from 1 Recipe: "+material.getLocalizedName()+" - Failed"); + Utils.LOG_WARNING("9 Tiny dust from 1 Recipe: "+material.getLocalizedName()+" - Failed"); } @@ -62,10 +62,10 @@ public class RecipeGen_DustGeneration { smallDust, smallDust, null, null, null, null, normalDust)){ - Utils.LOG_INFO("4 Small dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Success"); + Utils.LOG_WARNING("4 Small dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_INFO("4 Small dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Failed"); + Utils.LOG_WARNING("4 Small dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Failed"); } @@ -74,22 +74,22 @@ public class RecipeGen_DustGeneration { null, null, null, null, null, null, material.getSmallDust(4))){ - Utils.LOG_INFO("4 Small dust from 1 Dust Recipe: "+material.getLocalizedName()+" - Success"); + Utils.LOG_WARNING("4 Small dust from 1 Dust Recipe: "+material.getLocalizedName()+" - Success"); } else { - Utils.LOG_INFO("4 Small dust from 1 Dust Recipe: "+material.getLocalizedName()+" - Failed"); + Utils.LOG_WARNING("4 Small dust from 1 Dust Recipe: "+material.getLocalizedName()+" - Failed"); } - if (inputStacks.length > 0){ - Utils.LOG_INFO(ItemUtils.getArrayStackNames(inputStacks)); + if (inputStacks.length > 0 && inputStacks.length <= 4){ + Utils.LOG_WARNING(ItemUtils.getArrayStackNames(inputStacks)); long[] inputStackSize = material.vSmallestRatio; if (inputStackSize != null){ for (short x=0;x 0){ - Utils.LOG_INFO(ItemUtils.getArrayStackNames(inputStacks)); + Utils.LOG_WARNING(ItemUtils.getArrayStackNames(inputStacks)); long[] inputStackSize = material.vSmallestRatio; if (inputStackSize != null){ for (short x=0;x Date: Thu, 27 Oct 2016 01:47:39 +1000 Subject: % Cleaned up material/Material.java using PMD to a rather decent level. > Inadvertently this refactored things in other classes. % Changed the Blast Smelter Casing Block textures. --- .../gtPlusPlus/core/fluids/BlockFluidBase.java | 2 +- .../core/item/base/itemblock/ItemBlockFluid.java | 2 +- src/Java/gtPlusPlus/core/material/ALLOY.java | 66 ++--- src/Java/gtPlusPlus/core/material/ELEMENT.java | 4 +- src/Java/gtPlusPlus/core/material/Material.java | 310 +++++++-------------- .../gtPlusPlus/core/util/fluid/FluidUtils.java | 2 +- .../core/util/materials/MaterialUtils.java | 38 ++- .../blocks/textures/CasingTextureHandler.java | 2 +- .../GregtechMetaTileEntity_AlloyBlastSmelter.java | 3 + .../gregtech/loaders/RecipeGen_BlastSmelter.java | 19 +- .../gregtech/loaders/RecipeGen_DustGeneration.java | 61 ++-- .../xmod/gregtech/loaders/RecipeGen_Extruder.java | 2 +- .../xmod/gregtech/loaders/RecipeGen_Plates.java | 2 +- 13 files changed, 230 insertions(+), 283 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java') diff --git a/src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java b/src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java index 703256267b..52bfa7d2d9 100644 --- a/src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java +++ b/src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java @@ -34,7 +34,7 @@ public class BlockFluidBase extends BlockFluidClassic { this.fluidMaterial = material; setCreativeTab(AddToCreativeTab.tabOther); this.displayName = material.getLocalizedName(); - LanguageRegistry.addName(this, "Molten "+displayName+" ["+MathUtils.celsiusToKelvin(fluidMaterial.getBoilingPoint_C())+"K]"); + LanguageRegistry.addName(this, "Molten "+displayName+" ["+MathUtils.celsiusToKelvin(fluidMaterial.getBoilingPointC())+"K]"); this.setBlockName(GetProperName()); } diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockFluid.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockFluid.java index 8d3871187a..2e39a47f81 100644 --- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockFluid.java +++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockFluid.java @@ -60,7 +60,7 @@ public class ItemBlockFluid extends ItemBlock{ @Override public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) { - list.add("Temperature: "+MathUtils.celsiusToKelvin(thisFluid.getMeltingPoint_C())+"K"); + list.add("Temperature: "+MathUtils.celsiusToKelvin(thisFluid.getMeltingPointC())+"K"); if (sRadiation > 0){ list.add(CORE.GT_Tooltip_Radioactive); } diff --git a/src/Java/gtPlusPlus/core/material/ALLOY.java b/src/Java/gtPlusPlus/core/material/ALLOY.java index 975a035628..052eaf6a9a 100644 --- a/src/Java/gtPlusPlus/core/material/ALLOY.java +++ b/src/Java/gtPlusPlus/core/material/ALLOY.java @@ -29,7 +29,7 @@ public final class ALLOY { "Staballoy", //Material Name new short[]{68, 75, 66, 0}, //Material Colour 3450, //Melting Point in C - ((ELEMENT.URANIUM.getBoilingPoint_C()*9)+(ELEMENT.TITANIUM.getBoilingPoint_C()*1))/10, //Boiling Point in C + ((ELEMENT.URANIUM.getBoilingPointC()*9)+(ELEMENT.TITANIUM.getBoilingPointC()*1))/10, //Boiling Point in C ((ELEMENT.URANIUM.getProtons()*9)+ELEMENT.TITANIUM.getProtons())/10, //Protons ((ELEMENT.URANIUM.getNeutrons()*9)+ELEMENT.TITANIUM.getNeutrons())/10, //Neutrons true, //Uses Blast furnace? @@ -43,7 +43,7 @@ public final class ALLOY { "Tantalloy-60", //Material Name new short[]{213, 231, 237, 0}, //Material Colour 3025, //Melting Point in C - ((ELEMENT.TUNGSTEN.getBoilingPoint_C()*1)+(ELEMENT.TANTALUM.getBoilingPoint_C()*8)+(ELEMENT.TITANIUM.getBoilingPoint_C()*1))/10, //Boiling Point in C + ((ELEMENT.TUNGSTEN.getBoilingPointC()*1)+(ELEMENT.TANTALUM.getBoilingPointC()*8)+(ELEMENT.TITANIUM.getBoilingPointC()*1))/10, //Boiling Point in C ((ELEMENT.TUNGSTEN.getProtons()*1)+(ELEMENT.TANTALUM.getProtons()*8)+(ELEMENT.TITANIUM.getProtons()*1))/10, //Protons ((ELEMENT.TUNGSTEN.getNeutrons()*1)+(ELEMENT.TANTALUM.getNeutrons()*8)+(ELEMENT.TITANIUM.getNeutrons()*1))/10, //Neutrons true, //Uses Blast furnace? @@ -57,7 +57,7 @@ public final class ALLOY { "Tantalloy-61", //Material Name new short[]{193, 211, 217, 0}, //Material Colour 3030, //Melting Point in C - ((ELEMENT.TUNGSTEN.getBoilingPoint_C()*1)+(ELEMENT.TANTALUM.getBoilingPoint_C()*7)+(ELEMENT.TITANIUM.getBoilingPoint_C()*1)+(ELEMENT.YTTRIUM.getBoilingPoint_C()*1))/10, //Boiling Point in C + ((ELEMENT.TUNGSTEN.getBoilingPointC()*1)+(ELEMENT.TANTALUM.getBoilingPointC()*7)+(ELEMENT.TITANIUM.getBoilingPointC()*1)+(ELEMENT.YTTRIUM.getBoilingPointC()*1))/10, //Boiling Point in C ((ELEMENT.TUNGSTEN.getProtons()*1)+(ELEMENT.TANTALUM.getProtons()*7)+(ELEMENT.TITANIUM.getProtons()*1)+(ELEMENT.YTTRIUM.getProtons()*1))/10, //Protons ((ELEMENT.TUNGSTEN.getNeutrons()*1)+(ELEMENT.TANTALUM.getNeutrons()*7)+(ELEMENT.TITANIUM.getNeutrons()*1)+(ELEMENT.YTTRIUM.getNeutrons()*1))/10, //Neutrons true, //Uses Blast furnace? @@ -71,8 +71,8 @@ public final class ALLOY { public static final Material BRONZE = new Material( "Bronze", //Material Name new short[]{128, 128, 128, 0}, //Material Colour - ((ELEMENT.TIN.getMeltingPoint_C()*1)+(ELEMENT.COPPER.getMeltingPoint_C()*3))/4, //Melting point in C - ((ELEMENT.TIN.getBoilingPoint_C()*1)+(ELEMENT.COPPER.getBoilingPoint_C()*3))/4, //Boiling Point in C + ((ELEMENT.TIN.getMeltingPointC()*1)+(ELEMENT.COPPER.getMeltingPointC()*3))/4, //Melting point in C + ((ELEMENT.TIN.getBoilingPointC()*1)+(ELEMENT.COPPER.getBoilingPointC()*3))/4, //Boiling Point in C ((ELEMENT.TIN.getProtons()*1)+(ELEMENT.COPPER.getProtons()*3))/4, //Protons ((ELEMENT.TIN.getNeutrons()*1)+(ELEMENT.COPPER.getNeutrons()*3))/4, //Neutrons false, //Uses Blast furnace? @@ -86,8 +86,8 @@ public final class ALLOY { public static final Material TUMBAGA = new Material( "Tumbaga", //Material Name new short[]{255,178,15, 0}, //Material Colour - ((ELEMENT.GOLD.getMeltingPoint_C()*7)+(ELEMENT.COPPER.getMeltingPoint_C()*3))/10, //Melting point in C - ((ELEMENT.GOLD.getBoilingPoint_C()*7)+(ELEMENT.COPPER.getBoilingPoint_C()*3))/10, //Boiling Point in C + ((ELEMENT.GOLD.getMeltingPointC()*7)+(ELEMENT.COPPER.getMeltingPointC()*3))/10, //Melting point in C + ((ELEMENT.GOLD.getBoilingPointC()*7)+(ELEMENT.COPPER.getBoilingPointC()*3))/10, //Boiling Point in C ((ELEMENT.GOLD.getProtons()*7)+(ELEMENT.COPPER.getProtons()*3))/10, //Protons ((ELEMENT.GOLD.getNeutrons()*7)+(ELEMENT.COPPER.getNeutrons()*3))/10, //Neutrons false, //Uses Blast furnace? @@ -101,8 +101,8 @@ public final class ALLOY { public static final Material POTIN = new Material( "Potin", //Material Name new short[]{201,151,129, 0}, //Material Colour - ((ELEMENT.LEAD.getMeltingPoint_C()*4)+(ALLOY.BRONZE.getMeltingPoint_C()*4)+(ELEMENT.TIN.getMeltingPoint_C()*2))/10, //Melting point in C - ((ELEMENT.LEAD.getBoilingPoint_C()*4)+(ALLOY.BRONZE.getBoilingPoint_C()*4)+(ELEMENT.TIN.getBoilingPoint_C()*2))/10, //Boiling Point in C + ((ELEMENT.LEAD.getMeltingPointC()*4)+(ALLOY.BRONZE.getMeltingPointC()*4)+(ELEMENT.TIN.getMeltingPointC()*2))/10, //Melting point in C + ((ELEMENT.LEAD.getBoilingPointC()*4)+(ALLOY.BRONZE.getBoilingPointC()*4)+(ELEMENT.TIN.getBoilingPointC()*2))/10, //Boiling Point in C ((ELEMENT.LEAD.getProtons()*4)+(ALLOY.BRONZE.getProtons()*4)+(ELEMENT.TIN.getProtons()*2))/10, //Protons ((ELEMENT.LEAD.getNeutrons()*4)+(ALLOY.BRONZE.getNeutrons()*4)+(ELEMENT.TIN.getNeutrons()*2))/10, //Neutrons false, //Uses Blast furnace? @@ -128,7 +128,7 @@ public final class ALLOY { "Inconel-625", //Material Name new short[]{128, 200, 128, 0}, //Material Colour 1425, //Melting Point in C - ((ELEMENT.NICKEL.getBoilingPoint_C()*6)+(ELEMENT.CHROMIUM.getBoilingPoint_C()*2)+(ELEMENT.IRON.getBoilingPoint_C()*1)+(ELEMENT.MOLYBDENUM.getBoilingPoint_C()*1))/10, //Boiling Point in C + ((ELEMENT.NICKEL.getBoilingPointC()*6)+(ELEMENT.CHROMIUM.getBoilingPointC()*2)+(ELEMENT.IRON.getBoilingPointC()*1)+(ELEMENT.MOLYBDENUM.getBoilingPointC()*1))/10, //Boiling Point in C ((ELEMENT.NICKEL.getProtons()*6)+(ELEMENT.CHROMIUM.getProtons()*2)+(ELEMENT.IRON.getProtons()*1)+(ELEMENT.MOLYBDENUM.getProtons()*1))/10, //Protons ((ELEMENT.NICKEL.getNeutrons()*6)+(ELEMENT.CHROMIUM.getNeutrons()*2)+(ELEMENT.IRON.getNeutrons()*1)+(ELEMENT.MOLYBDENUM.getNeutrons()*1))/10, //Neutrons true, //Uses Blast furnace? @@ -144,7 +144,7 @@ public final class ALLOY { "Inconel-690", //Material Name new short[]{118, 220, 138, 0}, //Material Colour 1425, //Melting Point in C - ((ELEMENT.NICKEL.getBoilingPoint_C()*6)+(ELEMENT.CHROMIUM.getBoilingPoint_C()*2)+(ELEMENT.NIOBIUM.getBoilingPoint_C()*1)+(ELEMENT.MOLYBDENUM.getBoilingPoint_C()*1))/10, //Boiling Point in C + ((ELEMENT.NICKEL.getBoilingPointC()*6)+(ELEMENT.CHROMIUM.getBoilingPointC()*2)+(ELEMENT.NIOBIUM.getBoilingPointC()*1)+(ELEMENT.MOLYBDENUM.getBoilingPointC()*1))/10, //Boiling Point in C ((ELEMENT.NICKEL.getProtons()*6)+(ELEMENT.CHROMIUM.getProtons()*2)+(ELEMENT.NIOBIUM.getProtons()*1)+(ELEMENT.MOLYBDENUM.getProtons()*1))/10, //Protons ((ELEMENT.NICKEL.getNeutrons()*6)+(ELEMENT.CHROMIUM.getNeutrons()*2)+(ELEMENT.NIOBIUM.getNeutrons()*1)+(ELEMENT.MOLYBDENUM.getNeutrons()*1))/10, //Neutrons true, //Uses Blast furnace? @@ -160,7 +160,7 @@ public final class ALLOY { "Inconel-792", //Material Name new short[]{108, 240, 118, 0}, //Material Colour 1425, //Melting Point in C - ((ELEMENT.NICKEL.getBoilingPoint_C()*6)+(ELEMENT.CHROMIUM.getBoilingPoint_C()*1)+(ELEMENT.IRON.getBoilingPoint_C()*1)+(ELEMENT.ALUMINIUM.getBoilingPoint_C()*2))/10, //Boiling Point in C + ((ELEMENT.NICKEL.getBoilingPointC()*6)+(ELEMENT.CHROMIUM.getBoilingPointC()*1)+(ELEMENT.IRON.getBoilingPointC()*1)+(ELEMENT.ALUMINIUM.getBoilingPointC()*2))/10, //Boiling Point in C ((ELEMENT.NICKEL.getProtons()*6)+(ELEMENT.CHROMIUM.getProtons()*1)+(ELEMENT.IRON.getProtons()*1)+(ELEMENT.ALUMINIUM.getProtons()*2))/10, //Protons ((ELEMENT.NICKEL.getNeutrons()*6)+(ELEMENT.CHROMIUM.getNeutrons()*1)+(ELEMENT.IRON.getNeutrons()*1)+(ELEMENT.ALUMINIUM.getNeutrons()*2))/10, //Neutrons true, //Uses Blast furnace? @@ -175,8 +175,8 @@ public final class ALLOY { public static final Material STEEL = new Material( "Steel", //Material Name new short[]{180, 180, 20, 0}, //Material Colour - ((ELEMENT.CARBON.getMeltingPoint_C()*5)+(ELEMENT.IRON.getMeltingPoint_C()*95))/100, //Melting point in C - ((ELEMENT.CARBON.getBoilingPoint_C()*5)+(ELEMENT.IRON.getBoilingPoint_C()*95))/100, //Boiling Point in C + ((ELEMENT.CARBON.getMeltingPointC()*5)+(ELEMENT.IRON.getMeltingPointC()*95))/100, //Melting point in C + ((ELEMENT.CARBON.getBoilingPointC()*5)+(ELEMENT.IRON.getBoilingPointC()*95))/100, //Boiling Point in C ((ELEMENT.CARBON.getProtons()*5)+(ELEMENT.IRON.getProtons()*95))/100, //Protons ((ELEMENT.CARBON.getNeutrons()*5)+(ELEMENT.IRON.getNeutrons()*95))/100, //Neutrons true, //Uses Blast furnace? @@ -191,8 +191,8 @@ public final class ALLOY { public static final Material ZERON_100 = new Material( "Zeron-100", //Material Name new short[]{180, 180, 20, 0}, //Material Colour - ((ELEMENT.CHROMIUM.getMeltingPoint_C()*25)+(ELEMENT.NICKEL.getMeltingPoint_C()*6)+(ELEMENT.COBALT.getMeltingPoint_C()*9)+(ALLOY.STEEL.getMeltingPoint_C()*60))/100, //Melting Point in C - ((ELEMENT.CHROMIUM.getBoilingPoint_C()*25)+(ELEMENT.NICKEL.getBoilingPoint_C()*6)+(ELEMENT.COBALT.getBoilingPoint_C()*9)+(ALLOY.STEEL.getBoilingPoint_C()*60))/100, //Boiling Point in C + ((ELEMENT.CHROMIUM.getMeltingPointC()*25)+(ELEMENT.NICKEL.getMeltingPointC()*6)+(ELEMENT.COBALT.getMeltingPointC()*9)+(ALLOY.STEEL.getMeltingPointC()*60))/100, //Melting Point in C + ((ELEMENT.CHROMIUM.getBoilingPointC()*25)+(ELEMENT.NICKEL.getBoilingPointC()*6)+(ELEMENT.COBALT.getBoilingPointC()*9)+(ALLOY.STEEL.getBoilingPointC()*60))/100, //Boiling Point in C ((ELEMENT.CHROMIUM.getProtons()*25)+(ELEMENT.NICKEL.getProtons()*6)+(ELEMENT.COBALT.getProtons()*9)+(ALLOY.STEEL.getProtons()*60))/100, //Protons ((ELEMENT.CHROMIUM.getNeutrons()*25)+(ELEMENT.NICKEL.getNeutrons()*6)+(ELEMENT.COBALT.getNeutrons()*9)+(ALLOY.STEEL.getNeutrons()*60))/100, //Neutrons true, //Uses Blast furnace? @@ -210,7 +210,7 @@ public final class ALLOY { "Maraging Steel 250", //Material Name new short[]{140, 140, 140, 0}, //Material Colour 1413, //Melting Point in C - ((ELEMENT.TITANIUM.getBoilingPoint_C()*5)+(ELEMENT.NICKEL.getBoilingPoint_C()*16)+(ELEMENT.COBALT.getBoilingPoint_C()*9)+(ALLOY.STEEL.getBoilingPoint_C()*70))/100, //Boiling Point in C + ((ELEMENT.TITANIUM.getBoilingPointC()*5)+(ELEMENT.NICKEL.getBoilingPointC()*16)+(ELEMENT.COBALT.getBoilingPointC()*9)+(ALLOY.STEEL.getBoilingPointC()*70))/100, //Boiling Point in C ((ELEMENT.TITANIUM.getProtons()*5)+(ELEMENT.NICKEL.getProtons()*16)+(ELEMENT.COBALT.getProtons()*9)+(ALLOY.STEEL.getProtons()*70))/100, //Protons ((ELEMENT.TITANIUM.getNeutrons()*5)+(ELEMENT.NICKEL.getNeutrons()*16)+(ELEMENT.COBALT.getNeutrons()*9)+(ALLOY.STEEL.getNeutrons()*70))/100, //Neutrons true, //Uses Blast furnace? @@ -227,7 +227,7 @@ public final class ALLOY { "Maraging Steel 300", //Material Name new short[]{150, 150, 150, 0}, //Material Colour 1413, //Melting Point in C - ((ELEMENT.TITANIUM.getBoilingPoint_C()*10)+(ELEMENT.NICKEL.getBoilingPoint_C()*21)+(ELEMENT.COBALT.getBoilingPoint_C()*14)+(ALLOY.STEEL.getBoilingPoint_C()*55))/100, //Boiling Point in C + ((ELEMENT.TITANIUM.getBoilingPointC()*10)+(ELEMENT.NICKEL.getBoilingPointC()*21)+(ELEMENT.COBALT.getBoilingPointC()*14)+(ALLOY.STEEL.getBoilingPointC()*55))/100, //Boiling Point in C ((ELEMENT.TITANIUM.getProtons()*10)+(ELEMENT.NICKEL.getProtons()*21)+(ELEMENT.COBALT.getProtons()*14)+(ALLOY.STEEL.getProtons()*55))/100, //Protons ((ELEMENT.TITANIUM.getNeutrons()*10)+(ELEMENT.NICKEL.getNeutrons()*21)+(ELEMENT.COBALT.getNeutrons()*14)+(ALLOY.STEEL.getNeutrons()*55))/100, //Neutrons true, //Uses Blast furnace? @@ -244,7 +244,7 @@ public final class ALLOY { "Maraging Steel 350", //Material Name new short[]{160, 160, 160, 0}, //Material Colour 1413, //Melting Point in C - ((ELEMENT.TITANIUM.getBoilingPoint_C()*15)+(ELEMENT.NICKEL.getBoilingPoint_C()*21)+(ELEMENT.COBALT.getBoilingPoint_C()*9)+(ALLOY.STEEL.getBoilingPoint_C()*55))/100, //Boiling Point in C + ((ELEMENT.TITANIUM.getBoilingPointC()*15)+(ELEMENT.NICKEL.getBoilingPointC()*21)+(ELEMENT.COBALT.getBoilingPointC()*9)+(ALLOY.STEEL.getBoilingPointC()*55))/100, //Boiling Point in C ((ELEMENT.TITANIUM.getProtons()*15)+(ELEMENT.NICKEL.getProtons()*21)+(ELEMENT.COBALT.getProtons()*9)+(ALLOY.STEEL.getProtons()*55))/100, //Protons ((ELEMENT.TITANIUM.getNeutrons()*15)+(ELEMENT.NICKEL.getNeutrons()*21)+(ELEMENT.COBALT.getNeutrons()*9)+(ALLOY.STEEL.getNeutrons()*55))/100, //Neutrons true, //Uses Blast furnace? @@ -261,7 +261,7 @@ public final class ALLOY { "Stellite", //Material Name new short[]{129, 75, 120, 0}, //Material Colour 1310, //Melting Point in C - ((ELEMENT.TITANIUM.getBoilingPoint_C()*10)+(ELEMENT.CHROMIUM.getBoilingPoint_C()*35)+(ELEMENT.COBALT.getBoilingPoint_C()*35)+(ELEMENT.MANGANESE.getBoilingPoint_C()*20))/100, //Boiling Point in C + ((ELEMENT.TITANIUM.getBoilingPointC()*10)+(ELEMENT.CHROMIUM.getBoilingPointC()*35)+(ELEMENT.COBALT.getBoilingPointC()*35)+(ELEMENT.MANGANESE.getBoilingPointC()*20))/100, //Boiling Point in C ((ELEMENT.TITANIUM.getProtons()*10)+(ELEMENT.CHROMIUM.getProtons()*35)+(ELEMENT.COBALT.getProtons()*35)+(ELEMENT.MANGANESE.getProtons()*20))/100, //Protons ((ELEMENT.TITANIUM.getNeutrons()*10)+(ELEMENT.CHROMIUM.getNeutrons()*35)+(ELEMENT.COBALT.getNeutrons()*35)+(ELEMENT.MANGANESE.getNeutrons()*20))/100, //Neutrons true, //Uses Blast furnace? @@ -277,7 +277,7 @@ public final class ALLOY { "Talonite", //Material Name new short[]{228, 75, 120, 0}, //Material Colour 1454, //Melting Point in C - ((ELEMENT.MOLYBDENUM.getBoilingPoint_C()*10)+(ELEMENT.CHROMIUM.getBoilingPoint_C()*30)+(ELEMENT.COBALT.getBoilingPoint_C()*40)+(ELEMENT.PHOSPHORUS.getBoilingPoint_C()*20))/100, //Boiling Point in C + ((ELEMENT.MOLYBDENUM.getBoilingPointC()*10)+(ELEMENT.CHROMIUM.getBoilingPointC()*30)+(ELEMENT.COBALT.getBoilingPointC()*40)+(ELEMENT.PHOSPHORUS.getBoilingPointC()*20))/100, //Boiling Point in C ((ELEMENT.MOLYBDENUM.getProtons()*10)+(ELEMENT.CHROMIUM.getProtons()*30)+(ELEMENT.COBALT.getProtons()*40)+(ELEMENT.PHOSPHORUS.getProtons()*20))/100, //Protons ((ELEMENT.MOLYBDENUM.getNeutrons()*10)+(ELEMENT.CHROMIUM.getNeutrons()*30)+(ELEMENT.COBALT.getNeutrons()*40)+(ELEMENT.PHOSPHORUS.getNeutrons()*20))/100, //Neutrons false, //Uses Blast furnace? @@ -293,7 +293,7 @@ public final class ALLOY { "Hastelloy-W", //Material Name new short[]{218, 165, 32, 0}, //Material Colour 1350, //Melting Point in C - ((ELEMENT.IRON.getBoilingPoint_C()*6)+(ELEMENT.MOLYBDENUM.getBoilingPoint_C()*24)+(ELEMENT.CHROMIUM.getBoilingPoint_C()*5)+(ELEMENT.NICKEL.getBoilingPoint_C()*65))/100, //Boiling Point in C + ((ELEMENT.IRON.getBoilingPointC()*6)+(ELEMENT.MOLYBDENUM.getBoilingPointC()*24)+(ELEMENT.CHROMIUM.getBoilingPointC()*5)+(ELEMENT.NICKEL.getBoilingPointC()*65))/100, //Boiling Point in C ((ELEMENT.IRON.getProtons()*6)+(ELEMENT.MOLYBDENUM.getProtons()*24)+(ELEMENT.CHROMIUM.getProtons()*5)+(ELEMENT.NICKEL.getProtons()*65))/100, //Protons ((ELEMENT.IRON.getNeutrons()*6)+(ELEMENT.MOLYBDENUM.getNeutrons()*24)+(ELEMENT.CHROMIUM.getNeutrons()*5)+(ELEMENT.NICKEL.getNeutrons()*65))/100, //Neutrons false, //Uses Blast furnace? @@ -325,7 +325,7 @@ public final class ALLOY { "Hastelloy-X", //Material Name new short[]{255, 193, 37, 0}, //Material Colour 1350, //Melting Point in C - ((ELEMENT.IRON.getBoilingPoint_C()*18)+(ELEMENT.MOLYBDENUM.getBoilingPoint_C()*9)+(ELEMENT.CHROMIUM.getBoilingPoint_C()*22)+(ELEMENT.NICKEL.getBoilingPoint_C()*51))/100, //Boiling Point in C + ((ELEMENT.IRON.getBoilingPointC()*18)+(ELEMENT.MOLYBDENUM.getBoilingPointC()*9)+(ELEMENT.CHROMIUM.getBoilingPointC()*22)+(ELEMENT.NICKEL.getBoilingPointC()*51))/100, //Boiling Point in C ((ELEMENT.IRON.getProtons()*18)+(ELEMENT.MOLYBDENUM.getProtons()*9)+(ELEMENT.CHROMIUM.getProtons()*22)+(ELEMENT.NICKEL.getProtons()*51))/100, //Protons ((ELEMENT.IRON.getNeutrons()*18)+(ELEMENT.MOLYBDENUM.getNeutrons()*9)+(ELEMENT.CHROMIUM.getNeutrons()*22)+(ELEMENT.NICKEL.getNeutrons()*51))/100, //Neutrons false, //Uses Blast furnace? @@ -341,7 +341,7 @@ public final class ALLOY { "Hastelloy-N", //Material Name new short[]{236, 213, 48, 0}, //Material Colour 1350, //Melting Point in C - ((ELEMENT.YTTRIUM.getBoilingPoint_C()*5)+(ELEMENT.MOLYBDENUM.getBoilingPoint_C()*16)+(ELEMENT.CHROMIUM.getBoilingPoint_C()*7)+(ELEMENT.NICKEL.getBoilingPoint_C()*72))/100, //Boiling Point in C + ((ELEMENT.YTTRIUM.getBoilingPointC()*5)+(ELEMENT.MOLYBDENUM.getBoilingPointC()*16)+(ELEMENT.CHROMIUM.getBoilingPointC()*7)+(ELEMENT.NICKEL.getBoilingPointC()*72))/100, //Boiling Point in C ((ELEMENT.YTTRIUM.getProtons()*5)+(ELEMENT.MOLYBDENUM.getProtons()*16)+(ELEMENT.CHROMIUM.getProtons()*7)+(ELEMENT.NICKEL.getProtons()*72))/100, //Protons ((ELEMENT.YTTRIUM.getNeutrons()*5)+(ELEMENT.MOLYBDENUM.getNeutrons()*16)+(ELEMENT.CHROMIUM.getNeutrons()*7)+(ELEMENT.NICKEL.getNeutrons()*72))/100, //Neutrons true, //Uses Blast furnace? @@ -357,7 +357,7 @@ public final class ALLOY { "Hastelloy-C276", //Material Name new short[]{238, 180, 34, 0}, //Material Colour 1350, //Melting Point in C - ((ELEMENT.COBALT.getBoilingPoint_C()*2)+(ELEMENT.MOLYBDENUM.getBoilingPoint_C()*16)+(ELEMENT.CHROMIUM.getBoilingPoint_C()*16)+(ELEMENT.NICKEL.getBoilingPoint_C()*66))/100, //Boiling Point in C + ((ELEMENT.COBALT.getBoilingPointC()*2)+(ELEMENT.MOLYBDENUM.getBoilingPointC()*16)+(ELEMENT.CHROMIUM.getBoilingPointC()*16)+(ELEMENT.NICKEL.getBoilingPointC()*66))/100, //Boiling Point in C ((ELEMENT.COBALT.getProtons()*2)+(ELEMENT.MOLYBDENUM.getProtons()*16)+(ELEMENT.CHROMIUM.getProtons()*16)+(ELEMENT.NICKEL.getProtons()*66))/100, //Protons ((ELEMENT.COBALT.getNeutrons()*2)+(ELEMENT.MOLYBDENUM.getNeutrons()*16)+(ELEMENT.CHROMIUM.getNeutrons()*16)+(ELEMENT.NICKEL.getNeutrons()*66))/100, //Neutrons true, //Uses Blast furnace? @@ -373,7 +373,7 @@ public final class ALLOY { "Incoloy-020", //Material Name new short[]{101, 81, 71, 0}, //Material Colour 1425, //Melting Point in C - ((ELEMENT.IRON.getBoilingPoint_C()*40)+(ELEMENT.COPPER.getBoilingPoint_C()*4)+(ELEMENT.CHROMIUM.getBoilingPoint_C()*20)+(ELEMENT.NICKEL.getBoilingPoint_C()*36))/100, //Boiling Point in C + ((ELEMENT.IRON.getBoilingPointC()*40)+(ELEMENT.COPPER.getBoilingPointC()*4)+(ELEMENT.CHROMIUM.getBoilingPointC()*20)+(ELEMENT.NICKEL.getBoilingPointC()*36))/100, //Boiling Point in C ((ELEMENT.IRON.getProtons()*40)+(ELEMENT.COPPER.getProtons()*4)+(ELEMENT.CHROMIUM.getProtons()*20)+(ELEMENT.NICKEL.getProtons()*36))/100, //Protons ((ELEMENT.IRON.getNeutrons()*40)+(ELEMENT.COPPER.getNeutrons()*4)+(ELEMENT.CHROMIUM.getNeutrons()*20)+(ELEMENT.NICKEL.getNeutrons()*36))/100, //Neutrons false, //Uses Blast furnace? @@ -389,7 +389,7 @@ public final class ALLOY { "Incoloy-DS", //Material Name new short[]{71, 101, 81, 0}, //Material Colour 1425, //Melting Point in C - ((ELEMENT.IRON.getBoilingPoint_C()*46)+(ELEMENT.COBALT.getBoilingPoint_C()*18)+(ELEMENT.CHROMIUM.getBoilingPoint_C()*18)+(ELEMENT.NICKEL.getBoilingPoint_C()*18))/100, //Boiling Point in C + ((ELEMENT.IRON.getBoilingPointC()*46)+(ELEMENT.COBALT.getBoilingPointC()*18)+(ELEMENT.CHROMIUM.getBoilingPointC()*18)+(ELEMENT.NICKEL.getBoilingPointC()*18))/100, //Boiling Point in C ((ELEMENT.IRON.getProtons()*46)+(ELEMENT.COBALT.getProtons()*18)+(ELEMENT.CHROMIUM.getProtons()*18)+(ELEMENT.NICKEL.getProtons()*18))/100, //Protons ((ELEMENT.IRON.getNeutrons()*46)+(ELEMENT.COBALT.getNeutrons()*18)+(ELEMENT.CHROMIUM.getNeutrons()*18)+(ELEMENT.NICKEL.getNeutrons()*18))/100, //Neutrons false, //Uses Blast furnace? @@ -405,7 +405,7 @@ public final class ALLOY { "Incoloy-MA956", //Material Name new short[]{81, 71, 101, 0}, //Material Colour 1425, //Melting Point in C - ((ELEMENT.IRON.getBoilingPoint_C()*75)+(ELEMENT.ALUMINIUM.getBoilingPoint_C()*4)+(ELEMENT.CHROMIUM.getBoilingPoint_C()*20)+(ELEMENT.YTTRIUM.getBoilingPoint_C()*1))/100, //Boiling Point in C + ((ELEMENT.IRON.getBoilingPointC()*75)+(ELEMENT.ALUMINIUM.getBoilingPointC()*4)+(ELEMENT.CHROMIUM.getBoilingPointC()*20)+(ELEMENT.YTTRIUM.getBoilingPointC()*1))/100, //Boiling Point in C ((ELEMENT.IRON.getProtons()*75)+(ELEMENT.ALUMINIUM.getProtons()*4)+(ELEMENT.CHROMIUM.getProtons()*20)+(ELEMENT.YTTRIUM.getProtons()*1))/100, //Protons ((ELEMENT.IRON.getNeutrons()*75)+(ELEMENT.ALUMINIUM.getNeutrons()*4)+(ELEMENT.CHROMIUM.getNeutrons()*20)+(ELEMENT.YTTRIUM.getNeutrons()*1))/100, //Neutrons true, //Uses Blast furnace? @@ -421,7 +421,7 @@ public final class ALLOY { "Tungsten Carbide", //Material Name new short[]{44, 44, 44, 0}, //Material Colour 3422, //Melting Point in C - ((ELEMENT.TUNGSTEN.getBoilingPoint_C()*5)+(ELEMENT.CARBON.getBoilingPoint_C()*5))/10, //Boiling Point in C + ((ELEMENT.TUNGSTEN.getBoilingPointC()*5)+(ELEMENT.CARBON.getBoilingPointC()*5))/10, //Boiling Point in C ((ELEMENT.TUNGSTEN.getProtons()*5)+(ELEMENT.CARBON.getProtons()*5))/10, //Protons ((ELEMENT.TUNGSTEN.getNeutrons()*5)+(ELEMENT.CARBON.getNeutrons()*5))/10, //Neutrons true, //Uses Blast furnace? @@ -435,7 +435,7 @@ public final class ALLOY { "Silicon Carbide", //Material Name new short[]{40, 48, 36, 0}, //Material Colour 1414, //Melting Point in C - ((ELEMENT.SILICON.getBoilingPoint_C()*5)+(ELEMENT.CARBON.getBoilingPoint_C()*5))/10, //Boiling Point in C + ((ELEMENT.SILICON.getBoilingPointC()*5)+(ELEMENT.CARBON.getBoilingPointC()*5))/10, //Boiling Point in C ((ELEMENT.SILICON.getProtons()*5)+(ELEMENT.CARBON.getProtons()*5))/10, //Protons ((ELEMENT.SILICON.getNeutrons()*5)+(ELEMENT.CARBON.getNeutrons()*5))/10, //Neutrons false, //Uses Blast furnace? @@ -450,7 +450,7 @@ public final class ALLOY { "Tantalum Carbide", //Material Name new short[]{139, 136, 120, 0}, //Material Colour 2980, //Melting Point in C - ((ELEMENT.TANTALUM.getBoilingPoint_C()*5)+(ELEMENT.CARBON.getBoilingPoint_C()*5))/10, //Boiling Point in C + ((ELEMENT.TANTALUM.getBoilingPointC()*5)+(ELEMENT.CARBON.getBoilingPointC()*5))/10, //Boiling Point in C ((ELEMENT.TANTALUM.getProtons()*5)+(ELEMENT.CARBON.getProtons()*5))/10, //Protons ((ELEMENT.TANTALUM.getNeutrons()*5)+(ELEMENT.CARBON.getNeutrons()*5))/10, //Neutrons true, //Uses Blast furnace? @@ -465,7 +465,7 @@ public final class ALLOY { "Zirconium Carbide", //Material Name new short[]{222, 202, 180, 0}, //Material Colour 1855, //Melting Point in C - ((ELEMENT.ZIRCONIUM.getBoilingPoint_C()*5)+(ELEMENT.CARBON.getBoilingPoint_C()*5))/10, //Boiling Point in C + ((ELEMENT.ZIRCONIUM.getBoilingPointC()*5)+(ELEMENT.CARBON.getBoilingPointC()*5))/10, //Boiling Point in C ((ELEMENT.ZIRCONIUM.getProtons()*5)+(ELEMENT.CARBON.getProtons()*5))/10, //Protons ((ELEMENT.ZIRCONIUM.getNeutrons()*5)+(ELEMENT.CARBON.getNeutrons()*5))/10, //Neutrons true, //Uses Blast furnace? @@ -480,7 +480,7 @@ public final class ALLOY { "Niobium Carbide", //Material Name new short[]{205, 197, 191, 0}, //Material Colour 2477, //Melting Point in C - ((ELEMENT.NIOBIUM.getBoilingPoint_C()*5)+(ELEMENT.CARBON.getBoilingPoint_C()*5))/10, //Boiling Point in C + ((ELEMENT.NIOBIUM.getBoilingPointC()*5)+(ELEMENT.CARBON.getBoilingPointC()*5))/10, //Boiling Point in C ((ELEMENT.NIOBIUM.getProtons()*5)+(ELEMENT.CARBON.getProtons()*5))/10, //Protons ((ELEMENT.NIOBIUM.getNeutrons()*5)+(ELEMENT.CARBON.getNeutrons()*5))/10, //Neutrons true, //Uses Blast furnace? diff --git a/src/Java/gtPlusPlus/core/material/ELEMENT.java b/src/Java/gtPlusPlus/core/material/ELEMENT.java index f4eb12ec46..1265905c24 100644 --- a/src/Java/gtPlusPlus/core/material/ELEMENT.java +++ b/src/Java/gtPlusPlus/core/material/ELEMENT.java @@ -46,7 +46,7 @@ public final class ELEMENT { public static final Material RUBIDIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Rubidium); public static final Material STRONTIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Strontium); public static final Material YTTRIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Yttrium); - public static final Material ZIRCONIUM = new Material("Zirconium", new short[]{255, 250, 205}, 1855, 4377, 40, 51, false, null, "Zr", 0);//Not a GT Inherited Material + public static final Material ZIRCONIUM = new Material("Zirconium", new short[]{255, 250, 205}, 1855, 4377, 40, 51, false, "Zr", 0);//Not a GT Inherited Material public static final Material NIOBIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Niobium); public static final Material MOLYBDENUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Molybdenum); //public static final Material TECHNETIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Technetium); @@ -79,7 +79,7 @@ public final class ELEMENT { public static final Material THORIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Thorium); public static final Material URANIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Uranium); public static final Material PLUTONIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Plutonium); - public static final Material URANIUM233 = new Material("Uranium-233", new short[]{73, 220, 83, 0}, 1132, 4131, 92, 141, false, null, MaterialUtils.superscript("233U"), 2);//Not a GT Inherited Material + public static final Material URANIUM233 = new Material("Uranium-233", new short[]{73, 220, 83, 0}, 1132, 4131, 92, 141, false, MaterialUtils.superscript("233U"), 2);//Not a GT Inherited Material } diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index e8de7166c2..16c87c427a 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -10,6 +10,9 @@ import gtPlusPlus.core.util.fluid.FluidUtils; import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.materials.MaterialUtils; import gtPlusPlus.core.util.math.MathUtils; + +import java.util.ArrayList; + import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; @@ -17,68 +20,61 @@ import net.minecraftforge.fluids.FluidStack; public class Material { - final String unlocalizedName; - final String localizedName; + private final String unlocalizedName; + private final String localizedName; - final Fluid vMoltenFluid; + private final Fluid vMoltenFluid; protected Object dataVar; - private MaterialStack[] vMaterialInput = new MaterialStack[9]; + private ArrayList vMaterialInput; public final long[] vSmallestRatio; - final short[] RGBA; + private final short[] RGBA; - final boolean usesBlastFurnace; + private final boolean usesBlastFurnace; public final boolean isRadioactive; public final byte vRadioationLevel; - final int meltingPointK; - final int boilingPointK; - final int meltingPointC; - final int boilingPointC; - final long vProtons; - final long vNeutrons; - final long vMass; + private final int meltingPointK; + private final int boilingPointK; + private final int meltingPointC; + private final int boilingPointC; + private final long vProtons; + private final long vNeutrons; + private final long vMass; public final int smallestStackSizeWhenProcessing; //Add a check for <=0 || > 64 public final int vTier; public final int vVoltageMultiplier; public final String vChemicalFormula; public final String vChemicalSymbol; - public Material(String materialName, short[] rgba, int meltingPoint, int boilingPoint, long protons, long neutrons, boolean blastFurnace, MaterialStack[] inputs){ - this(materialName, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, inputs, "", 0); + public Material(final String materialName, final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final MaterialStack... inputs){ + this(materialName, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, "", 0, inputs); } - public Material(String materialName, short[] rgba, int meltingPoint, int boilingPoint, long protons, long neutrons, boolean blastFurnace, MaterialStack[] inputs, int radiationLevel){ - this(materialName, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, inputs, "", radiationLevel); + public Material(final String materialName, final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final int radiationLevel, MaterialStack... inputs){ + this(materialName, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, "", radiationLevel, inputs); } - public Material(String materialName, short[] rgba, int meltingPoint, int boilingPoint, long protons, long neutrons, boolean blastFurnace, MaterialStack[] inputs, String chemicalSymbol, int radiationLevel){ + public Material(final String materialName, final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final String chemicalSymbol, final int radiationLevel, final MaterialStack... inputs){ this.unlocalizedName = Utils.sanitizeString(materialName); this.localizedName = materialName; this.RGBA = rgba; this.meltingPointC = meltingPoint; - if (boilingPoint == 0){ - boilingPoint = meltingPoint*4; + if (boilingPoint != 0){ + this.boilingPointC = boilingPoint; + } + else { + this.boilingPointC = meltingPoint*4; } - this.boilingPointC = boilingPoint; this.meltingPointK = (int) MathUtils.celsiusToKelvin(meltingPointC); this.boilingPointK = (int) MathUtils.celsiusToKelvin(boilingPointC); this.vProtons = protons; this.vNeutrons = neutrons; this.vMass = getMass(); - /*//List inputArray = Arrays.asList(inputs); - int tempSmallestSize = getSmallestStackForCrafting(inputs); - if (tempSmallestSize <= 64 && tempSmallestSize >= 1){ - this.smallestStackSizeWhenProcessing = tempSmallestSize; //Valid stacksizes - } - else { - this.smallestStackSizeWhenProcessing = 50; //Can divide my math by 1/2 and round it~ - }*/ - //Sets the Rad level if (radiationLevel != 0){ this.isRadioactive = true; @@ -90,42 +86,10 @@ public class Material { } //Sets the materials 'tier'. Will probably replace this logic. - if (getMeltingPoint_K() >= 0 && getMeltingPoint_K() <= 750){ - this.vTier = 1; - } - else if(getMeltingPoint_K() >= 751 && getMeltingPoint_K() <= 1250){ - this.vTier = 2; - } - else if(getMeltingPoint_K() >= 1251 && getMeltingPoint_K() <= 1750){ - this.vTier = 3; - } - else if(getMeltingPoint_K() >= 1751 && getMeltingPoint_K() <= 2250){ - this.vTier = 4; - } - else if(getMeltingPoint_K() >= 2251 && getMeltingPoint_K() <= 2750){ - this.vTier = 5; - } - else if(getMeltingPoint_K() >= 2751 && getMeltingPoint_K() <= 3250){ - this.vTier = 6; - } - else if(getMeltingPoint_K() >= 3251 && getMeltingPoint_K() <= 3750){ - this.vTier = 7; - } - else if(getMeltingPoint_K() >= 3751 && getMeltingPoint_K() <= 4250){ - this.vTier = 8; - } - else if(getMeltingPoint_K() >= 4251 && getMeltingPoint_K() <= 4750){ - this.vTier = 9; - } - else if(getMeltingPoint_K() >= 4751 && getMeltingPoint_K() <= 9999){ - this.vTier = 10; - } - else { - this.vTier = 0; - } + this.vTier = MaterialUtils.getTierOfMaterial((int) MathUtils.celsiusToKelvin(meltingPoint)); this.usesBlastFurnace = blastFurnace; - this.vVoltageMultiplier = this.getMeltingPoint_K() >= 2800 ? 64 : 16; + this.vVoltageMultiplier = this.getMeltingPointK() >= 2800 ? 64 : 16; if (inputs == null){ this.vMaterialInput = null; @@ -134,7 +98,7 @@ public class Material { if (inputs.length != 0){ for (int i=0; i < inputs.length; i++){ if (inputs[i] != null){ - this.vMaterialInput[i] = inputs[i]; + this.vMaterialInput.set(i, inputs[i]); } } } @@ -186,8 +150,6 @@ public class Material { this.vMoltenFluid = generateFluid(); } } - - //dataVar = MathUtils.generateSingularRandomHexValue(); @@ -211,19 +173,19 @@ public class Material { Utils.LOG_INFO("Boiling Point: "+boilingPointC+"C."); } - public String getLocalizedName(){ + final public String getLocalizedName(){ return localizedName; } - public String getUnlocalizedName(){ + final public String getUnlocalizedName(){ return unlocalizedName; } - public short[] getRGBA(){ - return RGBA; + final public short[] getRGBA(){ + return this.RGBA; } - public int getRgbAsHex(){ + final public int getRgbAsHex(){ int returnValue = Utils.rgbtoHexValue(RGBA[0], RGBA[1], RGBA[2]); if (returnValue == 0){ @@ -232,115 +194,115 @@ public class Material { return Utils.rgbtoHexValue(RGBA[0], RGBA[1], RGBA[2]); } - public long getProtons() { + final public long getProtons() { return vProtons; } - public long getNeutrons() { + final public long getNeutrons() { return vNeutrons; } - public long getMass() { + final public long getMass() { return vProtons + vNeutrons; } - public int getMeltingPoint_C() { + final public int getMeltingPointC() { return meltingPointC; } - public int getBoilingPoint_C() { + final public int getBoilingPointC() { return boilingPointC; } - public int getMeltingPoint_K() { + final public int getMeltingPointK() { return meltingPointK; } - public int getBoilingPoint_K() { + final public int getBoilingPointK() { return boilingPointK; } - public boolean requiresBlastFurnace(){ + final public boolean requiresBlastFurnace(){ return usesBlastFurnace; } - public ItemStack getDust(int stacksize){ + final public ItemStack getDust(int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dust"+unlocalizedName, stacksize); } - public ItemStack getSmallDust(int stacksize){ + final public ItemStack getSmallDust(int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustSmall"+unlocalizedName, stacksize); } - public ItemStack getTinyDust(int stacksize){ + final public ItemStack getTinyDust(int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustTiny"+unlocalizedName, stacksize); } - public ItemStack[] getValidInputStacks(){ + final public ItemStack[] getValidInputStacks(){ return ItemUtils.validItemsForOreDict(unlocalizedName); } - public ItemStack getIngot(int stacksize){ + final public ItemStack getIngot(int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingot"+unlocalizedName, stacksize); } - public ItemStack getPlate(int stacksize){ + final public ItemStack getPlate(int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plate"+unlocalizedName, stacksize); } - public ItemStack getPlateDouble(int stacksize){ + final public ItemStack getPlateDouble(int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateDouble"+unlocalizedName, stacksize); } - public ItemStack getGear(int stacksize){ + final public ItemStack getGear(int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("gear"+unlocalizedName, stacksize); } - public ItemStack getRod(int stacksize){ + final public ItemStack getRod(int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("stick"+unlocalizedName, stacksize); } - public ItemStack getLongRod(int stacksize){ + final public ItemStack getLongRod(int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("stickLong"+unlocalizedName, stacksize); } - public ItemStack getBolt(int stacksize){ + final public ItemStack getBolt(int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("bolt"+unlocalizedName, stacksize); } - public ItemStack getScrew(int stacksize){ + final public ItemStack getScrew(int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("screw"+unlocalizedName, stacksize); } - public ItemStack getRing(int stacksize){ + final public ItemStack getRing(int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ring"+unlocalizedName, stacksize); } - public ItemStack getRotor(int stacksize){ + final public ItemStack getRotor(int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("rotor"+unlocalizedName, stacksize); } - public ItemStack getFrameBox(int stacksize){ + final public ItemStack getFrameBox(int stacksize){ return ItemUtils.getItemStackOfAmountFromOreDictNoBroken("frameGt"+unlocalizedName, stacksize); } - public ItemStack[] getMaterialComposites(){ + final public ItemStack[] getMaterialComposites(){ //Utils.LOG_WARNING("Something requested the materials needed for "+localizedName); - if (vMaterialInput != null && vMaterialInput.length >= 1){ - ItemStack[] temp = new ItemStack[vMaterialInput.length]; - for (int i=0;i getComposites(){ return this.vMaterialInput; } - public int[] getMaterialCompositeStackSizes(){ - if (vMaterialInput != null && vMaterialInput.length >= 1){ - int[] temp = new int[vMaterialInput.length]; - for (int i=0;i= 1){ - int f = getInputMaterialCount(materialInput); - String[] formulaComponents = new String[f]; - for (int i=0;i 0){ - Utils.LOG_WARNING("length: "+inputs.length); - Utils.LOG_WARNING("(inputs != null): "+(inputs != null)); + @SuppressWarnings("static-method") + final public long[] getSmallestRatio(ArrayList tempInput){ + if (tempInput != null){ + if (!tempInput.isEmpty()){ + Utils.LOG_WARNING("length: "+tempInput.size()); + Utils.LOG_WARNING("(inputs != null): "+(tempInput != null)); //Utils.LOG_WARNING("length: "+inputs.length); - double tempPercentage=0; - long[] tempRatio = new long[inputs.length]; - for (int x=0;x= 101){ - Utils.LOG_WARNING("The compound for "+localizedName+" doesn't equal 98-100%, this isn't good."); - }*/ long[] smallestRatio = MathUtils.simplifyNumbersToSmallestForm(tempRatio); @@ -463,59 +372,40 @@ public class Material { return null; } - private int getSmallestStackForCrafting(MaterialStack[] inputs){ - if (inputs != null){ - if (inputs.length != 0){ - long[] smallestRatio = getSmallestRatio(inputs); - if (smallestRatio.length > 0){ - int tempSmallestCraftingUseSize = 0; - for (int r=0;r tempInput = vMaterialInput; if (tempInput != null){ - if (tempInput.length >= 1){ + if (!tempInput.isEmpty()){ String dummyFormula = ""; long[] dummyFormulaArray = getSmallestRatio(tempInput); if (dummyFormulaArray != null){ if (dummyFormulaArray.length >= 1){ - for (int e=0;e 1){ - if (tempInput[e].stackMaterial.vChemicalFormula.length() > 3){ - dummyFormula = dummyFormula + "(" + tempInput[e].stackMaterial.vChemicalFormula + ")" + dummyFormulaArray[e]; + if (tempInput.get(e).stackMaterial.vChemicalFormula.length() > 3){ + dummyFormula = dummyFormula + "(" + tempInput.get(e).stackMaterial.vChemicalFormula + ")" + dummyFormulaArray[e]; } else { - dummyFormula = dummyFormula + tempInput[e].stackMaterial.vChemicalFormula + dummyFormulaArray[e]; + dummyFormula = dummyFormula + tempInput.get(e).stackMaterial.vChemicalFormula + dummyFormulaArray[e]; } } else if (dummyFormulaArray[e] == 1){ - if (tempInput[e].stackMaterial.vChemicalFormula.length() > 3){ - dummyFormula = dummyFormula + "(" +tempInput[e].stackMaterial.vChemicalFormula + ")"; + if (tempInput.get(e).stackMaterial.vChemicalFormula.length() > 3){ + dummyFormula = dummyFormula + "(" +tempInput.get(e).stackMaterial.vChemicalFormula + ")"; } else { - dummyFormula = dummyFormula + "" +tempInput[e].stackMaterial.vChemicalFormula + ""; + dummyFormula = dummyFormula +tempInput.get(e).stackMaterial.vChemicalFormula; } } - else if (dummyFormulaArray[e] <= 0){ - dummyFormula = dummyFormula+""; - } } else dummyFormula = dummyFormula + "??"; @@ -523,9 +413,6 @@ public class Material { else dummyFormula = dummyFormula + "▓▓"; } - else { - dummyFormula = dummyFormula+""; - } } return MaterialUtils.subscript(dummyFormula); //return dummyFormula; @@ -541,12 +428,13 @@ public class Material { } - Fluid generateFluid(){ + final Fluid generateFluid(){ if (Materials.get(localizedName).mFluid == null){ Utils.LOG_WARNING("Generating our own fluid."); //Generate a Cell if we need to if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+getUnlocalizedName(), 1) == null){ + @SuppressWarnings("unused") Item temp = new BaseItemCell(this); } return FluidUtils.addGTFluid( @@ -554,7 +442,7 @@ public class Material { "Molten "+this.getLocalizedName(), this.RGBA, 4, - this.getMeltingPoint_K(), + this.getMeltingPointK(), ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+getUnlocalizedName(), 1), ItemList.Cell_Empty.get(1L, new Object[0]), 1000); @@ -563,7 +451,7 @@ public class Material { return Materials.get(localizedName).mFluid; } - public FluidStack getFluid(int fluidAmount) { + final public FluidStack getFluid(int fluidAmount) { Utils.LOG_WARNING("Attempting to get "+fluidAmount+"L of "+this.vMoltenFluid.getName()); FluidStack moltenFluid = new FluidStack(this.vMoltenFluid, fluidAmount); diff --git a/src/Java/gtPlusPlus/core/util/fluid/FluidUtils.java b/src/Java/gtPlusPlus/core/util/fluid/FluidUtils.java index 742c3c6e9f..83b0bfd65d 100644 --- a/src/Java/gtPlusPlus/core/util/fluid/FluidUtils.java +++ b/src/Java/gtPlusPlus/core/util/fluid/FluidUtils.java @@ -109,7 +109,7 @@ public class FluidUtils { * @return short[] */ public static Fluid generateFluid(Material material ,int aState){ - int tempK = material.getMeltingPoint_C(); + int tempK = material.getMeltingPointC(); Fluid generatedFluid = null; switch (aState) { case 0: { diff --git a/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java b/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java index 35605169c5..dac1162357 100644 --- a/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java +++ b/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java @@ -62,7 +62,7 @@ public class MaterialUtils { if (hasValidRGBA(rgba) || element == Element.H){ //ModItems.itemBaseDecidust = UtilsItems.generateDecidust(material); //ModItems.itemBaseCentidust = UtilsItems.generateCentidust(material); - return new Material(name, rgba, melting, boiling, protons, neutrons, blastFurnace, null, chemicalFormula, radioactivity); + return new Material(name, rgba, melting, boiling, protons, neutrons, blastFurnace, chemicalFormula, radioactivity); } return null; @@ -133,6 +133,42 @@ public class MaterialUtils { return str; } + public static int getTierOfMaterial(int M){ + if (M >= 0 && M <= 750){ + return 1; + } + else if(M >= 751 && M <= 1250){ + return 2; + } + else if(M >= 1251 && M <= 1750){ + return 3; + } + else if(M >= 1751 && M <= 2250){ + return 4; + } + else if(M >= 2251 && M <= 2750){ + return 5; + } + else if(M >= 2751 && M <= 3250){ + return 6; + } + else if(M >= 3251 && M <= 3750){ + return 7; + } + else if(M >= 3751 && M <= 4250){ + return 8; + } + else if(M >= 4251 && M <= 4750){ + return 9; + } + else if(M >= 4751 && M <= 9999){ + return 10; + } + else { + return 0; + } + } + /* * That's shown, many times, in the EnumHelper code, all the add functions just wrap the addEnum function. diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java index 4b8fff1cc3..7e1c79aae3 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java @@ -59,7 +59,7 @@ public class CasingTextureHandler { case 14: return TexturesGtBlocks.Casing_Staballoy_Firebox.getIcon(); case 15: - return TexturesGtBlocks.Casing_Material_Grisium.getIcon(); + return TexturesGtBlocks.Casing_Material_ZirconiumCarbide.getIcon(); default: return Textures.BlockIcons.MACHINE_CASING_RADIOACTIVEHAZARD.getIcon(); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastSmelter.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastSmelter.java index 408a3723e0..34b8dde304 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastSmelter.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastSmelter.java @@ -11,6 +11,7 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.api.util.Recipe_GT; import gtPlusPlus.core.block.ModBlocks; +import gtPlusPlus.core.util.Utils; import java.util.ArrayList; import java.util.Arrays; @@ -112,6 +113,7 @@ public class GregtechMetaTileEntity_AlloyBlastSmelter } FluidStack[] tFluids = (FluidStack[]) Arrays.copyOfRange(tFluidList.toArray(new FluidStack[tInputList.size()]), 0, 1); if (tInputList.size() > 0) { + Utils.LOG_INFO("Found some Valid Inputs."); long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBlastRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); @@ -138,6 +140,7 @@ public class GregtechMetaTileEntity_AlloyBlastSmelter return true; } } + Utils.LOG_INFO("Failed to find some Valid Inputs."); return false; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java index bca7861d58..54a5614b80 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java @@ -11,6 +11,9 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.ItemUtils; + +import java.util.ArrayList; + import net.minecraft.item.ItemStack; public class RecipeGen_BlastSmelter { @@ -173,7 +176,7 @@ public class RecipeGen_BlastSmelter { //Prepare some Variables ItemStack[] components; - gtPlusPlus.core.material.MaterialStack[] tMaterial; + ArrayList tMaterial; short counter=0; int inputStackCount=0; int fluidAmount=0; @@ -186,8 +189,8 @@ public class RecipeGen_BlastSmelter { //Set a duration int duration = 0; - if (M.getMeltingPoint_K() > 150){ - duration = (int) Math.max(M.getMass() / 50L, 1L) * M.getMeltingPoint_K(); + if (M.getMeltingPointK() > 150){ + duration = (int) Math.max(M.getMass() / 50L, 1L) * M.getMeltingPointK(); } else { duration = (int) Math.max(M.getMass() / 50L, 1L) * 150; @@ -229,7 +232,7 @@ public class RecipeGen_BlastSmelter { 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.getLocalizedName(), 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)){ @@ -253,7 +256,7 @@ public class RecipeGen_BlastSmelter { 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.getLocalizedName(), 1); + 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."); @@ -302,11 +305,11 @@ public class RecipeGen_BlastSmelter { //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= 2800 ? 64 : 16; + int tVoltageMultiplier = material.getMeltingPointK() >= 2800 ? 64 : 16; Utils.LOG_WARNING("Generating Shaped Crafting recipes for "+material.getLocalizedName()); //TODO //Ring Recipe @@ -80,30 +80,47 @@ public class RecipeGen_DustGeneration { Utils.LOG_WARNING("4 Small dust from 1 Dust Recipe: "+material.getLocalizedName()+" - Failed"); } - - if (inputStacks.length > 0 && inputStacks.length <= 4){ - Utils.LOG_WARNING(ItemUtils.getArrayStackNames(inputStacks)); - long[] inputStackSize = material.vSmallestRatio; - if (inputStackSize != null){ - for (short x=0;x= 2800 ? 64 : 16; + int tVoltageMultiplier = material.getMeltingPointK() >= 2800 ? 64 : 16; ItemStack itemIngot = material.getIngot(1); ItemStack plate_Single = material.getPlate(1); ItemStack itemGear = material.getGear(1); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java index 16e0c90d07..add6cf41b4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java @@ -12,7 +12,7 @@ public class RecipeGen_Plates { public static void generateRecipes(Material material){ - int tVoltageMultiplier = material.getMeltingPoint_K() >= 2800 ? 64 : 16; + int tVoltageMultiplier = material.getMeltingPointK() >= 2800 ? 64 : 16; ItemStack ingotStackOne = material.getIngot(1); ItemStack ingotStackTwo = material.getIngot(2); ItemStack shape_Mold = ItemList.Shape_Mold_Plate.get(0); -- cgit From 081430a8f07d0957acd52927f55c7ddb6c7e34a3 Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Thu, 27 Oct 2016 05:40:36 +1000 Subject: - Removed threaded registration idea. --- src/Java/gtPlusPlus/core/item/ModItems.java | 88 ++++++++++++---------- .../core/material/MaterialGenerator.java | 16 +++- src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java | 4 +- .../xmod/gregtech/loaders/RecipeGen_Extruder.java | 33 +++++--- 4 files changed, 85 insertions(+), 56 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java') diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index 21d3ff8db7..c1e40cf6d8 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -156,6 +156,7 @@ public final class ModItems { //@SuppressWarnings("unused") + @SuppressWarnings("unused") public static final void init(){ AAA_Broken = new BaseItemIngot("AAA_Broken", "Errors - Tell Alkalus", Utils.rgbtoHexValue(128, 128, 128), 0); @@ -204,61 +205,68 @@ public final class ModItems { try{ //Elements generate first so they can be used in compounds. - + //Uranium-233 is a fissile isotope of uranium that is bred from thorium-232 as part of the thorium fuel cycle. - MaterialGenerator.generateItemsFromMaterial(ELEMENT.getInstance().URANIUM233); - MaterialGenerator.generateItemsFromMaterial(ELEMENT.getInstance().ZIRCONIUM); + new MaterialGenerator(ELEMENT.getInstance().URANIUM233); + new MaterialGenerator(ELEMENT.getInstance().ZIRCONIUM); //Carbides - Tungsten Carbide exists in .09 so don't generate it. - Should still come before alloys though if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){ - MaterialGenerator.generateItemsFromMaterial(ALLOY.TUNGSTEN_CARBIDE); + new MaterialGenerator(ALLOY.TUNGSTEN_CARBIDE); } - MaterialGenerator.generateItemsFromMaterial(ALLOY.SILICON_CARBIDE); - MaterialGenerator.generateItemsFromMaterial(ALLOY.ZIRCONIUM_CARBIDE); - MaterialGenerator.generateItemsFromMaterial(ALLOY.TANTALUM_CARBIDE); - MaterialGenerator.generateItemsFromMaterial(ALLOY.NIOBIUM_CARBIDE); + new MaterialGenerator(ALLOY.SILICON_CARBIDE); + new MaterialGenerator(ALLOY.ZIRCONIUM_CARBIDE); + new MaterialGenerator(ALLOY.TANTALUM_CARBIDE); + new MaterialGenerator(ALLOY.NIOBIUM_CARBIDE); //Generate some Alloys - MaterialGenerator.generateItemsFromMaterial(ALLOY.ENERGYCRYSTAL); - MaterialGenerator.generateItemsFromMaterial(ALLOY.BLOODSTEEL); - MaterialGenerator.generateItemsFromMaterial(ALLOY.BEDROCKIUM); - - MaterialGenerator.generateItemsFromMaterial(ALLOY.STABALLOY); - MaterialGenerator.generateItemsFromMaterial(ALLOY.TANTALLOY_60); - MaterialGenerator.generateItemsFromMaterial(ALLOY.TANTALLOY_61); - - MaterialGenerator.generateItemsFromMaterial(ALLOY.INCONEL_625); - MaterialGenerator.generateItemsFromMaterial(ALLOY.INCONEL_690); - MaterialGenerator.generateItemsFromMaterial(ALLOY.INCONEL_792); - - MaterialGenerator.generateItemsFromMaterial(ALLOY.ZERON_100); - - MaterialGenerator.generateItemsFromMaterial(ALLOY.MARAGING250); - MaterialGenerator.generateItemsFromMaterial(ALLOY.MARAGING300); - MaterialGenerator.generateItemsFromMaterial(ALLOY.MARAGING350); - MaterialGenerator.generateItemsFromMaterial(ALLOY.STELLITE); - MaterialGenerator.generateItemsFromMaterial(ALLOY.TALONITE); - + //Misc Alloys + new MaterialGenerator(ALLOY.ENERGYCRYSTAL); + new MaterialGenerator(ALLOY.BLOODSTEEL); + new MaterialGenerator(ALLOY.BEDROCKIUM); + new MaterialGenerator(ALLOY.ZERON_100); //Tumbaga was the name given by Spaniards to a non-specific alloy of gold and copper - MaterialGenerator.generateItemsFromMaterial(ALLOY.TUMBAGA); + new MaterialGenerator(ALLOY.TUMBAGA); //Potin is traditionally an alloy of bronze, tin and lead, with varying quantities of each possible - MaterialGenerator.generateItemsFromMaterial(ALLOY.POTIN); + new MaterialGenerator(ALLOY.POTIN); + + //Staballoy & Tantalloy + new MaterialGenerator(ALLOY.STABALLOY); + new MaterialGenerator(ALLOY.TANTALLOY_60); + new MaterialGenerator(ALLOY.TANTALLOY_61); - MaterialGenerator.generateItemsFromMaterial(ALLOY.HASTELLOY_W); - MaterialGenerator.generateItemsFromMaterial(ALLOY.HASTELLOY_X); - MaterialGenerator.generateItemsFromMaterial(ALLOY.HASTELLOY_C276); - MaterialGenerator.generateItemsFromMaterial(ALLOY.HASTELLOY_N); + //Inconel + new MaterialGenerator(ALLOY.INCONEL_625); + new MaterialGenerator(ALLOY.INCONEL_690); + new MaterialGenerator(ALLOY.INCONEL_792); - MaterialGenerator.generateItemsFromMaterial(ALLOY.INCOLOY_020); - MaterialGenerator.generateItemsFromMaterial(ALLOY.INCOLOY_DS); - MaterialGenerator.generateItemsFromMaterial(ALLOY.INCOLOY_MA956); - //Leagrisium - MaterialGenerator.generateItemsFromMaterial(ALLOY.LEAGRISIUM); + //Maraging Steel + new MaterialGenerator(ALLOY.MARAGING250); + new MaterialGenerator(ALLOY.MARAGING300); + new MaterialGenerator(ALLOY.MARAGING350); + + //Composite Alloys + new MaterialGenerator(ALLOY.STELLITE); + new MaterialGenerator(ALLOY.TALONITE); + + //Hastelloy + new MaterialGenerator(ALLOY.HASTELLOY_W); + new MaterialGenerator(ALLOY.HASTELLOY_X); + new MaterialGenerator(ALLOY.HASTELLOY_C276); + new MaterialGenerator(ALLOY.HASTELLOY_N); + + //Incoloy + new MaterialGenerator(ALLOY.INCOLOY_020); + new MaterialGenerator(ALLOY.INCOLOY_DS); + new MaterialGenerator(ALLOY.INCOLOY_MA956); + //Leagrisium + new MaterialGenerator(ALLOY.LEAGRISIUM); //Must be the final Alloy to Generate - MaterialGenerator.generateItemsFromMaterial(ALLOY.QUANTUM); + new MaterialGenerator(ALLOY.QUANTUM); + } catch (Throwable r){ Utils.LOG_INFO("Failed to Generated a Material. "+r.getMessage()); diff --git a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java index 55014f5ee8..8d8f8bc846 100644 --- a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java +++ b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java @@ -39,6 +39,7 @@ public class MaterialGenerator implements Runnable { } + @SuppressWarnings("unused") public static void generateItemsFromMaterial(final Material matInfo){ String unlocalizedName = matInfo.getUnlocalizedName(); String materialName = matInfo.getLocalizedName(); @@ -96,12 +97,21 @@ public class MaterialGenerator implements Runnable { temp = new BaseItemGear(matInfo); } - //Add A jillion Recipes - RecipeGen_Plates.generateRecipes(matInfo); + + //Generate some Recipes + new RecipeGen_Plates(matInfo); + new RecipeGen_Extruder(matInfo); + new RecipeGen_ShapedCrafting(matInfo); + new RecipeGen_DustGeneration(matInfo); + new RecipeGen_BlastSmelter(matInfo); + + + //Add A jillion Recipes - old code + /*RecipeGen_Plates.generateRecipes(matInfo); RecipeGen_Extruder.generateRecipes(matInfo); RecipeGen_ShapedCrafting.generateRecipes(matInfo); RecipeGen_DustGeneration.generateRecipes(matInfo); - RecipeGen_BlastSmelter.generateARecipe(matInfo); + RecipeGen_BlastSmelter.generateARecipe(matInfo);*/ } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java index 2ee8fea9d4..2b3c23daf1 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java @@ -8,7 +8,7 @@ import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechItems; import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools; import gtPlusPlus.xmod.gregtech.loaders.Gregtech_Blocks; import gtPlusPlus.xmod.gregtech.loaders.ProcessingToolHeadChoocher; -import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_BlastSmelter; +import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_BlastSmelterGT; import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechConduits; public class HANDLER_GT { @@ -37,7 +37,7 @@ public class HANDLER_GT { GregtechConduits.run(); new MetaGeneratedGregtechTools(); new ProcessingToolHeadChoocher().run(); - RecipeGen_BlastSmelter.generateRecipes(); + RecipeGen_BlastSmelterGT.generateRecipes(); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java index bfe077cc92..f0ebec9c67 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java @@ -7,20 +7,31 @@ import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; import net.minecraft.item.ItemStack; -public class RecipeGen_Extruder { +public class RecipeGen_Extruder implements Runnable{ - public static void generateRecipes(Material material){ + final Material toGenerate; + + public RecipeGen_Extruder(final Material M){ + this.toGenerate = M; + } + + @Override + public void run() { + generateRecipes(toGenerate); + } + + public static void generateRecipes(final Material material){ - int tVoltageMultiplier = material.getMeltingPointK() >= 2800 ? 64 : 16; - ItemStack itemIngot = material.getIngot(1); - ItemStack plate_Single = material.getPlate(1); - ItemStack itemGear = material.getGear(1); + final int tVoltageMultiplier = material.getMeltingPointK() >= 2800 ? 64 : 16; + final ItemStack itemIngot = material.getIngot(1); + final ItemStack plate_Single = material.getPlate(1); + final ItemStack itemGear = material.getGear(1); - ItemStack shape_Plate = ItemList.Shape_Extruder_Plate.get(0); - ItemStack shape_Ring = ItemList.Shape_Extruder_Ring.get(0); - ItemStack shape_Gear = ItemList.Shape_Extruder_Gear.get(0); - ItemStack shape_Rod = ItemList.Shape_Extruder_Rod.get(0); - ItemStack shape_Bolt = ItemList.Shape_Extruder_Bolt.get(0); + final ItemStack shape_Plate = ItemList.Shape_Extruder_Plate.get(0); + final ItemStack shape_Ring = ItemList.Shape_Extruder_Ring.get(0); + final ItemStack shape_Gear = ItemList.Shape_Extruder_Gear.get(0); + 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()); -- cgit