From 91e18f54e4733c695ac023d87adfcef9e8dbbb4a Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Wed, 14 Sep 2016 01:10:02 +1000 Subject: Attempting to Rewrite the entire material system for future use (Also makes life easier if I do something similar in 1.10) --- src/Java/gtPlusPlus/core/material/Material.java | 80 +++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 src/Java/gtPlusPlus/core/material/Material.java (limited to 'src/Java/gtPlusPlus/core/material/Material.java') diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java new file mode 100644 index 0000000000..4ce496bb22 --- /dev/null +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -0,0 +1,80 @@ +package gtPlusPlus.core.material; + +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.math.MathUtils; +import net.minecraft.item.ItemStack; + +public class Material { + + final String unlocalizedName; + final String localizedName; + + final public MaterialStack[] materialInput = null; + + final public short[] RGBA; + + final boolean usesBlastFurnace; + + final int meltingPointK; + final int boilingPointK; + final int meltingPointC; + final int boilingPointC; + final long vProtons; + final long vNeutrons; + final long vMass; + + public Material(String materialName, short[] rgba, int meltingPoint, int boilingPoint, long protons, long neutrons, boolean blastFurnace, MaterialStack[] inputs){ + + this.unlocalizedName = Utils.sanitizeString(materialName); + this.localizedName = materialName; + this.RGBA = rgba; + this.meltingPointC = meltingPoint; + if (boilingPoint == 0){ + boilingPoint = 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(); + this.usesBlastFurnace = blastFurnace; + + for (int i=0; i < inputs.length; i++){ + if (inputs[i] != null){ + materialInput[i] = inputs[i]; + } + } + + } + + public long getProtons() { + return vProtons; + } + + public long getNeutrons() { + return vNeutrons; + } + + public long getMass() { + return vProtons + vNeutrons; + } + + public int getMeltingPoint_C() { + return meltingPointC; + } + + public int getBoilingPoint_C() { + return boilingPointC; + } + + public ItemStack getDust(){ + return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dust"+unlocalizedName, 1); + } + + public ItemStack[] getValidInputStacks(){ + return UtilsItems.validItemsForOreDict(unlocalizedName); + } + +} -- cgit From 9aad5dc59183de585f4e86efdf79750179ade8c7 Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Wed, 14 Sep 2016 01:45:29 +1000 Subject: Finished Material Re-write, I hope. --- src/Java/gtPlusPlus/core/item/ModItems.java | 76 ++++++++++++---------- .../core/item/base/dusts/BaseItemDust.java | 16 ++--- src/Java/gtPlusPlus/core/material/Material.java | 36 +++++++++- src/Java/gtPlusPlus/core/util/item/UtilsItems.java | 40 ++++++++---- 4 files changed, 111 insertions(+), 57 deletions(-) (limited to 'src/Java/gtPlusPlus/core/material/Material.java') diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index aafe02d470..3e40896c12 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -25,7 +25,8 @@ import gtPlusPlus.core.item.tool.staballoy.StaballoyPickaxe; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.CORE.configSwitches; import gtPlusPlus.core.lib.LoadedMods; -import gtPlusPlus.core.lib.MaterialInfo; +import gtPlusPlus.core.material.ALLOY; +import gtPlusPlus.core.material.ELEMENT; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.debug.DEBUG_INIT; import gtPlusPlus.core.util.item.UtilsItems; @@ -162,53 +163,58 @@ public final class ModItems { //Start meta Item Generation ItemsFoods.load(); - UtilsItems.generateItemsFromMaterial("EnergyCrystal", "Energy Crystal", 8, MaterialInfo.ENERGYCRYSTAL, Utils.rgbtoHexValue(228, 225, 0), true); - UtilsItems.generateItemsFromMaterial("BloodSteel", "Blood Steel", 3, MaterialInfo.BLOODSTEEL, Utils.rgbtoHexValue(142, 28, 0), false); - UtilsItems.generateItemsFromMaterial("Staballoy", "Staballoy", 6, MaterialInfo.STABALLOY, Utils.rgbtoHexValue(68, 75, 66), true); - UtilsItems.generateItemsFromMaterial("Tantalloy60", "Tantalloy-60", 5, MaterialInfo.TANTALLOY60, Utils.rgbtoHexValue(68, 75, 166), true); - UtilsItems.generateItemsFromMaterial("Tantalloy61", "Tantalloy-61", 6, MaterialInfo.TANTALLOY61, Utils.rgbtoHexValue(122, 135, 196), true); - UtilsItems.generateItemsFromMaterial("Bedrockium", "Bedrockium", 9, MaterialInfo.BEDROCKIUM, Utils.rgbtoHexValue(32, 32, 32), false); - UtilsItems.generateItemsFromMaterial("Quantum", "Quantum", 10, MaterialInfo.QUANTUM, Utils.rgbtoHexValue(128, 128, 128), true); + UtilsItems.generateItemsFromMaterial(ALLOY.ENERGYCRYSTAL); + UtilsItems.generateItemsFromMaterial(ALLOY.BLOODSTEEL); + UtilsItems.generateItemsFromMaterial(ALLOY.STABALLOY); + UtilsItems.generateItemsFromMaterial(ALLOY.TANTALLOY_60); + UtilsItems.generateItemsFromMaterial(ALLOY.TANTALLOY_61); + UtilsItems.generateItemsFromMaterial(ALLOY.BEDROCKIUM); + UtilsItems.generateItemsFromMaterial(ALLOY.QUANTUM); - UtilsItems.generateItemsFromMaterial("Inconel625", "Inconel-625", 4, MaterialInfo.INCONEL625, Utils.rgbtoHexValue(128, 200, 128), true); //Inconel 625: Acid resistant, good weldability. The LCF version is typically used in bellows. - UtilsItems.generateItemsFromMaterial("Inconel690", "Inconel-690", 6, MaterialInfo.INCONEL690, Utils.rgbtoHexValue(118, 220, 138), true); //Inconel 690: Low cobalt content for nuclear applications, and low resistivity. - UtilsItems.generateItemsFromMaterial("Inconel792", "Inconel-792", 5, MaterialInfo.INCONEL792, Utils.rgbtoHexValue(108, 240, 118), true); //Inconel 792: Increased aluminium content for improved high temperature corrosion properties, used especially in gas turbines. - + UtilsItems.generateItemsFromMaterial(ALLOY.INCONEL_625); + UtilsItems.generateItemsFromMaterial(ALLOY.INCONEL_690); + UtilsItems.generateItemsFromMaterial(ALLOY.INCONEL_792); if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){ - UtilsItems.generateItemsFromMaterial("TungstenCarbide", "Tungsten Carbide", 5, MaterialInfo.TUNGSTENCARBIDE, Utils.rgbtoHexValue(44, 44, 44), true); + UtilsItems.generateItemsFromMaterial(ALLOY.TUNGSTEN_CARBIDE); } - UtilsItems.generateItemsFromMaterial("SiliconCarbide", "Silicon Carbide", 4, MaterialInfo.SILICONCARBIDE, Utils.rgbtoHexValue(32, 32, 32), false); - UtilsItems.generateItemsFromMaterial("Zeron100", "Zeron-100", 8, MaterialInfo.ZERON100, Utils.rgbtoHexValue(180, 180, 20), true); - UtilsItems.generateItemsFromMaterial("MaragingSteel250", "Maraging Steel 250", 4, MaterialInfo.MARAGING250, Utils.rgbtoHexValue(140, 140, 140), true); - UtilsItems.generateItemsFromMaterial("MaragingSteel300", "Maraging Steel 300", 5, MaterialInfo.MARAGING300, Utils.rgbtoHexValue(150, 150, 150), true); - UtilsItems.generateItemsFromMaterial("MaragingSteel350", "Maraging Steel 350", 6, MaterialInfo.MARAGING350, Utils.rgbtoHexValue(160, 160, 160), true); - UtilsItems.generateItemsFromMaterial("Stellite", "Stellite", 7, MaterialInfo.STELLITE, Utils.rgbtoHexValue(129, 75, 120), true); - UtilsItems.generateItemsFromMaterial("Talonite", "Talonite", 8, MaterialInfo.TALONITE, Utils.rgbtoHexValue(228, 75, 120), false); + UtilsItems.generateItemsFromMaterial(ALLOY.SILICON_CARBIDE); + UtilsItems.generateItemsFromMaterial(ALLOY.ZERON_100); + UtilsItems.generateItemsFromMaterial(ALLOY.MARAGING250); + UtilsItems.generateItemsFromMaterial(ALLOY.MARAGING300); + UtilsItems.generateItemsFromMaterial(ALLOY.MARAGING350); + UtilsItems.generateItemsFromMaterial(ALLOY.STELLITE); + UtilsItems.generateItemsFromMaterial(ALLOY.TALONITE); - UtilsItems.generateItemsFromMaterial("Tumbaga", "Tumbaga", 2, MaterialInfo.TUMBAGA, Utils.rgbtoHexValue(255,178,15), false); //Tumbaga was the name given by Spaniards to a non-specific alloy of gold and copper - UtilsItems.generateItemsFromMaterial("Potin", "Potin", 4, MaterialInfo.POTIN, Utils.rgbtoHexValue(201,151,129), false); //Potin is traditionally an alloy of bronze, tin and lead, with varying quantities of each possible + //Tumbaga was the name given by Spaniards to a non-specific alloy of gold and copper + UtilsItems.generateItemsFromMaterial(ALLOY.TUMBAGA); + //Potin is traditionally an alloy of bronze, tin and lead, with varying quantities of each possible + UtilsItems.generateItemsFromMaterial(ALLOY.POTIN); - UtilsItems.generateItemsFromMaterial("HastelloyW", "Hastelloy-W", 6, MaterialInfo.HASTELLOY_W, Utils.rgbtoHexValue(218, 165, 32), false); - UtilsItems.generateItemsFromMaterial("HastelloyX", "Hastelloy-X", 6, MaterialInfo.HASTELLOY_X, Utils.rgbtoHexValue(255, 193, 37), false); - UtilsItems.generateItemsFromMaterial("HastelloyC276", "Hastelloy-C276", 7, MaterialInfo.HASTELLOY_C276, Utils.rgbtoHexValue(238, 180, 34), true); - UtilsItems.generateItemsFromMaterial("HastelloyN", "Hastelloy-N", 8, MaterialInfo.HASTELLOY_N, Utils.rgbtoHexValue(155, 223, 237), true); + UtilsItems.generateItemsFromMaterial(ALLOY.HASTELLOY_W); + UtilsItems.generateItemsFromMaterial(ALLOY.HASTELLOY_X); + UtilsItems.generateItemsFromMaterial(ALLOY.HASTELLOY_C276); + UtilsItems.generateItemsFromMaterial(ALLOY.HASTELLOY_N); + + UtilsItems.generateItemsFromMaterial(ALLOY.INCOLOY_020); + UtilsItems.generateItemsFromMaterial(ALLOY.INCOLOY_DS); + UtilsItems.generateItemsFromMaterial(ALLOY.INCOLOY_MA956); + + + UtilsItems.generateItemsFromMaterial(ELEMENT.ZIRCONIUM); + UtilsItems.generateItemsFromMaterial(ALLOY.ZIRCONIUM_CARBIDE); + UtilsItems.generateItemsFromMaterial(ALLOY.TANTALUM_CARBIDE); + UtilsItems.generateItemsFromMaterial(ALLOY.NIOBIUM_CARBIDE); + - UtilsItems.generateItemsFromMaterial("Incoloy020", "Incoloy-020", 7, MaterialInfo.INCOLOY020, Utils.rgbtoHexValue(81, 81, 81), false); - UtilsItems.generateItemsFromMaterial("IncoloyDS", "Incoloy-DS", 7, MaterialInfo.INCOLOYDS, Utils.rgbtoHexValue(91, 91, 91), false); - UtilsItems.generateItemsFromMaterial("IncoloyMA956", "Incoloy-MA956", 8, MaterialInfo.INCOLOYMA956, Utils.rgbtoHexValue(101, 101, 101), true); + //Uranium-233 is a fissile isotope of uranium that is bred from thorium-232 as part of the thorium fuel cycle. + UtilsItems.generateItemsFromMaterial(ELEMENT.URANIUM233); - UtilsItems.generateItemsFromMaterial("Zirconium", "Zirconium", 6, MaterialInfo.ZIRCONIUM, Utils.rgbtoHexValue(255, 250, 205), false); - UtilsItems.generateItemsFromMaterial("ZirconiumCarbide", "Zirconium Carbide", 7, MaterialInfo.ZIRCONIUMCARBIDE, Utils.rgbtoHexValue(222, 202, 180), true); - UtilsItems.generateItemsFromMaterial("TantalumCarbide", "Tantalum Carbide", 7, MaterialInfo.TANTALUMCARBIDE, Utils.rgbtoHexValue(139, 136, 120), true); - UtilsItems.generateItemsFromMaterial("NiobiumCarbide", "Niobium Carbide", 6, MaterialInfo.NIOMBIUMCARBIDE, Utils.rgbtoHexValue(205, 197, 191), true); - //Uranium-233if - UtilsItems.generateItemsFromMaterial("Uranium233", "Uranium 233", 4, MaterialInfo.URANIUM233, Utils.rgbtoHexValue(73, 220, 83), false); //Uranium-233 is a fissile isotope of uranium that is bred from thorium-232 as part of the thorium fuel cycle. dustLithiumCarbonate = UtilsItems.generateSpecialUseDusts("LithiumCarbonate", "Lithium Carbonate", Utils.rgbtoHexValue(137, 139, 142))[0]; diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java index 6d12624487..8138e14cf2 100644 --- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java +++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java @@ -5,7 +5,7 @@ import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.lib.MaterialInfo; +import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.UtilsItems; import gtPlusPlus.core.util.math.MathUtils; @@ -29,9 +29,9 @@ public class BaseItemDust extends Item{ protected boolean useBlastFurnace; String name = ""; private int mTier; - private MaterialInfo dustInfo; + private Material dustInfo; - public BaseItemDust(String unlocalizedName, String materialName, MaterialInfo matInfo, int colour, String pileSize, boolean blastFurnaceRequired, int tier, int sRadioactivity) { + public BaseItemDust(String unlocalizedName, String materialName, Material matInfo, int colour, String pileSize, boolean blastFurnaceRequired, int tier, int sRadioactivity) { setUnlocalizedName(unlocalizedName); this.setUnlocalizedName(unlocalizedName); this.setMaxStackSize(64); @@ -135,8 +135,8 @@ public class BaseItemDust extends Item{ private void addMixerRecipe(){ ItemStack tempStack = UtilsItems.getSimpleStack(this); ItemStack tempOutput = null; - ItemStack[] inputStacks = dustInfo.getInputs(); - ItemStack[] outputStacks = dustInfo.getOutputs(); + ItemStack[] inputStacks = dustInfo.getMaterialComposites(); + ItemStack[] outputStacks = {dustInfo.getDust()}; String temp = ""; Utils.LOG_WARNING("Unlocalized name for OreDict nameGen: "+getUnlocalizedName()); if (getUnlocalizedName().contains("item.")){ @@ -202,8 +202,8 @@ public class BaseItemDust extends Item{ Utils.LOG_WARNING("Found "+is.getDisplayName()+" as an input for mixer recipe."); if (is.getDisplayName().toLowerCase().contains("tell alkalus")){ ItemStack tempStackForAName = inputStacks[i]; - String[] inputList = dustInfo.getInputItemsAsList(); - int[] inputSizes = dustInfo.getInputStackSizesAsList(); + String[] inputList = UtilsItems.getArrayStackNamesAsArray(dustInfo.getMaterialComposites()); + int[] inputSizes = dustInfo.getMaterialCompositeStackSizes(); inputStacks[i] = UtilsItems.getItemStackOfAmountFromOreDict(inputList[i], inputSizes[i]); Utils.LOG_WARNING("Swapping input slot "+i+" which contains "+tempStackForAName.getDisplayName()+" with "+inputStacks[i].getDisplayName()+"."); } @@ -260,7 +260,7 @@ public class BaseItemDust extends Item{ tempIngot = tempIngot.replace("itemDust", "ingot"); Utils.LOG_WARNING("Generating OreDict Name: "+tempIngot); - ItemStack[] outputStacks = dustInfo.getOutputs(); + ItemStack[] outputStacks = {dustInfo.getDust()}; if (tempIngot != null && tempIngot != ""){ tempInputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1); tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempDust, 1); diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index 4ce496bb22..ef9f3274ee 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -10,9 +10,9 @@ public class Material { final String unlocalizedName; final String localizedName; - final public MaterialStack[] materialInput = null; + final MaterialStack[] materialInput = null; - final public short[] RGBA; + final short[] RGBA; final boolean usesBlastFurnace; @@ -49,6 +49,18 @@ public class Material { } + public String getLocalizedName(){ + return localizedName; + } + + public String getUnlocalizedName(){ + return unlocalizedName; + } + + public short[] getRGBA(){ + return RGBA; + } + public long getProtons() { return vProtons; } @@ -68,6 +80,10 @@ public class Material { public int getBoilingPoint_C() { return boilingPointC; } + + public boolean requiresBlastFurnace(){ + return usesBlastFurnace; + } public ItemStack getDust(){ return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dust"+unlocalizedName, 1); @@ -77,4 +93,20 @@ public class Material { return UtilsItems.validItemsForOreDict(unlocalizedName); } + public ItemStack[] getMaterialComposites(){ + ItemStack[] temp = {}; + for (int i=0;i 10 || materialTier <= 0){ materialTier = 2; } - int sRadiation = 0; - if (materialName.toLowerCase().contains("uranium")){ - sRadiation = 2; - } - else if (materialName.toLowerCase().contains("plutonium")){ - sRadiation = 4; - } - else if (materialName.toLowerCase().contains("thorium")){ - sRadiation = 1; + + + int sRadiation = 0; + if (isRadioactive(materialName)){ + sRadiation = getRadioactivityLevel(materialName); } + if (sRadiation >= 1){ Item temp; Block tempBlock; @@ -319,7 +324,7 @@ public class UtilsItems { } - public static Item[] generateDusts(String unlocalizedName, String materialName, int materialTier, MaterialInfo matInfo, int Colour, boolean hotIngot){ + public static Item[] generateDusts(String unlocalizedName, String materialName, int materialTier, Material matInfo, int Colour, boolean hotIngot){ int radioactive = getRadioactivityLevel(materialName); Item[] output = { new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", hotIngot, materialTier, radioactive), @@ -409,6 +414,17 @@ public class UtilsItems { } + public static String[] getArrayStackNamesAsArray(ItemStack[] aStack){ + String[] itemNames = {}; + int arpos = 0; + for (ItemStack alph : aStack){ + itemNames[arpos] = alph.getDisplayName(); + arpos++; + } + return itemNames; + + } + public static String getFluidArrayStackNames(FluidStack[] aStack){ String itemNames = "Fluid Array: "; for (FluidStack alph : aStack){ -- cgit From a871ac6e7b14239481899e9c5430c114bc75ba4a Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Wed, 14 Sep 2016 02:00:12 +1000 Subject: Tidying Up some Materials. Making some changes to null arrays, so they no longer are. --- src/Java/gtPlusPlus/core/material/ALLOY.java | 12 +++--------- src/Java/gtPlusPlus/core/material/ELEMENT.java | 4 ++-- src/Java/gtPlusPlus/core/material/Material.java | 6 +++--- 3 files changed, 8 insertions(+), 14 deletions(-) (limited to 'src/Java/gtPlusPlus/core/material/Material.java') diff --git a/src/Java/gtPlusPlus/core/material/ALLOY.java b/src/Java/gtPlusPlus/core/material/ALLOY.java index c0d393ee58..5c368a23da 100644 --- a/src/Java/gtPlusPlus/core/material/ALLOY.java +++ b/src/Java/gtPlusPlus/core/material/ALLOY.java @@ -4,7 +4,7 @@ package gtPlusPlus.core.material; public class ALLOY { public static final Material ENERGYCRYSTAL = new Material( - "name", //Material Name + "Energy Crystal", //Material Name new short[]{228, 255, 0, 0}, //Material Colour 5660, //Melting Point in C 0, //Boiling Point in C @@ -12,10 +12,7 @@ public class ALLOY { 100, //Neutrons true, //Uses Blast furnace? //Material Stacks with Percentage of required elements. - new MaterialStack[]{ - new MaterialStack(ELEMENT.GOLD, 50), - new MaterialStack(ELEMENT.SILVER, 50) - }); + null); public static final Material BLOODSTEEL = new Material( "Blood Steel", //Material Name @@ -26,10 +23,7 @@ public class ALLOY { 100, //Neutrons false, //Uses Blast furnace? //Material Stacks with Percentage of required elements. - new MaterialStack[]{ - new MaterialStack(ELEMENT.GOLD, 50), - new MaterialStack(ELEMENT.SILVER, 50) - }); + null); public static final Material STABALLOY = new Material( "Staballoy", //Material Name diff --git a/src/Java/gtPlusPlus/core/material/ELEMENT.java b/src/Java/gtPlusPlus/core/material/ELEMENT.java index 5022e8676b..05d09e64de 100644 --- a/src/Java/gtPlusPlus/core/material/ELEMENT.java +++ b/src/Java/gtPlusPlus/core/material/ELEMENT.java @@ -3,8 +3,8 @@ package gtPlusPlus.core.material; import gregtech.api.enums.Materials; import gtPlusPlus.core.util.materials.MaterialUtils; -public class ELEMENT { - +public final class ELEMENT { + //First 50 Elements public static final Material HYDROGEN = MaterialUtils.generateMaterialFromGtENUM(Materials.Hydrogen); diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index ef9f3274ee..0af8d91278 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -10,7 +10,7 @@ public class Material { final String unlocalizedName; final String localizedName; - final MaterialStack[] materialInput = null; + final MaterialStack[] materialInput = new MaterialStack[4]; final short[] RGBA; @@ -94,7 +94,7 @@ public class Material { } public ItemStack[] getMaterialComposites(){ - ItemStack[] temp = {}; + ItemStack[] temp = new ItemStack[materialInput.length]; for (int i=0;i Date: Wed, 14 Sep 2016 03:06:05 +1000 Subject: More Work clearing up Nulls. Making more things final and accessible to others. --- .../gtPlusPlus/core/handler/MaterialHandler.java | 29 ------ src/Java/gtPlusPlus/core/item/ModItems.java | 72 ++++++++------ .../core/item/base/dusts/BaseItemDust.java | 37 ++++++-- src/Java/gtPlusPlus/core/material/ALLOY.java | 2 +- src/Java/gtPlusPlus/core/material/Material.java | 105 ++++++++++++--------- 5 files changed, 130 insertions(+), 115 deletions(-) delete mode 100644 src/Java/gtPlusPlus/core/handler/MaterialHandler.java (limited to 'src/Java/gtPlusPlus/core/material/Material.java') diff --git a/src/Java/gtPlusPlus/core/handler/MaterialHandler.java b/src/Java/gtPlusPlus/core/handler/MaterialHandler.java deleted file mode 100644 index 52d95817e5..0000000000 --- a/src/Java/gtPlusPlus/core/handler/MaterialHandler.java +++ /dev/null @@ -1,29 +0,0 @@ -package gtPlusPlus.core.handler; - -import gregtech.api.enums.Materials; -import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.materials.MaterialUtils; - -//Finally Wrote a proper material class, sigh. -public class MaterialHandler implements Runnable{ - - int arrayPos = 0; - boolean[] oneOfEachElementArray; - Material[] AllGregtechMaterials; - - - @Override - public void run() { - //Register GT Base Materials First - Utils.LOG_INFO("Adding All basic elements to the Material Dictionary."); - for (Materials x: Materials.values()){ - if (x.getProtons() <= 100 && !oneOfEachElementArray[arrayPos]){ - AllGregtechMaterials[arrayPos] = MaterialUtils.generateMaterialFromGtENUM(x); - oneOfEachElementArray[arrayPos] = true; - arrayPos++; - } - } - } - -} diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index 3e40896c12..5cfeb83425 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -2,6 +2,7 @@ package gtPlusPlus.core.item; import static gtPlusPlus.core.creative.AddToCreativeTab.tabMachines; import static gtPlusPlus.core.creative.AddToCreativeTab.tabMisc; import static gtPlusPlus.core.lib.CORE.LOAD_ALL_CONTENT; +import static gtPlusPlus.core.util.item.UtilsItems.generateItemsFromMaterial; import gregtech.api.enums.Materials; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.creative.AddToCreativeTab; @@ -163,56 +164,65 @@ public final class ModItems { //Start meta Item Generation ItemsFoods.load(); - UtilsItems.generateItemsFromMaterial(ALLOY.ENERGYCRYSTAL); - UtilsItems.generateItemsFromMaterial(ALLOY.BLOODSTEEL); - UtilsItems.generateItemsFromMaterial(ALLOY.STABALLOY); - UtilsItems.generateItemsFromMaterial(ALLOY.TANTALLOY_60); - UtilsItems.generateItemsFromMaterial(ALLOY.TANTALLOY_61); - UtilsItems.generateItemsFromMaterial(ALLOY.BEDROCKIUM); - UtilsItems.generateItemsFromMaterial(ALLOY.QUANTUM); + try{ + generateItemsFromMaterial(ALLOY.ENERGYCRYSTAL); + generateItemsFromMaterial(ALLOY.BLOODSTEEL); + generateItemsFromMaterial(ALLOY.STABALLOY); + generateItemsFromMaterial(ALLOY.TANTALLOY_60); + generateItemsFromMaterial(ALLOY.TANTALLOY_61); + generateItemsFromMaterial(ALLOY.BEDROCKIUM); + generateItemsFromMaterial(ALLOY.QUANTUM); - UtilsItems.generateItemsFromMaterial(ALLOY.INCONEL_625); - UtilsItems.generateItemsFromMaterial(ALLOY.INCONEL_690); - UtilsItems.generateItemsFromMaterial(ALLOY.INCONEL_792); + generateItemsFromMaterial(ALLOY.INCONEL_625); + generateItemsFromMaterial(ALLOY.INCONEL_690); + generateItemsFromMaterial(ALLOY.INCONEL_792); if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){ - UtilsItems.generateItemsFromMaterial(ALLOY.TUNGSTEN_CARBIDE); + generateItemsFromMaterial(ALLOY.TUNGSTEN_CARBIDE); } - UtilsItems.generateItemsFromMaterial(ALLOY.SILICON_CARBIDE); - UtilsItems.generateItemsFromMaterial(ALLOY.ZERON_100); - UtilsItems.generateItemsFromMaterial(ALLOY.MARAGING250); - UtilsItems.generateItemsFromMaterial(ALLOY.MARAGING300); - UtilsItems.generateItemsFromMaterial(ALLOY.MARAGING350); - UtilsItems.generateItemsFromMaterial(ALLOY.STELLITE); - UtilsItems.generateItemsFromMaterial(ALLOY.TALONITE); + generateItemsFromMaterial(ALLOY.SILICON_CARBIDE); + generateItemsFromMaterial(ALLOY.ZERON_100); + generateItemsFromMaterial(ALLOY.MARAGING250); + generateItemsFromMaterial(ALLOY.MARAGING300); + generateItemsFromMaterial(ALLOY.MARAGING350); + generateItemsFromMaterial(ALLOY.STELLITE); + generateItemsFromMaterial(ALLOY.TALONITE); //Tumbaga was the name given by Spaniards to a non-specific alloy of gold and copper - UtilsItems.generateItemsFromMaterial(ALLOY.TUMBAGA); + generateItemsFromMaterial(ALLOY.TUMBAGA); //Potin is traditionally an alloy of bronze, tin and lead, with varying quantities of each possible - UtilsItems.generateItemsFromMaterial(ALLOY.POTIN); + generateItemsFromMaterial(ALLOY.POTIN); - UtilsItems.generateItemsFromMaterial(ALLOY.HASTELLOY_W); - UtilsItems.generateItemsFromMaterial(ALLOY.HASTELLOY_X); - UtilsItems.generateItemsFromMaterial(ALLOY.HASTELLOY_C276); - UtilsItems.generateItemsFromMaterial(ALLOY.HASTELLOY_N); + generateItemsFromMaterial(ALLOY.HASTELLOY_W); + generateItemsFromMaterial(ALLOY.HASTELLOY_X); + generateItemsFromMaterial(ALLOY.HASTELLOY_C276); + generateItemsFromMaterial(ALLOY.HASTELLOY_N); - UtilsItems.generateItemsFromMaterial(ALLOY.INCOLOY_020); - UtilsItems.generateItemsFromMaterial(ALLOY.INCOLOY_DS); - UtilsItems.generateItemsFromMaterial(ALLOY.INCOLOY_MA956); + generateItemsFromMaterial(ALLOY.INCOLOY_020); + generateItemsFromMaterial(ALLOY.INCOLOY_DS); + generateItemsFromMaterial(ALLOY.INCOLOY_MA956); - UtilsItems.generateItemsFromMaterial(ELEMENT.ZIRCONIUM); - UtilsItems.generateItemsFromMaterial(ALLOY.ZIRCONIUM_CARBIDE); - UtilsItems.generateItemsFromMaterial(ALLOY.TANTALUM_CARBIDE); - UtilsItems.generateItemsFromMaterial(ALLOY.NIOBIUM_CARBIDE); + generateItemsFromMaterial(ELEMENT.ZIRCONIUM); + generateItemsFromMaterial(ALLOY.ZIRCONIUM_CARBIDE); + generateItemsFromMaterial(ALLOY.TANTALUM_CARBIDE); + generateItemsFromMaterial(ALLOY.NIOBIUM_CARBIDE); //Uranium-233 is a fissile isotope of uranium that is bred from thorium-232 as part of the thorium fuel cycle. UtilsItems.generateItemsFromMaterial(ELEMENT.URANIUM233); + } catch (Throwable r){ + Utils.LOG_INFO("Failed to Generated a Material. "+r.getMessage()); + //Utils.LOG_INFO("Failed to Generated a Material. "+r.getCause().getMessage()); + Utils.LOG_INFO("Failed to Generated a Material. "+r.getStackTrace()[0].getMethodName()); + Utils.LOG_INFO("Failed to Generated a Material. "+r.getStackTrace()[1].getMethodName()); + r.printStackTrace(); + System.exit(1); + } dustLithiumCarbonate = UtilsItems.generateSpecialUseDusts("LithiumCarbonate", "Lithium Carbonate", Utils.rgbtoHexValue(137, 139, 142))[0]; diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java index 8138e14cf2..b5e303ff7a 100644 --- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java +++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java @@ -218,12 +218,19 @@ public class BaseItemDust extends Item{ } } - GT_Values.RA.addMixerRecipe( - inputStacks[0], inputStacks[1], - inputStacks[2], inputStacks[3], - null, null, - tempOutput, - 8*mTier*20, 8*mTier*2); + if (inputStacks.length != 0){ + GT_Values.RA.addMixerRecipe( + inputStacks[0], inputStacks[1], + inputStacks[2], inputStacks[3], + null, null, + tempOutput, + 8*mTier*20, 8*mTier*2); + } + else { + return; + } + + /*GT_Values.RA.addMixerRecipe( GT_Utility.copyAmount(inputStacks[0].stackSize, new Object[]{inputStacks[0]}), GT_Utility.copyAmount(inputStacks[1].stackSize, new Object[]{inputStacks[1]}), @@ -264,11 +271,21 @@ public class BaseItemDust extends Item{ if (tempIngot != null && tempIngot != ""){ tempInputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1); tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempDust, 1); - ItemStack tempStackOutput2; + ItemStack tempStackOutput2 = null; int chance = mTier*10/MathUtils.randInt(10, 20); - if (outputStacks[1] != null && !outputStacks[1].getUnlocalizedName().toLowerCase().contains("aaa_broken")){ - tempStackOutput2 = outputStacks[1]; - tempOutputStack = outputStacks[0]; + if (outputStacks.length != 0){ + if (outputStacks.length == 1){ + tempStackOutput2 = null; + } + else { + if (!outputStacks[1].getUnlocalizedName().toLowerCase().contains("aaa_broken")){ + tempStackOutput2 = outputStacks[1]; + tempOutputStack = outputStacks[0]; + } + else { + tempStackOutput2 = null; + } + } } else { tempStackOutput2 = null; diff --git a/src/Java/gtPlusPlus/core/material/ALLOY.java b/src/Java/gtPlusPlus/core/material/ALLOY.java index 5c368a23da..3b203b037e 100644 --- a/src/Java/gtPlusPlus/core/material/ALLOY.java +++ b/src/Java/gtPlusPlus/core/material/ALLOY.java @@ -1,7 +1,7 @@ package gtPlusPlus.core.material; -public class ALLOY { +public final class ALLOY { public static final Material ENERGYCRYSTAL = new Material( "Energy Crystal", //Material Name diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index 0af8d91278..7085ec9329 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -10,7 +10,7 @@ public class Material { final String unlocalizedName; final String localizedName; - final MaterialStack[] materialInput = new MaterialStack[4]; + private MaterialStack[] materialInput = new MaterialStack[4]; final short[] RGBA; @@ -41,49 +41,55 @@ public class Material { this.vMass = getMass(); this.usesBlastFurnace = blastFurnace; - for (int i=0; i < inputs.length; i++){ - if (inputs[i] != null){ - materialInput[i] = inputs[i]; + if (inputs == null){ + this.materialInput = null; + } + else { + if (inputs.length != 0){ + for (int i=0; i < inputs.length; i++){ + if (inputs[i] != null){ + this.materialInput[i] = inputs[i]; + } + } } } - } - + public String getLocalizedName(){ return localizedName; } - + public String getUnlocalizedName(){ return unlocalizedName; } - + public short[] getRGBA(){ return RGBA; } - + public long getProtons() { - return vProtons; - } - - public long getNeutrons() { - return vNeutrons; - } - - public long getMass() { - return vProtons + vNeutrons; - } - - public int getMeltingPoint_C() { - return meltingPointC; - } - - public int getBoilingPoint_C() { - return boilingPointC; - } - - public boolean requiresBlastFurnace(){ - return usesBlastFurnace; - } + return vProtons; + } + + public long getNeutrons() { + return vNeutrons; + } + + public long getMass() { + return vProtons + vNeutrons; + } + + public int getMeltingPoint_C() { + return meltingPointC; + } + + public int getBoilingPoint_C() { + return boilingPointC; + } + + public boolean requiresBlastFurnace(){ + return usesBlastFurnace; + } public ItemStack getDust(){ return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dust"+unlocalizedName, 1); @@ -92,21 +98,32 @@ public class Material { public ItemStack[] getValidInputStacks(){ return UtilsItems.validItemsForOreDict(unlocalizedName); } - + public ItemStack[] getMaterialComposites(){ - ItemStack[] temp = new ItemStack[materialInput.length]; - for (int i=0;i= 1){ + ItemStack[] temp = new ItemStack[materialInput.length]; + for (int i=0;i= 1){ + int[] temp = new int[materialInput.length]; + for (int i=0;i Date: Wed, 14 Sep 2016 04:35:19 +1000 Subject: I think only shape(less) recipes for Small/Tiny dusts & implementing recipe cost based on mass, not just what I feel like. lol --- .../core/item/base/dusts/BaseItemDust.java | 20 +++++++++------ src/Java/gtPlusPlus/core/material/ALLOY.java | 6 ++--- src/Java/gtPlusPlus/core/material/ELEMENT.java | 2 +- src/Java/gtPlusPlus/core/material/Material.java | 29 +++++++++++++++++----- .../gtPlusPlus/core/material/MaterialStack.java | 14 ++++++++--- 5 files changed, 49 insertions(+), 22 deletions(-) (limited to 'src/Java/gtPlusPlus/core/material/Material.java') diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java index b5e303ff7a..b94b7759da 100644 --- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java +++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java @@ -136,21 +136,21 @@ public class BaseItemDust extends Item{ ItemStack tempStack = UtilsItems.getSimpleStack(this); ItemStack tempOutput = null; ItemStack[] inputStacks = dustInfo.getMaterialComposites(); - ItemStack[] outputStacks = {dustInfo.getDust()}; + ItemStack[] outputStacks = {dustInfo.getDust(10)}; String temp = ""; Utils.LOG_WARNING("Unlocalized name for OreDict nameGen: "+getUnlocalizedName()); - if (getUnlocalizedName().contains("item.")){ + if (getUnlocalizedName().toLowerCase().contains("item.")){ temp = getUnlocalizedName().replace("item.", ""); Utils.LOG_WARNING("Generating OreDict Name: "+temp); } else { temp = getUnlocalizedName(); } - if (temp.contains("DustTiny")){ + if (temp.toLowerCase().contains("dusttiny")){ temp = temp.replace("itemDustTiny", "dust"); Utils.LOG_WARNING("Generating OreDict Name: "+temp); } - else if (temp.contains("DustSmall")){ + else if (temp.toLowerCase().contains("dustsmall")){ temp = temp.replace("itemDustSmall", "dust"); Utils.LOG_WARNING("Generating OreDict Name: "+temp); } @@ -158,9 +158,9 @@ public class BaseItemDust extends Item{ temp = temp.replace("itemD", "d"); Utils.LOG_WARNING("Generating OreDict Name: "+temp); } - if (temp != null && temp != ""){ + if (temp != null && temp != "" && !temp.equals("")){ - if (getUnlocalizedName().contains("DustTiny") || getUnlocalizedName().contains("DustSmall")){ + if (getUnlocalizedName().toLowerCase().contains("dusttiny") || getUnlocalizedName().toLowerCase().contains("dustsmall")){ tempOutput = UtilsItems.getItemStackOfAmountFromOreDict(temp, 1); } else { @@ -175,6 +175,10 @@ public class BaseItemDust extends Item{ } } + + if (tempOutput == null){ + tempOutput = dustInfo.getDust(1); + } if (tempOutput != null){ if (getUnlocalizedName().contains("DustTiny")){ @@ -204,7 +208,7 @@ public class BaseItemDust extends Item{ ItemStack tempStackForAName = inputStacks[i]; String[] inputList = UtilsItems.getArrayStackNamesAsArray(dustInfo.getMaterialComposites()); int[] inputSizes = dustInfo.getMaterialCompositeStackSizes(); - inputStacks[i] = UtilsItems.getItemStackOfAmountFromOreDict(inputList[i], inputSizes[i]); + inputStacks[i] = UtilsItems.getItemStackOfAmountFromOreDict(inputList[i], 1); Utils.LOG_WARNING("Swapping input slot "+i+" which contains "+tempStackForAName.getDisplayName()+" with "+inputStacks[i].getDisplayName()+"."); } @@ -267,7 +271,7 @@ public class BaseItemDust extends Item{ tempIngot = tempIngot.replace("itemDust", "ingot"); Utils.LOG_WARNING("Generating OreDict Name: "+tempIngot); - ItemStack[] outputStacks = {dustInfo.getDust()}; + ItemStack[] outputStacks = {dustInfo.getDust(1)}; if (tempIngot != null && tempIngot != ""){ tempInputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1); tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempDust, 1); diff --git a/src/Java/gtPlusPlus/core/material/ALLOY.java b/src/Java/gtPlusPlus/core/material/ALLOY.java index 3b203b037e..b46c84d2ba 100644 --- a/src/Java/gtPlusPlus/core/material/ALLOY.java +++ b/src/Java/gtPlusPlus/core/material/ALLOY.java @@ -330,12 +330,12 @@ public final class ALLOY { new short[]{236, 213, 48, 0}, //Material Colour 1350, //Melting Point in C 0, //Boiling Point in C - ((ELEMENT.IRON.getProtons()*5)+(ELEMENT.MOLYBDENUM.getProtons()*16)+(ELEMENT.CHROMIUM.getProtons()*7)+(ELEMENT.NICKEL.getProtons()*72))/100, //Protons - ((ELEMENT.IRON.getNeutrons()*5)+(ELEMENT.MOLYBDENUM.getNeutrons()*16)+(ELEMENT.CHROMIUM.getNeutrons()*7)+(ELEMENT.NICKEL.getNeutrons()*72))/100, //Neutrons + ((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? //Material Stacks with Percentage of required elements. new MaterialStack[]{ - new MaterialStack(ELEMENT.IRON, 05), + new MaterialStack(ELEMENT.YTTRIUM, 05), new MaterialStack(ELEMENT.MOLYBDENUM, 16), new MaterialStack(ELEMENT.CHROMIUM, 7), new MaterialStack(ELEMENT.NICKEL, 72) diff --git a/src/Java/gtPlusPlus/core/material/ELEMENT.java b/src/Java/gtPlusPlus/core/material/ELEMENT.java index 05d09e64de..307105eaf0 100644 --- a/src/Java/gtPlusPlus/core/material/ELEMENT.java +++ b/src/Java/gtPlusPlus/core/material/ELEMENT.java @@ -30,7 +30,7 @@ public final class ELEMENT { public static final Material SCANDIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Scandium); public static final Material TITANIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Titanium); public static final Material VANADIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Vanadium); - public static final Material CHROMIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Chromium); + public static final Material CHROMIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Chrome); public static final Material MANGANESE = MaterialUtils.generateMaterialFromGtENUM(Materials.Manganese); public static final Material IRON = MaterialUtils.generateMaterialFromGtENUM(Materials.Iron); public static final Material COBALT = MaterialUtils.generateMaterialFromGtENUM(Materials.Cobalt); diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index 7085ec9329..857e403ada 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -25,7 +25,7 @@ public class Material { final long vMass; public Material(String materialName, short[] rgba, int meltingPoint, int boilingPoint, long protons, long neutrons, boolean blastFurnace, MaterialStack[] inputs){ - + this.unlocalizedName = Utils.sanitizeString(materialName); this.localizedName = materialName; this.RGBA = rgba; @@ -53,6 +53,12 @@ public class Material { } } } + Utils.LOG_INFO("Creating a Material instance for "+materialName); + Utils.LOG_INFO("Protons: "+vProtons); + Utils.LOG_INFO("Neutrons: "+vNeutrons); + Utils.LOG_INFO("Mass: "+vMass+"/units"); + Utils.LOG_INFO("Melting Point: "+meltingPointC+"C."); + Utils.LOG_INFO("Boiling Point: "+boilingPointC+"C."); } public String getLocalizedName(){ @@ -91,8 +97,8 @@ public class Material { return usesBlastFurnace; } - public ItemStack getDust(){ - return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dust"+unlocalizedName, 1); + public ItemStack getDust(int stacksize){ + return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dust"+unlocalizedName, stacksize); } public ItemStack[] getValidInputStacks(){ @@ -100,15 +106,26 @@ public class Material { } public ItemStack[] getMaterialComposites(){ + //Utils.LOG_INFO("Something requested the materials needed for "+localizedName); if (materialInput != null && materialInput.length >= 1){ ItemStack[] temp = new ItemStack[materialInput.length]; for (int i=0;i= 0 && percentageToUse <= 0.99){ caseStatus = 1; - amount = Integer.valueOf(String.valueOf(percentageToUse).charAt(2)); + amount = (int) (1/percentageToUse); + //amount = Integer.valueOf(String.valueOf(percentageToUse).charAt(2)); } else if (percentageToUse >= 1 && percentageToUse <= 9.99){ caseStatus = 2; - amount = Integer.valueOf(String.valueOf(percentageToUse).charAt(0)); + amount = (int) (percentageToUse); + //amount = Integer.valueOf(String.valueOf(percentageToUse).charAt(0)); } else if (percentageToUse >= 10 && percentageToUse <= 99.99){ caseStatus = 3; - amount = Integer.valueOf(String.valueOf(percentageToUse).charAt(0)); + amount = (int) (percentageToUse/10); + //amount = Integer.valueOf(String.valueOf(percentageToUse).charAt(0)); } else if (percentageToUse == 100){ caseStatus = 4; amount = 10; } + else { + amount = 0; + } switch (caseStatus) { case 1: { return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dustTiny"+materialInput.unlocalizedName, amount); -- cgit From c430178cf2cc3590f8dd33a4e620369208e5412a Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Wed, 14 Sep 2016 19:13:00 +1000 Subject: $ Fixed Fluids properly and finally. $ Changed Alloy Boiling points. $ Rewrote the dust recipe handlers. --- .../gtPlusPlus/core/fluids/BlockFluidBase.java | 8 +- .../core/item/base/dusts/BaseItemDust.java | 147 ++++++++------------- src/Java/gtPlusPlus/core/material/ALLOY.java | 58 ++++---- src/Java/gtPlusPlus/core/material/Material.java | 8 ++ src/Java/gtPlusPlus/core/util/item/UtilsItems.java | 4 +- 5 files changed, 97 insertions(+), 128 deletions(-) (limited to 'src/Java/gtPlusPlus/core/material/Material.java') diff --git a/src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java b/src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java index 1e76e5d5e1..ebd84f9654 100644 --- a/src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java +++ b/src/Java/gtPlusPlus/core/fluids/BlockFluidBase.java @@ -32,7 +32,7 @@ public class BlockFluidBase extends BlockFluidClassic { short[] tempColour = material.getRGBA(); this.colour = Utils.rgbtoHexValue(tempColour[0], tempColour[1], tempColour[2]); this.fluidMaterial = material; - setCreativeTab(AddToCreativeTab.tabMisc); + setCreativeTab(AddToCreativeTab.tabOther); this.displayName = material.getLocalizedName(); LanguageRegistry.addName(this, "Molten "+displayName+" ["+MathUtils.celsiusToKelvin(fluidMaterial.getBoilingPoint_C())+"K]"); this.setBlockName(GetProperName()); @@ -43,7 +43,7 @@ public class BlockFluidBase extends BlockFluidClassic { super(fluid, net.minecraft.block.material.Material.water); short[] tempColour = colour; this.colour = Utils.rgbtoHexValue(tempColour[0], tempColour[1], tempColour[2]); - setCreativeTab(AddToCreativeTab.tabMisc); + setCreativeTab(AddToCreativeTab.tabOther); this.displayName = fluidName; LanguageRegistry.addName(this, "Molten "+displayName); this.setBlockName(GetProperName()); @@ -100,4 +100,8 @@ public class BlockFluidBase extends BlockFluidClassic { return tempIngot; } + public Material getFluidMaterial(){ + return fluidMaterial; + } + } diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java index b94b7759da..0342f7f104 100644 --- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java +++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java @@ -30,6 +30,7 @@ public class BaseItemDust extends Item{ String name = ""; private int mTier; private Material dustInfo; + private String oredictName; public BaseItemDust(String unlocalizedName, String materialName, Material matInfo, int colour, String pileSize, boolean blastFurnaceRequired, int tier, int sRadioactivity) { setUnlocalizedName(unlocalizedName); @@ -70,6 +71,7 @@ public class BaseItemDust extends Item{ Utils.LOG_WARNING("Generating OreDict Name: "+temp); } if (temp != null && temp != ""){ + oredictName = temp; GT_OreDictUnificator.registerOre(temp, UtilsItems.getSimpleStack(this)); } addMixerRecipe(); @@ -133,120 +135,75 @@ public class BaseItemDust extends Item{ private void addMixerRecipe(){ - ItemStack tempStack = UtilsItems.getSimpleStack(this); - ItemStack tempOutput = null; + + 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)}; - String temp = ""; - Utils.LOG_WARNING("Unlocalized name for OreDict nameGen: "+getUnlocalizedName()); - if (getUnlocalizedName().toLowerCase().contains("item.")){ - temp = getUnlocalizedName().replace("item.", ""); - Utils.LOG_WARNING("Generating OreDict Name: "+temp); - } - else { - temp = getUnlocalizedName(); - } - if (temp.toLowerCase().contains("dusttiny")){ - temp = temp.replace("itemDustTiny", "dust"); - Utils.LOG_WARNING("Generating OreDict Name: "+temp); + 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 (temp.toLowerCase().contains("dustsmall")){ - temp = temp.replace("itemDustSmall", "dust"); - Utils.LOG_WARNING("Generating OreDict Name: "+temp); + 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 { - temp = temp.replace("itemD", "d"); - Utils.LOG_WARNING("Generating OreDict Name: "+temp); - } - if (temp != null && temp != "" && !temp.equals("")){ + thisItem = normalDust; + } - if (getUnlocalizedName().toLowerCase().contains("dusttiny") || getUnlocalizedName().toLowerCase().contains("dustsmall")){ - tempOutput = UtilsItems.getItemStackOfAmountFromOreDict(temp, 1); - } - else { - if (outputStacks[0] != null){ - Utils.LOG_WARNING("Getting output dusts for mixer recipe. Checking ENUM, got: "+outputStacks[0].toString()); - tempOutput = outputStacks[0]; - } - else { - Utils.LOG_WARNING("Getting output dusts for mixer recipe. Enum check failed, failback item is: "+temp); - tempOutput = UtilsItems.getItemStackOfAmountFromOreDict(temp, 1); - } - } - - } - - if (tempOutput == null){ - tempOutput = dustInfo.getDust(1); - } - - if (tempOutput != null){ - if (getUnlocalizedName().contains("DustTiny")){ - Utils.LOG_WARNING("Generating a 9 Tiny dust to 1 Dust recipe for "+materialName); - UtilsRecipe.addShapelessGregtechRecipe(tempOutput, - tempStack, tempStack, tempStack, - tempStack, tempStack, tempStack, - tempStack, tempStack, tempStack); - } - else if (getUnlocalizedName().contains("DustSmall")){ - Utils.LOG_WARNING("Generating a 4 Small dust to 1 Dust recipe for "+materialName); - UtilsRecipe.addShapelessGregtechRecipe(tempOutput, - tempStack, tempStack, null, - tempStack, tempStack, null, - null, null, null); - } - else { - Utils.LOG_WARNING("Generating a Dust recipe for "+materialName+" in the mixer."); - - - int i = 0; - if (inputStacks.length >= 2){ - for (ItemStack is : inputStacks){ - if (is != null){ - Utils.LOG_WARNING("Found "+is.getDisplayName()+" as an input for mixer recipe."); - if (is.getDisplayName().toLowerCase().contains("tell alkalus")){ - ItemStack tempStackForAName = inputStacks[i]; - String[] inputList = UtilsItems.getArrayStackNamesAsArray(dustInfo.getMaterialComposites()); - int[] inputSizes = dustInfo.getMaterialCompositeStackSizes(); - inputStacks[i] = UtilsItems.getItemStackOfAmountFromOreDict(inputList[i], 1); - Utils.LOG_WARNING("Swapping input slot "+i+" which contains "+tempStackForAName.getDisplayName()+" with "+inputStacks[i].getDisplayName()+"."); - } - - } - - else { - Utils.LOG_WARNING("Input "+i+" was null."); - } - - i++; - } - } + 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, - tempOutput, + outputStacks, 8*mTier*20, 8*mTier*2); } else { return; } - - - - /*GT_Values.RA.addMixerRecipe( - GT_Utility.copyAmount(inputStacks[0].stackSize, new Object[]{inputStacks[0]}), GT_Utility.copyAmount(inputStacks[1].stackSize, new Object[]{inputStacks[1]}), - GT_Utility.copyAmount(inputStacks[2].stackSize, new Object[]{inputStacks[2]}), GT_Utility.copyAmount(inputStacks[3].stackSize, new Object[]{inputStacks[3]}), - null, null, - tempOutput, - 8*mTier*20, 8*mTier*2);*/ - } } - } 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 b46c84d2ba..a4cdd77d59 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 - 0, //Boiling Point in C + ((ELEMENT.URANIUM.getBoilingPoint_C()*9)+(ELEMENT.TITANIUM.getBoilingPoint_C()*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[]{66, 75, 166, 0}, //Material Colour 3025, //Melting Point in C - 0, //Boiling 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.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? @@ -58,7 +58,7 @@ public final class ALLOY { "Tantalloy-61", //Material Name new short[]{122, 135, 196, 0}, //Material Colour 3030, //Melting Point in C - 0, //Boiling 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.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? @@ -85,7 +85,7 @@ public final class ALLOY { "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 - 0, //Boiling Point in C + ((ELEMENT.TIN.getBoilingPoint_C()*1)+(ELEMENT.COPPER.getBoilingPoint_C()*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? @@ -99,7 +99,7 @@ public final class ALLOY { "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 - 0, //Boiling Point in C + ((ELEMENT.GOLD.getBoilingPoint_C()*7)+(ELEMENT.COPPER.getBoilingPoint_C()*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? @@ -113,7 +113,7 @@ public final class ALLOY { "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 - 0, //Boiling 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.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? @@ -139,7 +139,7 @@ public final class ALLOY { "Inconel-625", //Material Name new short[]{128, 200, 128, 0}, //Material Colour 1425, //Melting Point in C - 0, //Boiling 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.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? @@ -155,7 +155,7 @@ public final class ALLOY { "Inconel-690", //Material Name new short[]{118, 220, 138, 0}, //Material Colour 1425, //Melting Point in C - 0, //Boiling 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.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? @@ -171,7 +171,7 @@ public final class ALLOY { "Inconel-792", //Material Name new short[]{108, 240, 118, 0}, //Material Colour 1425, //Melting Point in C - 0, //Boiling 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.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? @@ -187,7 +187,7 @@ public final class ALLOY { "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 - 0, //Boiling Point in C + ((ELEMENT.CARBON.getBoilingPoint_C()*5)+(ELEMENT.IRON.getBoilingPoint_C()*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? @@ -200,8 +200,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 - 0, //Boiling Point in C + ((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.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? @@ -217,7 +217,7 @@ public final class ALLOY { "Maraging Steel 250", //Material Name new short[]{140, 140, 140, 0}, //Material Colour 1413, //Melting Point in C - 0, //Boiling 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.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? @@ -233,7 +233,7 @@ public final class ALLOY { "Maraging Steel 300", //Material Name new short[]{150, 150, 150, 0}, //Material Colour 1413, //Melting Point in C - 0, //Boiling 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.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? @@ -249,7 +249,7 @@ public final class ALLOY { "Maraging Steel 350", //Material Name new short[]{160, 160, 160, 0}, //Material Colour 1413, //Melting Point in C - 0, //Boiling 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.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? @@ -265,7 +265,7 @@ public final class ALLOY { "Stellite", //Material Name new short[]{129, 75, 120, 0}, //Material Colour 1310, //Melting Point in C - 0, //Boiling 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.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? @@ -281,7 +281,7 @@ public final class ALLOY { "Talonite", //Material Name new short[]{228, 75, 120, 0}, //Material Colour 1454, //Melting Point in C - 0, //Boiling 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.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? @@ -297,7 +297,7 @@ public final class ALLOY { "Hastelloy-W", //Material Name new short[]{218, 165, 32, 0}, //Material Colour 1350, //Melting Point in C - 0, //Boiling 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.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? @@ -313,7 +313,7 @@ public final class ALLOY { "Hastelloy-X", //Material Name new short[]{255, 193, 37, 0}, //Material Colour 1350, //Melting Point in C - 0, //Boiling 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.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? @@ -329,7 +329,7 @@ public final class ALLOY { "Hastelloy-N", //Material Name new short[]{236, 213, 48, 0}, //Material Colour 1350, //Melting Point in C - 0, //Boiling 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.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? @@ -345,7 +345,7 @@ public final class ALLOY { "Hastelloy-C276", //Material Name new short[]{238, 180, 34, 0}, //Material Colour 1350, //Melting Point in C - 0, //Boiling 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.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? @@ -361,7 +361,7 @@ public final class ALLOY { "Incoloy-020", //Material Name new short[]{101, 81, 71, 0}, //Material Colour 1425, //Melting Point in C - 0, //Boiling 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.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? @@ -377,7 +377,7 @@ public final class ALLOY { "Incoloy-DS", //Material Name new short[]{71, 101, 81, 0}, //Material Colour 1425, //Melting Point in C - 0, //Boiling 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.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? @@ -393,7 +393,7 @@ public final class ALLOY { "Incoloy-MA956", //Material Name new short[]{81, 71, 101, 0}, //Material Colour 1425, //Melting Point in C - 0, //Boiling 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.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? @@ -409,7 +409,7 @@ public final class ALLOY { "Tungsten Carbide", //Material Name new short[]{44, 44, 44, 0}, //Material Colour 3422, //Melting Point in C - 0, //Boiling Point in C + ((ELEMENT.TUNGSTEN.getBoilingPoint_C()*5)+(ELEMENT.CARBON.getBoilingPoint_C()*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? @@ -423,7 +423,7 @@ public final class ALLOY { "Silicon Carbide", //Material Name new short[]{40, 48, 36, 0}, //Material Colour 1414, //Melting Point in C - 0, //Boiling Point in C + ((ELEMENT.SILICON.getBoilingPoint_C()*5)+(ELEMENT.CARBON.getBoilingPoint_C()*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? @@ -437,7 +437,7 @@ public final class ALLOY { "Tantalum Carbide", //Material Name new short[]{139, 136, 120, 0}, //Material Colour 2980, //Melting Point in C - 0, //Boiling Point in C + ((ELEMENT.TANTALUM.getBoilingPoint_C()*5)+(ELEMENT.CARBON.getBoilingPoint_C()*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? @@ -451,7 +451,7 @@ public final class ALLOY { "Zirconium Carbide", //Material Name new short[]{222, 202, 180, 0}, //Material Colour 1855, //Melting Point in C - 0, //Boiling Point in C + ((ELEMENT.ZIRCONIUM.getBoilingPoint_C()*5)+(ELEMENT.CARBON.getBoilingPoint_C()*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? @@ -465,7 +465,7 @@ public final class ALLOY { "Niobium Carbide", //Material Name new short[]{205, 197, 191, 0}, //Material Colour 2477, //Melting Point in C - 0, //Boiling Point in C + ((ELEMENT.NIOBIUM.getBoilingPoint_C()*5)+(ELEMENT.CARBON.getBoilingPoint_C()*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/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index 857e403ada..2939016798 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -100,6 +100,14 @@ public class Material { public ItemStack getDust(int stacksize){ return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dust"+unlocalizedName, stacksize); } + + public ItemStack getSmallDust(int stacksize){ + return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dustSmall"+unlocalizedName, stacksize); + } + + public ItemStack getTinyDust(int stacksize){ + return UtilsItems.getItemStackOfAmountFromOreDictNoBroken("dustTiny"+unlocalizedName, stacksize); + } public ItemStack[] getValidInputStacks(){ return UtilsItems.validItemsForOreDict(unlocalizedName); diff --git a/src/Java/gtPlusPlus/core/util/item/UtilsItems.java b/src/Java/gtPlusPlus/core/util/item/UtilsItems.java index 877f75cea6..7a70b41f96 100644 --- a/src/Java/gtPlusPlus/core/util/item/UtilsItems.java +++ b/src/Java/gtPlusPlus/core/util/item/UtilsItems.java @@ -256,7 +256,7 @@ public class UtilsItems { if (returnValue.getItem().getClass() != ModItems.AAA_Broken.getClass() || returnValue.getItem() != ModItems.AAA_Broken){ return returnValue; } - + Utils.LOG_INFO(oredictName+" was not valid."); return null; } @@ -320,7 +320,7 @@ public class UtilsItems { temp = new BaseItemGear("itemGear"+unlocalizedName, materialName, Colour, materialTier); } - FluidUtils.generateFluid(matInfo, sRadiation); + FluidUtils.generateFluid(matInfo, 1); } -- cgit