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 ++--- 2 files changed, 49 insertions(+), 43 deletions(-) (limited to 'src/Java/gtPlusPlus/core/item') 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); -- cgit From 2d5bc4bf0e324979c58ed8b35283a2a78b50ad01 Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Wed, 14 Sep 2016 03:06:05 +1000 Subject: More Work clearing up Nulls. Making more things final and accessible to others. --- src/Java/gtPlusPlus/core/item/ModItems.java | 72 ++++++++++++---------- .../core/item/base/dusts/BaseItemDust.java | 37 ++++++++--- 2 files changed, 68 insertions(+), 41 deletions(-) (limited to 'src/Java/gtPlusPlus/core/item') 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; -- cgit From 3ebad08c9f1c0ebe1150e2a9db332f4ea476cc33 Mon Sep 17 00:00:00 2001 From: Draknyte1 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 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/Java/gtPlusPlus/core/item') 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); -- 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. --- .../core/item/base/dusts/BaseItemDust.java | 147 ++++++++------------- 1 file changed, 52 insertions(+), 95 deletions(-) (limited to 'src/Java/gtPlusPlus/core/item') 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"); -- cgit From 2def9acccdf30a88947943673fcd695f1e59cb77 Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Thu, 15 Sep 2016 14:12:33 +1000 Subject: $ Fixed the Skookum Choocher. $ Now it Renders properly and functions as a GT-esque type tool. - Removed static calls to excluded build classes. % Started changing things to final in all cases. (Apparently better Java practice) --- src/Java/gtPlusPlus/core/item/ModItems.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/Java/gtPlusPlus/core/item') diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index 5cfeb83425..0950a9a4c0 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -34,6 +34,7 @@ import gtPlusPlus.core.util.item.UtilsItems; import net.minecraft.item.Item; import net.minecraft.item.Item.ToolMaterial; import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.EnumHelper; import cpw.mods.fml.common.registry.GameRegistry; public final class ModItems { @@ -107,7 +108,9 @@ public final class ModItems { public static Item itemPersonalCloakingDeviceCharged; public static Item itemPersonalHealingDevice; - public static MultiPickaxeBase MP_GTMATERIAL; + public static MultiPickaxeBase MP_GTMATERIAL; + + public static ItemStack FluidCell; public static BaseItemBackpack backpack_Red; public static BaseItemBackpack backpack_Green; @@ -398,6 +401,10 @@ public final class ModItems { //GameRegistry.registerItem(FuelRod_Thorium, "itemFuelRod_Thorium"); //GameRegistry.registerItem(FuelRod_Uranium, "itemFuelRod_Uranium"); //GameRegistry.registerItem(FuelRod_Plutonium, "itemFuelRod_Plutonium"); + + //FluidCell = new ItemStack(new IC2_ItemFluidCell("itemGT++FluidCell")); + + } else { Utils.LOG_WARNING("IndustrialCraft2 not Found - Skipping Resources."); -- cgit From a3aa117da7b7daedff109f826ec1e95cafaaad03 Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Thu, 15 Sep 2016 15:50:54 +1000 Subject: $ Fixed the Skookum Choocher, not it: > Behaves like a wrench unless you hold shift > While shift is held, it prospects like a Hard Hammer. > It functions as a wrench when mining machines and a Hard Hammer when mining anything else. > There are over 100 types available from GT's materials. + Added in the FluidItemBlock.class --- .../core/item/base/itemblock/ItemBlockFluid.java | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockFluid.java (limited to 'src/Java/gtPlusPlus/core/item') diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockFluid.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockFluid.java new file mode 100644 index 0000000000..77af69f809 --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockFluid.java @@ -0,0 +1,78 @@ +package gtPlusPlus.core.item.base.itemblock; + +import gtPlusPlus.core.fluids.BlockFluidBase; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.Material; +import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.math.MathUtils; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +public class ItemBlockFluid extends ItemBlock{ + + protected final int blockColour; + protected final int sRadiation; + protected Material thisFluid; + final BlockFluidBase baseBlock; + String name; + + public ItemBlockFluid(Block block) { + super(block); + this.baseBlock = (BlockFluidBase) block; + this.blockColour = baseBlock.getRenderColor(1); + this.thisFluid = baseBlock.getFluidMaterial(); + this.sRadiation=UtilsItems.getRadioactivityLevel(baseBlock.getUnlocalizedName()); + this.name = baseBlock.getLocalizedName().replace("tile", "").replace("fluid", "").replace("name", "").replace("block", "").replace(".", ""); + //GT_OreDictUnificator.registerOre("frameGt"+block.getUnlocalizedName().replace("tile.", "").replace("tile.BlockGtFrame", "").replace("-", "").replace("_", "").replace(" ", "").replace("FrameBox", ""), UtilsItems.getSimpleStack(this)); + } + + public final Material setFluidMaterial(Material M){ + return thisFluid=M; + } + + public int getRenderColor(int aMeta) { + return blockColour; + } + + @Override + public String getItemStackDisplayName(ItemStack iStack) { + if (thisFluid != null){ + this.name = "Molten "+thisFluid.getLocalizedName(); + return name; + } + this.name = "Molten "+baseBlock.getLocalizedName().replace("tile", "").replace("fluid", "").replace("name", "").replace("block", "").replace(".", ""); + return name; + } + + @Override + public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) { + if (blockColour == 0){ + return MathUtils.generateSingularRandomHexValue(); + } + return blockColour; + + } + + @Override + public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) { + list.add("Temperature: "+MathUtils.celsiusToKelvin(thisFluid.getMeltingPoint_C())+"K"); + if (sRadiation > 0){ + list.add(CORE.GT_Tooltip_Radioactive); + } + super.addInformation(stack, aPlayer, list, bool); + } + + public String GetProperName() { + String tempIngot; + + tempIngot = "Molten "+baseBlock.getLocalizedName(); + + return tempIngot; + } + +} -- cgit From 478492d458f293f12544969c472b64e12dcd4e52 Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Sat, 17 Sep 2016 17:29:24 +1000 Subject: [1.4.8-prerelease] % Changed a few instances of ++ to plusplus. --- src/Java/gtPlusPlus/core/item/ModItems.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/Java/gtPlusPlus/core/item') diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index 0950a9a4c0..1737b6ea4a 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -211,9 +211,7 @@ public final class ModItems { generateItemsFromMaterial(ELEMENT.ZIRCONIUM); generateItemsFromMaterial(ALLOY.ZIRCONIUM_CARBIDE); generateItemsFromMaterial(ALLOY.TANTALUM_CARBIDE); - generateItemsFromMaterial(ALLOY.NIOBIUM_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); -- cgit