diff options
author | Jordan Byrne <draknyte1@hotmail.com> | 2017-12-18 13:22:13 +1000 |
---|---|---|
committer | Jordan Byrne <draknyte1@hotmail.com> | 2017-12-18 13:22:13 +1000 |
commit | b9fe3352840abe0846834cefd578895ec6f5e520 (patch) | |
tree | 416885a2c65de3ee61b6bccc4f128f197c92464a /src | |
parent | 86dac7e948cff5c9b975ff86fef149377285eab8 (diff) | |
download | GT5-Unofficial-b9fe3352840abe0846834cefd578895ec6f5e520.tar.gz GT5-Unofficial-b9fe3352840abe0846834cefd578895ec6f5e520.tar.bz2 GT5-Unofficial-b9fe3352840abe0846834cefd578895ec6f5e520.zip |
+ Added Trinium and Trinium related Alloys.
+ Added more recycling recipes.
$ Fixed bad materials in component assembler recipes.
Diffstat (limited to 'src')
10 files changed, 192 insertions, 39 deletions
diff --git a/src/Java/gtPlusPlus/GTplusplus.java b/src/Java/gtPlusPlus/GTplusplus.java index 5306b2610c..6d28dd3662 100644 --- a/src/Java/gtPlusPlus/GTplusplus.java +++ b/src/Java/gtPlusPlus/GTplusplus.java @@ -41,7 +41,7 @@ import net.minecraft.launchwrapper.Launch; import net.minecraftforge.oredict.OreDictionary; @MCVersion(value = "1.7.10") -@Mod(modid = CORE.MODID, name = CORE.name, version = CORE.VERSION, dependencies = "required-after:Forge; after:PlayerAPI; after:dreamcraft; after:IC2; after:ihl; after:psychedelicraft; after:gregtech; after:Forestry; after:MagicBees; after:CoFHCore; after:Growthcraft; after:Railcraft; after:CompactWindmills; after:ForbiddenMagic; after:MorePlanet; after:PneumaticCraft; after:ExtraUtilities; after:Thaumcraft; after:rftools; after:simplyjetpacks; after:BigReactors; after:EnderIO; after:tectech; after:GTRedtech; beyondrealitycore;") +@Mod(modid = CORE.MODID, name = CORE.name, version = CORE.VERSION, dependencies = "required-after:Forge; after:PlayerAPI; after:dreamcraft; after:IC2; after:ihl; after:psychedelicraft; after:gregtech; after:Forestry; after:MagicBees; after:CoFHCore; after:Growthcraft; after:Railcraft; after:CompactWindmills; after:ForbiddenMagic; after:MorePlanet; after:PneumaticCraft; after:ExtraUtilities; after:Thaumcraft; after:rftools; after:simplyjetpacks; after:BigReactors; after:EnderIO; after:tectech; after:GTRedtech; after:beyondrealitycore;") public class GTplusplus implements ActionListener { //Mod Instance diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index bdb1837aa1..387315a885 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -439,7 +439,6 @@ public final class ModItems { MaterialGenerator.generateNuclearMaterial(NUCLIDE.LiFBeF2ZrF4UF4); MaterialGenerator.generateNuclearMaterial(NUCLIDE.LiFBeF2ThF4UF4); - //Generate some Alloys //Misc Alloys @@ -491,6 +490,12 @@ public final class ModItems { //Super Conductor MaterialGenerator.generate(ALLOY.HG1223, false, false); + //Generate Fictional Materials + MaterialGenerator.generate(ELEMENT.getInstance().TRINIUM, false); + MaterialGenerator.generate(ELEMENT.getInstance().TRINIUM_REFINED, false); + MaterialGenerator.generate(ALLOY.TRINIUM_TITANIUM); + MaterialGenerator.generate(ALLOY.TRINIUM_NAQUADAH, false); + MaterialGenerator.generate(ALLOY.TRINIUM_NAQUADAH_CARBON); //Must be the final Alloy to Generate MaterialGenerator.generate(ALLOY.QUANTUM); diff --git a/src/Java/gtPlusPlus/core/material/ALLOY.java b/src/Java/gtPlusPlus/core/material/ALLOY.java index 7488a3e0ae..8d1d4e5ecd 100644 --- a/src/Java/gtPlusPlus/core/material/ALLOY.java +++ b/src/Java/gtPlusPlus/core/material/ALLOY.java @@ -5,7 +5,7 @@ import gtPlusPlus.core.material.state.MaterialState; import gtPlusPlus.core.util.materials.MaterialUtils; public final class ALLOY { - + //Just some GT Alloys that I need within mine. public static final Material BRONZE = MaterialUtils.generateMaterialFromGtENUM(Materials.Bronze); public static final Material STEEL = MaterialUtils.generateMaterialFromGtENUM(Materials.Steel); @@ -528,7 +528,7 @@ public final class ALLOY { new MaterialStack(MaterialUtils.generateMaterialFromGtENUM(Materials.Kanthal), 3), new MaterialStack(MaterialUtils.generateMaterialFromGtENUM(Materials.Invar), 15) }); - + public static final Material EGLIN_STEEL = new Material( "Eglin Steel", //Material Name MaterialState.SOLID, //State @@ -564,8 +564,49 @@ public final class ALLOY { }); + /** + * Stargate Materials - #D2FFA9 210, 255, 170 + */ - + public static final Material TRINIUM_TITANIUM = new Material( + "Trinium Titanium Alloy", //Material Name + MaterialState.SOLID, //State + new short[]{239,210,200, 0}, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, + -1, + true, //Uses Blast furnace? + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().TRINIUM_REFINED, 3), + new MaterialStack(ELEMENT.getInstance().TITANIUM, 7) + }); + public static final Material TRINIUM_NAQUADAH = new Material( + "Trinium Naquadah Alloy", //Material Name + MaterialState.SOLID, //State + new short[]{255, 243, 117, 0}, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, + -1, + true, //Uses Blast furnace? + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().TRINIUM_REFINED, 5), + new MaterialStack(ELEMENT.getInstance().NAQUADAH, 9) + }); + public static final Material TRINIUM_NAQUADAH_CARBON = new Material( + "Trinium Naquadah Carbonite", //Material Name + MaterialState.SOLID, //State + new short[]{255, 233, 0, 0}, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, + -1, + true, //Uses Blast furnace? + new MaterialStack[]{ + new MaterialStack(TRINIUM_NAQUADAH, 9), + new MaterialStack(ELEMENT.getInstance().CARBON, 1) + }); diff --git a/src/Java/gtPlusPlus/core/material/ELEMENT.java b/src/Java/gtPlusPlus/core/material/ELEMENT.java index 60a27a8769..859ebd86cf 100644 --- a/src/Java/gtPlusPlus/core/material/ELEMENT.java +++ b/src/Java/gtPlusPlus/core/material/ELEMENT.java @@ -128,4 +128,10 @@ public final class ELEMENT { public final Material IGNIS = MaterialUtils.generateMaterialFromGtENUM(Materials.InfusedFire); public final Material TERRA = MaterialUtils.generateMaterialFromGtENUM(Materials.InfusedEarth); public final Material AQUA = MaterialUtils.generateMaterialFromGtENUM(Materials.InfusedWater); + + //Fictional + public final Material NAQUADAH = MaterialUtils.generateMaterialFromGtENUM(Materials.Naquadah); + public final Material TRINIUM = new Material("Trinium", MaterialState.SOLID, new short[]{170, 210, 130}, 604, 4057, 181, 133, false, "Ke", 0, false);//Not a GT Inherited Material + public final Material TRINIUM_REFINED = new Material("Refined Trinium", MaterialState.SOLID, new short[]{210, 255, 170}, 4304, 14057, 181, 133, false, "Ke", 0, new MaterialStack[]{new MaterialStack(TRINIUM, 1)});//Not a GT Inherited Material + //https://github.com/Blood-Asp/GT5-Unofficial/issues/609 } diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index c25b818aa2..40d8461209 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -28,6 +28,8 @@ public class Material { private final Fluid vMoltenFluid; private final Fluid vPlasma; + + private final boolean vGenerateCells; protected Object dataVar = MathUtils.generateSingularRandomHexValue(); @@ -72,14 +74,23 @@ public class Material { public Material(final String materialName, final MaterialState defaultState,final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final String chemicalSymbol, final int radiationLevel, final MaterialStack... inputs){ this(materialName, defaultState, 0, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, chemicalSymbol, radiationLevel, inputs); + } + + public Material(final String materialName, final MaterialState defaultState,final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final String chemicalSymbol, final int radiationLevel, boolean addCells,final MaterialStack... inputs) { + this (materialName, defaultState, 0, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, chemicalSymbol, radiationLevel, addCells, inputs); } public Material(final String materialName, final MaterialState defaultState, final long durability, final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final String chemicalSymbol, final int radiationLevel, final MaterialStack... inputs){ + this (materialName, defaultState, durability, rgba, meltingPoint, boilingPoint, protons, neutrons, blastFurnace, chemicalSymbol, radiationLevel, true, inputs); + } + + public Material(final String materialName, final MaterialState defaultState, final long durability, final short[] rgba, final int meltingPoint, final int boilingPoint, final long protons, final long neutrons, final boolean blastFurnace, final String chemicalSymbol, final int radiationLevel, boolean generateCells, final MaterialStack... inputs){ this.unlocalizedName = Utils.sanitizeString(materialName); this.localizedName = materialName; this.materialState = defaultState; this.RGBA = rgba; + this.vGenerateCells = generateCells; //Add Components to an array. if (inputs == null){ @@ -600,10 +611,10 @@ public class Material { Utils.LOG_WARNING("Generating our own fluid."); //Generate a Cell if we need to - if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+this.getUnlocalizedName(), 1) == null){ - @SuppressWarnings("unused") - final - Item temp = new BaseItemCell(this); + if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+this.getUnlocalizedName(), 1) == null){ + if (this.vGenerateCells){ + final Item temp = new BaseItemCell(this); + } } if (this.materialState == MaterialState.SOLID){ @@ -656,6 +667,11 @@ public class Material { return isValid.mPlasma; } } + + if (this.vGenerateCells){ + return null; + } + Utils.LOG_WARNING("Generating our own Plasma."); return FluidUtils.addGTPlasma(this); //return null; diff --git a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java index 6e529b3e92..65c0f1e6c0 100644 --- a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java +++ b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java @@ -102,10 +102,9 @@ public class MaterialGenerator { } } else { Item temp; - if (generateEverything == true){ - Block tempBlock; - tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.STANDARD, Colour); - } + Block tempBlock; + tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.STANDARD, Colour); + temp = new BaseItemIngot(matInfo); temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", materialTier, sRadiation); temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", materialTier, sRadiation); @@ -145,7 +144,7 @@ public class MaterialGenerator { RecipeGen_Fluids.generateRecipes(matInfo); RecipeGen_Plates.generateRecipes(matInfo); RecipeGen_ShapedCrafting.generateRecipes(matInfo); - RecipeGen_Recycling.generateRecipes(matInfo); + new RecipeGen_Recycling(matInfo); return true; } catch (final Throwable t) { @@ -218,7 +217,7 @@ public class MaterialGenerator { RecipeGen_Fluids.generateRecipes(matInfo); RecipeGen_Assembler.generateRecipes(matInfo); RecipeGen_DustGeneration.generateRecipes(matInfo, true); - RecipeGen_Recycling.generateRecipes(matInfo); + new RecipeGen_Recycling(matInfo); } catch (final Throwable t){ Utils.LOG_INFO(""+matInfo.getLocalizedName()+" failed to generate."); } diff --git a/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java b/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java index 3e79d46c19..66c991ce99 100644 --- a/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java +++ b/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java @@ -82,7 +82,7 @@ public class MaterialUtils { if (hasValidRGBA(rgba) || (element == Element.H) || ((material == Materials.InfusedAir) || (material == Materials.InfusedFire) || (material == Materials.InfusedEarth) || (material == Materials.InfusedWater))){ //ModItems.itemBaseDecidust = UtilsItems.generateDecidust(material); //ModItems.itemBaseCentidust = UtilsItems.generateCentidust(material); - return new Material(name, materialState, durability, rgba, melting, boiling, protons, neutrons, blastFurnace, chemicalFormula, radioactivity); + return new Material(name, materialState, durability, rgba, melting, boiling, protons, neutrons, blastFurnace, chemicalFormula, radioactivity, false); } return null; diff --git a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java index f88f8e32e0..5f7a60f546 100644 --- a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java +++ b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java @@ -95,7 +95,7 @@ public class ReflectionUtils { public static String getMethodName(final int depth) { final StackTraceElement[] ste = new Throwable().getStackTrace(); //System. out.println(ste[ste.length-depth].getClassName()+"#"+ste[ste.length-depth].getMethodName()); - return ste[depth].getMethodName(); + return ste[depth+1].getMethodName(); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java index f7e294ad0b..d0651f783c 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java @@ -7,30 +7,40 @@ import java.util.Map; import org.apache.commons.lang3.reflect.FieldUtils; +import gregtech.api.enums.GT_Values; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.material.Material; +import gtPlusPlus.core.material.state.MaterialState; import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.array.Pair; import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; public class RecipeGen_Recycling implements Runnable { final Material toGenerate; - static Map mNameMap; + public static Map<String, ItemStack> mNameMap; public RecipeGen_Recycling(final Material M) { this.toGenerate = M; - mNameMap = this.getNameMap(); + if (mNameMap == null){ + mNameMap = this.getNameMap(); + } + if (mNameMap != null){ + generateRecipes(this.toGenerate); + } } @Override public void run() { - generateRecipes(this.toGenerate); + } public static void generateRecipes(final Material material) { @@ -46,14 +56,20 @@ public class RecipeGen_Recycling implements Runnable { Utils.LOG_INFO("Found " + mValidPrefixesAsString.length + " valid OreDict prefixes."); if (mValidPrefixesAsString.length >= 1) { for (final OrePrefixes validPrefix : mValidPrefixesAsString) { - try { - final ItemStack tempStack = ItemUtils - .getItemStackOfAmountFromOreDict(validPrefix + material.getLocalizedName(), 1); - - if ((tempStack != null) && (tempStack != ItemUtils.getSimpleStack(ModItems.AAA_Broken))) { + + if (material.getState() != MaterialState.SOLID){ + continue; + } + + final ItemStack tempStack = get(validPrefix, material, 1); + final ItemStack mDust = getDust(material, validPrefix); + final Pair<OrePrefixes, ItemStack> mData = getDustData(material, validPrefix); + int mFluidAmount = (int) GT_Utility.translateMaterialToFluidAmount(mData.getKey().mMaterialAmount, true); + + //Maceration + if (tempStack != null) { // mValidItems[mSlotIndex++] = tempStack; - final ItemStack mDust = getDust(material, validPrefix); if ((mDust != null) && GT_ModHandler.addPulverisationRecipe(tempStack, mDust)) { Utils.LOG_INFO("Recycle Recipe: " + material.getLocalizedName() + " - Success - Recycle " + tempStack.getDisplayName() + " and obtain " + mDust.getDisplayName()); @@ -65,9 +81,30 @@ public class RecipeGen_Recycling implements Runnable { } } } + + //Arc Furnace + if (tempStack != null) { + + } + + //Fluid Extractor + if (tempStack != null) { + // mValidItems[mSlotIndex++] = tempStack; + if ((mDust != null) && GT_Values.RA.addFluidExtractionRecipe(tempStack, null, material.getFluid(mFluidAmount), 0, 30, 8)) { + Utils.LOG_INFO("Recycle Recipe: " + material.getLocalizedName() + " - Success - Recycle " + + tempStack.getDisplayName() + " and obtain " + mDust.getDisplayName()); + } + else { + Utils.LOG_INFO("Recycle Recipe: " + material.getLocalizedName() + " - Failed"); + if (mDust == null) { + Utils.LOG_INFO("Invalid Dust output."); + } + } + } + } catch (final Throwable t) { - // t.printStackTrace(); + t.printStackTrace(); // Utils.LOG_INFO("Returning Null. Throwable Info: // "+t.getMessage()); // Utils.LOG_INFO("Throwable Info: "+t.toString()); @@ -79,28 +116,69 @@ public class RecipeGen_Recycling implements Runnable { } } + public static Pair<OrePrefixes, ItemStack> getDustData(final Material aMaterial, final OrePrefixes aPrefix) { + return getDustData(aMaterial, aPrefix.mMaterialAmount); + } + + public static Pair<OrePrefixes, ItemStack> getDustData(final Material aMaterial, final long aMaterialAmount) { + ItemStack mDust = null; + OrePrefixes mPrefix = null; + + if (aMaterial == null || aMaterialAmount <= 0) { + return null; + } + if ((((aMaterialAmount % M) == 0) || (aMaterialAmount >= (M * 16)))) { + mDust = get(OrePrefixes.dust, aMaterial, aMaterialAmount / M); + mPrefix = OrePrefixes.dust; + } + if ((mDust == null) && ((((aMaterialAmount * 4) % M) == 0) || (aMaterialAmount >= (M * 8)))) { + mDust = get(OrePrefixes.dustSmall, aMaterial, (aMaterialAmount * 4) / M); + mPrefix = OrePrefixes.dustSmall; + } + if ((mDust == null) && (((aMaterialAmount * 9) >= M))) { + mDust = get(OrePrefixes.dustTiny, aMaterial, (aMaterialAmount * 9) / M); + mPrefix = OrePrefixes.dustTiny; + } + + if (mPrefix != null && mDust != null){ + Utils.LOG_INFO("Built valid dust pair."); + return new Pair<OrePrefixes, ItemStack>(mPrefix, mDust); + } + else { + Utils.LOG_INFO("mPrefix: "+(mPrefix!=null)); + Utils.LOG_INFO("mDust: "+(mDust!=null)); + } + Utils.LOG_INFO("Failed to build valid dust pair."); + return null; + } + public static ItemStack getDust(final Material aMaterial, final OrePrefixes aPrefix) { return aMaterial == null ? null : getDust(aMaterial, aPrefix.mMaterialAmount); } - + public static ItemStack getDust(final Material aMaterial, final long aMaterialAmount) { if (aMaterialAmount <= 0) { return null; } ItemStack rStack = null; if ((((aMaterialAmount % M) == 0) || (aMaterialAmount >= (M * 16)))) { + Utils.LOG_INFO("Trying to get a Dust"); rStack = get(OrePrefixes.dust, aMaterial, aMaterialAmount / M); } if ((rStack == null) && ((((aMaterialAmount * 4) % M) == 0) || (aMaterialAmount >= (M * 8)))) { + Utils.LOG_INFO("Trying to get a Small Dust"); rStack = get(OrePrefixes.dustSmall, aMaterial, (aMaterialAmount * 4) / M); } if ((rStack == null) && (((aMaterialAmount * 9) >= M))) { + Utils.LOG_INFO("Trying to get a Tiny Dust"); rStack = get(OrePrefixes.dustTiny, aMaterial, (aMaterialAmount * 9) / M); } if (rStack == null) { Utils.LOG_INFO("Returning Null. Method: " + ReflectionUtils.getMethodName(0)); Utils.LOG_INFO("Called from method: " + ReflectionUtils.getMethodName(1)); Utils.LOG_INFO("Called from method: " + ReflectionUtils.getMethodName(2)); + Utils.LOG_INFO("Called from method: " + ReflectionUtils.getMethodName(3)); + Utils.LOG_INFO("Called from method: " + ReflectionUtils.getMethodName(4)); } return rStack; @@ -114,18 +192,13 @@ public class RecipeGen_Recycling implements Runnable { return get(aName, aReplacement, aAmount, true, true); } - public static ItemStack get(final OrePrefixes aPrefix, final Object aMaterial, final long aAmount) { + public static ItemStack get(final OrePrefixes aPrefix, final Material aMaterial, final long aAmount) { return get(aPrefix, aMaterial, null, aAmount); } - public static ItemStack get(final OrePrefixes aPrefix, final Object aMaterial, final ItemStack aReplacement, + public static ItemStack get(final OrePrefixes aPrefix, final Material aMaterial, final ItemStack aReplacement, final long aAmount) { - /* - * if (OrePrefixes.mPreventableComponents.contains(aPrefix) && - * aPrefix.mDisabledItems.contains(aMaterial)) { return aReplacement; - * //TODO } - */ - return get(aPrefix.get(aMaterial), aReplacement, aAmount, false, true); + return get(aPrefix.name()+Utils.sanitizeString(aMaterial.getLocalizedName()), aReplacement, aAmount, false, true); } public static ItemStack get(final Object aName, final ItemStack aReplacement, final long aAmount, @@ -134,6 +207,8 @@ public class RecipeGen_Recycling implements Runnable { Utils.LOG_INFO("Returning Null. Method: " + ReflectionUtils.getMethodName(0)); Utils.LOG_INFO("Called from method: " + ReflectionUtils.getMethodName(1)); Utils.LOG_INFO("Called from method: " + ReflectionUtils.getMethodName(2)); + Utils.LOG_INFO("Called from method: " + ReflectionUtils.getMethodName(3)); + Utils.LOG_INFO("Called from method: " + ReflectionUtils.getMethodName(4)); return null; } if (!mNameMap.containsKey(aName.toString()) && aMentionPossibleTypos) { @@ -148,10 +223,13 @@ public class RecipeGen_Recycling implements Runnable { Utils.LOG_INFO("Returning Null. Method: " + ReflectionUtils.getMethodName(0)); Utils.LOG_INFO("Called from method: " + ReflectionUtils.getMethodName(1)); Utils.LOG_INFO("Called from method: " + ReflectionUtils.getMethodName(2)); + Utils.LOG_INFO("Called from method: " + ReflectionUtils.getMethodName(3)); + Utils.LOG_INFO("Called from method: " + ReflectionUtils.getMethodName(4)); return null; } final ItemStack tStack = (ItemStack) mNameMap.get(aName.toString()); if (GT_Utility.isStackValid(tStack)) { + Utils.LOG_INFO("Found valid stack."); return GT_Utility.copyAmount(aAmount, new Object[] { tStack }); } return GT_Utility.copyAmount(aAmount, getOres(aName).toArray()); @@ -161,17 +239,25 @@ public class RecipeGen_Recycling implements Runnable { final String aName = (aOreName == null) ? "" : aOreName.toString(); final ArrayList<ItemStack> rList = new ArrayList<ItemStack>(); if (GT_Utility.isStringValid(aName)) { - rList.addAll(getOres(aName)); + Utils.LOG_INFO("Making a list of all OreDict entries for "+aOreName+"."); + if (rList.addAll(OreDictionary.getOres(aName))){ + Utils.LOG_INFO("Added "+rList.size()+" elements to list."); + } + else { + Utils.LOG_INFO("Failed to Add Collection from oreDictionary, forcing an entry."); + rList.add(ItemUtils.getItemStackOfAmountFromOreDict((String) aOreName, 1)); + } } return rList; } - public Map getNameMap() { + public Map<String, ItemStack> getNameMap() { Map<String, ItemStack> tempMap; try { tempMap = (Map<String, ItemStack>) FieldUtils.readStaticField(GT_OreDictUnificator.class, "sName2StackMap", true); if (tempMap != null) { + Utils.LOG_INFO("Found 'sName2StackMap' in GT_OreDictUnificator.class."); return tempMap; } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java index 86ce88311e..33e17c8c0e 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java @@ -241,7 +241,7 @@ public class GregtechComponentAssembler { private static boolean addRecipePump(int tier, Materials main, Materials pipe, Materials cable) { try { - ItemStack cableStack = ItemUtils.getGregtechOreStack(OrePrefixes.cableGt01, main, 1); + ItemStack cableStack = ItemUtils.getGregtechOreStack(OrePrefixes.cableGt01, cable, 1); ItemStack screwStack = ItemUtils.getGregtechOreStack(OrePrefixes.screw, main, 1); ItemStack rotorStack = ItemUtils.getGregtechOreStack(OrePrefixes.rotor, main, 1); ItemStack pipeStack = ItemUtils.getGregtechOreStack(OrePrefixes.pipeMedium, pipe, 1); |