diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2018-12-24 03:59:59 +0000 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2018-12-24 03:59:59 +0000 |
commit | 12dab5d109ac81034fd0a8fe18317024a996af61 (patch) | |
tree | c08e9a305f081fef24df556126be744d19f4c0f8 /src/Java/gtPlusPlus/xmod/gregtech/loaders | |
parent | c1606dd2997151dbf09797092a04294230d42059 (diff) | |
download | GT5-Unofficial-12dab5d109ac81034fd0a8fe18317024a996af61.tar.gz GT5-Unofficial-12dab5d109ac81034fd0a8fe18317024a996af61.tar.bz2 GT5-Unofficial-12dab5d109ac81034fd0a8fe18317024a996af61.zip |
+ Added a config option to adjust the Turbine Rotor removal cut-off point.
+ Added some new Bags/Packs for various things. An Automatic Lunchbox, a Tool Box and a Magicians Satchel.
+ Added full compound of Eglin Steel to ABS. Closes #392.
- Removed all Multi-Tools.
$ Rewrote and Fixed the recipe system. All recipes are queued regardless of when called, then created during the end of the POST_INIT load phase. Fixes too many bugs to list. (Few more to do before tomorrow)
$ Fixed COFH Hard requirement. Closes #398.
% Adjusted the internal map type of the AutoMap. Should improve performance, if only in single digit cpu cycles.
> To-Do) Fix Recipes pertaining to compound materials made from using fluids. State may be detected wrong after recipe system changes.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/loaders')
9 files changed, 234 insertions, 204 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_AlloySmelter.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_AlloySmelter.java index 6ed5eecd38..e2a30851aa 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_AlloySmelter.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_AlloySmelter.java @@ -9,6 +9,7 @@ import gregtech.api.enums.ItemList; import gtPlusPlus.api.interfaces.RunnableWithInfo; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.MaterialGenerator; +import gtPlusPlus.core.util.minecraft.ItemUtils; public class RecipeGen_AlloySmelter extends RecipeGen_Base { @@ -30,8 +31,10 @@ public class RecipeGen_AlloySmelter extends RecipeGen_Base { private void generateRecipes(final Material material){ final int tVoltageMultiplier = material.getMeltingPointK() >= 2800 ? 60 : 15; + + //Nuggets - if (material.getIngot(1) != null && material.getNugget(1) != null) + if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getNugget(1))) GT_Values.RA.addAlloySmelterRecipe( material.getIngot(1), ItemList.Shape_Mold_Nugget.get(0), @@ -40,7 +43,7 @@ public class RecipeGen_AlloySmelter extends RecipeGen_Base { 2 * tVoltageMultiplier); //Gears - if (material.getIngot(1) != null && material.getGear(1) != null) + if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getGear(1))) GT_Values.RA.addAlloySmelterRecipe( material.getIngot(8), ItemList.Shape_Mold_Gear.get(0), @@ -49,7 +52,7 @@ public class RecipeGen_AlloySmelter extends RecipeGen_Base { 2 * tVoltageMultiplier); //Ingot - if (material.getIngot(1) != null && material.getNugget(1) != null) + if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getNugget(1))) GT_Values.RA.addAlloySmelterRecipe( material.getNugget(9), ItemList.Shape_Mold_Ingot.get(0), diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Assembler.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Assembler.java index 0182ca13e8..66941849f8 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Assembler.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Assembler.java @@ -33,6 +33,7 @@ public class RecipeGen_Assembler extends RecipeGen_Base { private void generateRecipes(final Material material){ //Frame Box + if (ItemUtils.checkForInvalidItems(new ItemStack[] {material.getRod(1), material.getFrameBox(1)})) GT_Values.RA.addAssemblerRecipe( material.getRod(4), ItemUtils.getGregtechCircuit(4), @@ -41,6 +42,7 @@ public class RecipeGen_Assembler extends RecipeGen_Base { 8); //Rotor + if (ItemUtils.checkForInvalidItems(new ItemStack[] {material.getPlate(1), material.getRing(1), material.getRotor(1)})) addAssemblerRecipe( material.getPlate(4), material.getRing(1), diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java index b588613224..d4051ff8bf 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java @@ -7,9 +7,7 @@ import net.minecraft.item.ItemStack; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; -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.api.interfaces.RunnableWithInfo; import gtPlusPlus.api.objects.Logger; @@ -35,7 +33,7 @@ public class RecipeGen_DustGeneration extends RecipeGen_Base { public RecipeGen_DustGeneration(final Material M){ this(M, false); } - + public RecipeGen_DustGeneration(final Material M, final boolean O){ this.toGenerate = M; this.disableOptional = O; @@ -59,74 +57,76 @@ public class RecipeGen_DustGeneration extends RecipeGen_Base { final ItemStack[] inputStacks = material.getMaterialComposites(); final ItemStack outputStacks = material.getDust(material.smallestStackSizeWhenProcessing); - if (RecipeUtils.recipeBuilder( - tinyDust, tinyDust, tinyDust, - tinyDust, tinyDust, tinyDust, - tinyDust, tinyDust, tinyDust, - normalDust)){ - Logger.WARNING("9 Tiny dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Success"); - } - else { - Logger.WARNING("9 Tiny dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Failed"); - } - - if (RecipeUtils.recipeBuilder( - normalDust, null, null, - null, null, null, - null, null, null, - material.getTinyDust(9))){ - Logger.WARNING("9 Tiny dust from 1 Recipe: "+material.getLocalizedName()+" - Success"); - } - else { - Logger.WARNING("9 Tiny dust from 1 Recipe: "+material.getLocalizedName()+" - Failed"); - } + if (ItemUtils.checkForInvalidItems(tinyDust) && ItemUtils.checkForInvalidItems(normalDust)) { + if (RecipeUtils.recipeBuilder( + tinyDust, tinyDust, tinyDust, + tinyDust, tinyDust, tinyDust, + tinyDust, tinyDust, tinyDust, + normalDust)){ + Logger.WARNING("9 Tiny dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Logger.WARNING("9 Tiny dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Failed"); + } - if (RecipeUtils.recipeBuilder( - smallDust, smallDust, null, - smallDust, smallDust, null, - null, null, null, - normalDust)){ - Logger.WARNING("4 Small dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Success"); - } - else { - Logger.WARNING("4 Small dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Failed"); + if (RecipeUtils.recipeBuilder( + normalDust, null, null, + null, null, null, + null, null, null, + material.getTinyDust(9))){ + Logger.WARNING("9 Tiny dust from 1 Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Logger.WARNING("9 Tiny dust from 1 Recipe: "+material.getLocalizedName()+" - Failed"); + } } - - if (RecipeUtils.recipeBuilder( - null, normalDust, null, - null, null, null, - null, null, null, - material.getSmallDust(4))){ - Logger.WARNING("4 Small dust from 1 Dust Recipe: "+material.getLocalizedName()+" - Success"); - } - else { - Logger.WARNING("4 Small dust from 1 Dust Recipe: "+material.getLocalizedName()+" - Failed"); + if (ItemUtils.checkForInvalidItems(smallDust) && ItemUtils.checkForInvalidItems(normalDust)) { + if (RecipeUtils.recipeBuilder( + smallDust, smallDust, null, + smallDust, smallDust, null, + null, null, null, + normalDust)){ + Logger.WARNING("4 Small dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Logger.WARNING("4 Small dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Failed"); + } + if (RecipeUtils.recipeBuilder( + null, normalDust, null, + null, null, null, + null, null, null, + material.getSmallDust(4))){ + Logger.WARNING("4 Small dust from 1 Dust Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Logger.WARNING("4 Small dust from 1 Dust Recipe: "+material.getLocalizedName()+" - Failed"); + } } //Macerate blocks back to dusts. final ItemStack materialBlock = material.getBlock(1); final ItemStack materialFrameBox = material.getFrameBox(1); - if (materialBlock != null) { + if (ItemUtils.checkForInvalidItems(materialBlock)) { GT_ModHandler.addPulverisationRecipe(materialBlock, material.getDust(9)); } - if (materialFrameBox != null) { + if (ItemUtils.checkForInvalidItems(materialFrameBox)) { GT_ModHandler.addPulverisationRecipe(materialFrameBox, material.getDust(2)); } - - if (smallDust != null && tinyDust != null) { + + if (ItemUtils.checkForInvalidItems(smallDust) && ItemUtils.checkForInvalidItems(tinyDust)) { generatePackagerRecipes(material); } - + ItemStack ingot = material.getIngot(1); - if (normalDust != null && ingot != null) { + if (ItemUtils.checkForInvalidItems(normalDust) && ItemUtils.checkForInvalidItems(ingot)) { addFurnaceRecipe(material); addMacerationRecipe(material); } - + //Is this a composite? if ((inputStacks != null) && !disableOptional){ //Is this a composite? @@ -149,13 +149,13 @@ public class RecipeGen_DustGeneration extends RecipeGen_Base { //Get us four ItemStacks to input into the mixer ItemStack[] input = new ItemStack[4]; - + input[0] = (inputStacks.length >= 1) ? ((inputStacks[0] == null) ? null : inputStacks[0]) : null; input[1] = (inputStacks.length >= 2) ? ((inputStacks[1] == null) ? null : inputStacks[1]) : null; input[2] = (inputStacks.length >= 3) ? ((inputStacks[2] == null) ? null : inputStacks[2]) : null; input[3] = (inputStacks.length >= 4) ? ((inputStacks[3] == null) ? null : inputStacks[3]) : null; - - + + if (inputStacks.length == 1) { input[1] = input[0]; input[0] = CI.getNumberedCircuit(inputStacks.length+10); @@ -172,8 +172,8 @@ public class RecipeGen_DustGeneration extends RecipeGen_Base { input[1] = input[0]; input[0] = CI.getNumberedCircuit(inputStacks.length+10); } - - + + /*for (int g = 0; g<4; g++) { if(inputStacks.length > g) { input[g] = inputStacks[g] != null ? inputStacks[g] : null; @@ -285,7 +285,7 @@ public class RecipeGen_DustGeneration extends RecipeGen_Base { input2 = input1; input1 = CI.getNumberedCircuit(20); } - + //Add mixer Recipe FluidStack oxygen = GT_Values.NF; if (material.getComposites() != null){ @@ -344,14 +344,14 @@ public class RecipeGen_DustGeneration extends RecipeGen_Base { } return false; } - + public static boolean generatePackagerRecipes(Material aMatInfo) { AutoMap<Boolean> aResults = new AutoMap<Boolean>(); //Small Dust aResults.put(GT_Values.RA.addBoxingRecipe(GT_Utility.copyAmount(4L, new Object[]{aMatInfo.getSmallDust(4)}), ItemList.Schematic_Dust.get(0L, new Object[0]), aMatInfo.getDust(1), 100, 4)); - //Tiny Dust + //Tiny Dust aResults.put(GT_Values.RA.addBoxingRecipe(GT_Utility.copyAmount(9L, new Object[]{aMatInfo.getTinyDust(9)}), ItemList.Schematic_Dust.get(0L, new Object[0]), aMatInfo.getDust(1), 100, 4)); - + for (boolean b : aResults) { if (!b) { return false; @@ -359,7 +359,7 @@ public class RecipeGen_DustGeneration extends RecipeGen_Base { } return true; } - + private void addMacerationRecipe(Material aMatInfo){ try { Logger.MATERIALS("Adding Maceration recipe for "+aMatInfo.getLocalizedName()+" Ingot -> Dusts"); @@ -378,7 +378,7 @@ public class RecipeGen_DustGeneration extends RecipeGen_Base { try { if (aMatInfo.requiresBlastFurnace()) { aOutput = aMatInfo.getHotIngot(1); - if (aOutput != null) { + if (ItemUtils.checkForInvalidItems(aOutput)) { if (addBlastFurnaceRecipe(aMatInfo, aDust, null, aOutput, null, aMatInfo.getMeltingPointK())){ Logger.MATERIALS("Successfully added a blast furnace recipe for "+aMatInfo.getLocalizedName()); } @@ -392,7 +392,7 @@ public class RecipeGen_DustGeneration extends RecipeGen_Base { } else { aOutput = aMatInfo.getIngot(1); - if (aOutput != null) { + if (ItemUtils.checkForInvalidItems(aOutput)) { if (CORE.GT_Recipe.addSmeltingAndAlloySmeltingRecipe(aDust, aOutput)){ Logger.MATERIALS("Successfully added a furnace recipe for "+aMatInfo.getLocalizedName()); } @@ -437,6 +437,6 @@ public class RecipeGen_DustGeneration extends RecipeGen_Base { return false; } } - + } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java index 2fd7f93c2d..9315826495 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java @@ -13,6 +13,7 @@ import gtPlusPlus.api.interfaces.RunnableWithInfo; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.MaterialGenerator; +import gtPlusPlus.core.util.minecraft.ItemUtils; public class RecipeGen_Extruder extends RecipeGen_Base { @@ -48,36 +49,38 @@ public class RecipeGen_Extruder extends RecipeGen_Base { Logger.WARNING("Generating Extruder recipes for "+material.getLocalizedName()); - //Ingot Recipe - if (material.getIngot(1) != null && material.getBlock(1) != null) - if (addExtruderRecipe( - material.getBlock(1), - shape_Ingot, - material.getIngot(9), - (int) Math.max(material.getMass() * 2L * 1, 1), - 4 * material.vVoltageMultiplier)){ - Logger.WARNING("Extruder Ingot Recipe: "+material.getLocalizedName()+" - Success"); - } - else { - Logger.WARNING("Extruder Ingot Recipe: "+material.getLocalizedName()+" - Failed"); - } + + if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getBlock(1))) { + //Ingot Recipe + if (addExtruderRecipe( + material.getBlock(1), + shape_Ingot, + material.getIngot(9), + (int) Math.max(material.getMass() * 2L * 1, 1), + 4 * material.vVoltageMultiplier)){ + Logger.WARNING("Extruder Ingot Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Logger.WARNING("Extruder Ingot Recipe: "+material.getLocalizedName()+" - Failed"); + } - //Block Recipe - if (material.getIngot(1) != null && material.getBlock(1) != null) - if (addExtruderRecipe( - material.getIngot(9), - shape_Block, - material.getBlock(1), - (int) Math.max(material.getMass() * 2L * 1, 1), - 8 * material.vVoltageMultiplier)){ - Logger.WARNING("Extruder Block Recipe: "+material.getLocalizedName()+" - Success"); - } - else { - Logger.WARNING("Extruder Block Recipe: "+material.getLocalizedName()+" - Failed"); + //Block Recipe + if (addExtruderRecipe( + material.getIngot(9), + shape_Block, + material.getBlock(1), + (int) Math.max(material.getMass() * 2L * 1, 1), + 8 * material.vVoltageMultiplier)){ + Logger.WARNING("Extruder Block Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Logger.WARNING("Extruder Block Recipe: "+material.getLocalizedName()+" - Failed"); + } } + //Plate Recipe - if (material.getIngot(1) != null && material.getPlate(1) != null) + if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getPlate(1))) if (addExtruderRecipe( itemIngot, shape_Plate, @@ -90,7 +93,7 @@ public class RecipeGen_Extruder extends RecipeGen_Base { } //Ring Recipe - if (material.getIngot(1) != null && material.getRing(1) != null) + if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getRing(1))) if (!material.isRadioactive){ if (addExtruderRecipe( itemIngot, @@ -107,7 +110,7 @@ public class RecipeGen_Extruder extends RecipeGen_Base { //Gear Recipe - if (material.getIngot(1) != null && material.getGear(1) != null) + if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getGear(1))) if (!material.isRadioactive){ if (addExtruderRecipe( material.getIngot(4), @@ -124,7 +127,7 @@ public class RecipeGen_Extruder extends RecipeGen_Base { //Rod Recipe - if (material.getIngot(1) != null && material.getRod(1) != null) + if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getRod(1))) if (addExtruderRecipe( itemIngot, shape_Rod, @@ -139,7 +142,7 @@ public class RecipeGen_Extruder extends RecipeGen_Base { //Bolt Recipe - if (material.getIngot(1) != null && material.getBolt(1) != null) + if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getBolt(1))) if (!material.isRadioactive){ if (addExtruderRecipe( itemIngot, diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java index 5e2675689b..433c07e948 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java @@ -10,6 +10,7 @@ import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.MaterialGenerator; +import gtPlusPlus.core.util.minecraft.ItemUtils; public class RecipeGen_Fluids extends RecipeGen_Base { @@ -46,7 +47,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { if (!material.requiresBlastFurnace()) { // Ingot - if (material.getIngot(1) != null) + if (ItemUtils.checkForInvalidItems(material.getIngot(1))) if (GT_Values.RA.addFluidExtractionRecipe(material.getIngot(1), // Input null, // Input 2 material.getFluid(144), // Fluid Output @@ -62,7 +63,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { } // Plate - if (material.getPlate(1) != null) + if (ItemUtils.checkForInvalidItems(material.getPlate(1))) if (GT_Values.RA.addFluidExtractionRecipe(material.getPlate(1), // Input null, // Input 2 material.getFluid(144), // Fluid Output @@ -78,7 +79,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { } // Double Plate - if (material.getPlateDouble(1) != null) + if (ItemUtils.checkForInvalidItems(material.getPlateDouble(1))) if (GT_Values.RA.addFluidExtractionRecipe(material.getPlateDouble(1), // Input null, // Input 2 material.getFluid(288), // Fluid Output @@ -94,7 +95,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { } // Nugget - if (material.getNugget(1) != null) + if (ItemUtils.checkForInvalidItems(material.getNugget(1))) if (GT_Values.RA.addFluidExtractionRecipe(material.getNugget(1), // Input null, // Input 2 material.getFluid(16), // Fluid Output @@ -110,7 +111,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { } // Block - if (material.getBlock(1) != null) + if (ItemUtils.checkForInvalidItems(material.getBlock(1))) if (GT_Values.RA.addFluidExtractionRecipe(material.getBlock(1), // Input null, // Input 2 material.getFluid(144 * 9), // Fluid Output @@ -130,7 +131,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { // Making Shapes from fluid // Ingot - if (material.getIngot(1) != null) + if (ItemUtils.checkForInvalidItems(material.getIngot(1))) if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), // Item Shape material.getFluid(144), // Fluid Input material.getIngot(1), // output @@ -145,7 +146,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { } // Plate - if (material.getPlate(1) != null) + if (ItemUtils.checkForInvalidItems(material.getPlate(1))) if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Plate.get(0), // Item Shape material.getFluid(144), // Fluid Input material.getPlate(1), // output @@ -160,7 +161,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { } // Nugget - if (material.getNugget(1) != null) + if (ItemUtils.checkForInvalidItems(material.getNugget(1))) if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Nugget.get(0), // Item Shape material.getFluid(16), // Fluid Input material.getNugget(1), // output @@ -175,7 +176,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { } // Gears - if (material.getGear(1) != null) + if (ItemUtils.checkForInvalidItems(material.getGear(1))) if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Gear.get(0), // Item Shape material.getFluid(576), // Fluid Input material.getGear(1), // output @@ -189,7 +190,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { } // Blocks - if (material.getBlock(1) != null) + if (ItemUtils.checkForInvalidItems(material.getBlock(1))) if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), // Item Shape material.getFluid(144 * 9), // Fluid Input material.getBlock(1), // output @@ -220,7 +221,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { ItemList mold_Ring = ItemList.valueOf("Shape_Mold_Ring"); // Rod - if (material.getRod(1) != null) + if (ItemUtils.checkForInvalidItems(material.getRod(1))) if (mold_Rod != null && GT_Values.RA.addFluidSolidifierRecipe(mold_Rod.get(0), // Item Shape material.getFluid(72), // Fluid Input material.getRod(1), // output @@ -235,7 +236,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { } // Rod Long - if (material.getLongRod(1) != null) + if (ItemUtils.checkForInvalidItems(material.getLongRod(1))) if (mold_Rod_Long != null && GT_Values.RA.addFluidSolidifierRecipe(mold_Rod_Long.get(0), // Item // Shape material.getFluid(144), // Fluid Input @@ -251,7 +252,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { } // Bolt - if (material.getBolt(1) != null) + if (ItemUtils.checkForInvalidItems(material.getBolt(1))) if (mold_Bolt != null && GT_Values.RA.addFluidSolidifierRecipe(mold_Bolt.get(0), // Item Shape material.getFluid(18), // Fluid Input material.getBolt(1), // output @@ -266,7 +267,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { } // Screw - if (material.getScrew(1) != null) + if (ItemUtils.checkForInvalidItems(material.getScrew(1))) if (mold_Screw != null && GT_Values.RA.addFluidSolidifierRecipe(mold_Screw.get(0), // Item Shape material.getFluid(18), // Fluid Input material.getScrew(1), // output @@ -281,7 +282,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { } // Ring - if (material.getRing(1) != null) + if (ItemUtils.checkForInvalidItems(material.getRing(1))) if (mold_Ring != null && GT_Values.RA.addFluidSolidifierRecipe(mold_Ring.get(0), // Item Shape material.getFluid(36), // Fluid Input material.getRing(1), // output diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java index 9529b9019a..ddba6b5bf0 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java @@ -3,18 +3,21 @@ package gtPlusPlus.xmod.gregtech.loaders; import net.minecraft.item.ItemStack; import java.util.ArrayList; +import java.util.HashSet; +import java.util.Set; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; - +import gtPlusPlus.api.interfaces.RunnableWithInfo; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.data.Pair; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.Material; +import gtPlusPlus.core.material.MaterialGenerator; import gtPlusPlus.core.material.MaterialStack; import gtPlusPlus.core.material.state.MaterialState; import gtPlusPlus.core.recipe.common.CI; @@ -23,12 +26,17 @@ import gtPlusPlus.core.util.minecraft.MaterialUtils; import gtPlusPlus.core.util.minecraft.RecipeUtils; import net.minecraftforge.fluids.FluidStack; -public class RecipeGen_Ore implements Runnable{ +public class RecipeGen_Ore extends RecipeGen_Base { - final Material toGenerate; + public final static Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<RunnableWithInfo<Material>>(); + + static { + MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap); + } public RecipeGen_Ore(final Material M){ this.toGenerate = M; + mRecipeGenMap.add(this); } @Override @@ -368,7 +376,7 @@ public class RecipeGen_Ore implements Runnable{ int mCounter = 0; for (Pair<Integer, Material> f : componentMap){ - if (f.getValue().getState() != MaterialState.SOLID){ + if (f.getValue().getState() != MaterialState.SOLID && f.getValue().getState() != MaterialState.ORE){ Logger.MATERIALS("[Dehydrator] Found Fluid Component, adding "+f.getKey()+" cells of "+f.getValue().getLocalizedName()+"."); mInternalOutputs[mCounter++] = f.getValue().getCell(f.getKey()); mCellCount += f.getKey(); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java index 001c494356..15e64534f9 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java @@ -14,6 +14,7 @@ import gtPlusPlus.api.interfaces.RunnableWithInfo; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.MaterialGenerator; +import gtPlusPlus.core.util.minecraft.ItemUtils; public class RecipeGen_Plates extends RecipeGen_Base { @@ -45,6 +46,7 @@ public class RecipeGen_Plates extends RecipeGen_Base { Logger.WARNING("Generating Plate recipes for "+material.getLocalizedName()); //Forge Hammer + if (ItemUtils.checkForInvalidItems(ingotStackTwo) && ItemUtils.checkForInvalidItems(plate_Single)) if (addForgeHammerRecipe( ingotStackTwo, plate_Single, @@ -56,6 +58,7 @@ public class RecipeGen_Plates extends RecipeGen_Base { Logger.WARNING("Forge Hammer Recipe: "+material.getLocalizedName()+" - Failed"); } //Bender + if (ItemUtils.checkForInvalidItems(ingotStackOne) && ItemUtils.checkForInvalidItems(plate_Single)) if (addBenderRecipe( ingotStackOne, plate_Single, @@ -67,6 +70,7 @@ public class RecipeGen_Plates extends RecipeGen_Base { Logger.WARNING("Bender Recipe: "+material.getLocalizedName()+" - Failed"); } //Alloy Smelter + if (ItemUtils.checkForInvalidItems(ingotStackTwo) && ItemUtils.checkForInvalidItems(plate_Single)) if (GT_Values.RA.addAlloySmelterRecipe( ingotStackTwo, shape_Mold, @@ -81,6 +85,7 @@ public class RecipeGen_Plates extends RecipeGen_Base { //Making Double Plates + if (ItemUtils.checkForInvalidItems(ingotStackTwo) && ItemUtils.checkForInvalidItems(plate_Double)) if (addBenderRecipe( ingotStackTwo, plate_Double, @@ -91,6 +96,8 @@ public class RecipeGen_Plates extends RecipeGen_Base { else { Logger.WARNING("Bender Recipe: "+material.getLocalizedName()+" - Failed"); } + + if (ItemUtils.checkForInvalidItems(plate_SingleTwo) && ItemUtils.checkForInvalidItems(plate_Double)) if (addBenderRecipe( plate_SingleTwo, plate_Double, diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java index 8e3ef4e21d..e15c5da29e 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java @@ -108,6 +108,10 @@ public class RecipeGen_Recycling implements Runnable { for (final Pair<OrePrefixes, ItemStack> validPrefix : mValidPairs) { try { + if (material == null || validPrefix == null) { + continue; + } + if (material.getState() != MaterialState.SOLID || validPrefix.getKey() == OrePrefixes.ingotHot){ continue; } @@ -118,7 +122,7 @@ public class RecipeGen_Recycling implements Runnable { int mFluidAmount = (int) GT_Utility.translateMaterialToFluidAmount(validPrefix.getKey().mMaterialAmount, true); //Maceration - if (tempStack != null) { + if (ItemUtils.checkForInvalidItems(tempStack)) { // mValidItems[mSlotIndex++] = tempStack; if ((mDust != null) && GT_ModHandler.addPulverisationRecipe(tempStack, mDust)) { Logger.WARNING("Recycle Recipe: " + material.getLocalizedName() + " - Success - Recycle " @@ -133,12 +137,12 @@ public class RecipeGen_Recycling implements Runnable { } //Arc Furnace - if (tempStack != null) { + if (ItemUtils.checkForInvalidItems(tempStack)) { } //Fluid Extractor - if (tempStack != null) { + if (ItemUtils.checkForInvalidItems(tempStack)) { // mValidItems[mSlotIndex++] = tempStack; if ((mDust != null) && GT_Values.RA.addFluidExtractionRecipe(tempStack, null, material.getFluid(mFluidAmount), 0, 30, 8)) { Logger.WARNING("Fluid Recycle Recipe: " + material.getLocalizedName() + " - Success - Recycle " diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java index 1646ab1535..79615d8457 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java @@ -13,6 +13,7 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.MaterialGenerator; +import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.RecipeUtils; public class RecipeGen_ShapedCrafting extends RecipeGen_Base { @@ -21,7 +22,7 @@ public class RecipeGen_ShapedCrafting extends RecipeGen_Base { static { MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap); } - + public RecipeGen_ShapedCrafting(final Material M){ this.toGenerate = M; mRecipeGenMap.add(this); @@ -37,62 +38,63 @@ public class RecipeGen_ShapedCrafting extends RecipeGen_Base { if (!CORE.GTNH) { //Nuggets - if (material.getNugget(1) != null) - GT_ModHandler.addShapelessCraftingRecipe( - material.getIngot(1), - new Object[]{ - material.getNugget(1), - material.getNugget(1), - material.getNugget(1), - material.getNugget(1), - material.getNugget(1), - material.getNugget(1), - material.getNugget(1), - material.getNugget(1), - material.getNugget(1) - }); + if (ItemUtils.checkForInvalidItems(material.getNugget(1)) && ItemUtils.checkForInvalidItems(material.getIngot(1))) + GT_ModHandler.addShapelessCraftingRecipe( + material.getIngot(1), + new Object[]{ + material.getNugget(1), + material.getNugget(1), + material.getNugget(1), + material.getNugget(1), + material.getNugget(1), + material.getNugget(1), + material.getNugget(1), + material.getNugget(1), + material.getNugget(1) + }); } - + //Plates - + //Single Plate Shaped/Shapeless - if (material.getPlate(1) != null && material.getIngot(1) != null) - GT_ModHandler.addCraftingRecipe( - material.getPlate(1), - gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED, - new Object[]{"h", "B", "I", - Character.valueOf('I'), - material.getIngot(1), - Character.valueOf('B'), - material.getIngot(1)}); + if (ItemUtils.checkForInvalidItems(material.getPlate(1)) && ItemUtils.checkForInvalidItems(material.getIngot(1))) + if (material.getPlate(1) != null && material.getIngot(1) != null) + GT_ModHandler.addCraftingRecipe( + material.getPlate(1), + gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED, + new Object[]{"h", "B", "I", + Character.valueOf('I'), + material.getIngot(1), + Character.valueOf('B'), + material.getIngot(1)}); - if (material.getPlate(1) != null && material.getIngot(1) != null) - GT_ModHandler.addShapelessCraftingRecipe( - material.getPlate(1), - new Object[]{gregtech.api.enums.ToolDictNames.craftingToolForgeHammer, - material.getIngot(1), - material.getIngot(1)}); + if (ItemUtils.checkForInvalidItems(material.getPlate(1)) && ItemUtils.checkForInvalidItems(material.getIngot(1))) + GT_ModHandler.addShapelessCraftingRecipe( + material.getPlate(1), + new Object[]{gregtech.api.enums.ToolDictNames.craftingToolForgeHammer, + material.getIngot(1), + material.getIngot(1)}); //Double Plate Shaped/Shapeless - if (material.getPlateDouble(1) != null && material.getPlate(1) != null) - GT_ModHandler.addCraftingRecipe( - material.getPlateDouble(1), - gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED, - new Object[]{"I", "B", "h", - Character.valueOf('I'), - material.getPlate(1), - Character.valueOf('B'), - material.getPlate(1)}); + if (ItemUtils.checkForInvalidItems(material.getPlateDouble(1)) && ItemUtils.checkForInvalidItems(material.getPlate(1))) + GT_ModHandler.addCraftingRecipe( + material.getPlateDouble(1), + gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED, + new Object[]{"I", "B", "h", + Character.valueOf('I'), + material.getPlate(1), + Character.valueOf('B'), + material.getPlate(1)}); - if (material.getPlateDouble(1) != null && material.getPlate(1) != null) - GT_ModHandler.addShapelessCraftingRecipe( - material.getPlateDouble(1), - new Object[]{gregtech.api.enums.ToolDictNames.craftingToolForgeHammer, - material.getPlate(1), - material.getPlate(1)}); + if (ItemUtils.checkForInvalidItems(material.getPlateDouble(1)) && ItemUtils.checkForInvalidItems(material.getPlate(1))) + GT_ModHandler.addShapelessCraftingRecipe( + material.getPlateDouble(1), + new Object[]{gregtech.api.enums.ToolDictNames.craftingToolForgeHammer, + material.getPlate(1), + material.getPlate(1)}); //Ring Recipe - if (!material.isRadioactive && material.getRing(1) != null && material.getRod(1) != null){ + if (!material.isRadioactive && ItemUtils.checkForInvalidItems(material.getRing(1)) && ItemUtils.checkForInvalidItems(material.getRod(1))) { if (CORE.GTNH){ if (RecipeUtils.recipeBuilder( "craftingToolHardHammer", null, null, @@ -121,7 +123,7 @@ public class RecipeGen_ShapedCrafting extends RecipeGen_Base { //Framebox Recipe - if (!material.isRadioactive && material.getFrameBox(1) != null && material.getRod(1) != null){ + if (!material.isRadioactive && ItemUtils.checkForInvalidItems(material.getFrameBox(1)) && ItemUtils.checkForInvalidItems(material.getRod(1))) { final ItemStack stackStick = material.getRod(1); if (RecipeUtils.recipeBuilder( stackStick, stackStick, stackStick, @@ -166,7 +168,7 @@ public class RecipeGen_ShapedCrafting extends RecipeGen_Base { //Shaped Recipe - Bolts - if (!material.isRadioactive && material.getBolt(1) != null && material.getRod(1) != null){ + if (!material.isRadioactive && ItemUtils.checkForInvalidItems(material.getBolt(1)) && ItemUtils.checkForInvalidItems(material.getRod(1))) { if (RecipeUtils.recipeBuilder( "craftingToolSaw", null, null, null, material.getRod(1), null, @@ -181,47 +183,47 @@ public class RecipeGen_ShapedCrafting extends RecipeGen_Base { //Shaped Recipe - Ingot to Rod - if (material.getRod(1) != null && material.getIngot(1) != null) - if (RecipeUtils.recipeBuilder( - "craftingToolFile", null, null, - null, material.getIngot(1), null, - null, null, null, - material.getRod(1))){ - Logger.WARNING("Rod Recipe: "+material.getLocalizedName()+" - Success"); - } - else { - Logger.WARNING("Rod Recipe: "+material.getLocalizedName()+" - Failed"); - } + if (ItemUtils.checkForInvalidItems(material.getRod(1)) && ItemUtils.checkForInvalidItems(material.getIngot(1))) + if (RecipeUtils.recipeBuilder( + "craftingToolFile", null, null, + null, material.getIngot(1), null, + null, null, null, + material.getRod(1))){ + Logger.WARNING("Rod Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Logger.WARNING("Rod Recipe: "+material.getLocalizedName()+" - Failed"); + } //Shaped Recipe - Long Rod to two smalls - if (material.getRod(1) != null && material.getLongRod(1) != null) - if (RecipeUtils.recipeBuilder( - "craftingToolSaw", null, null, - material.getLongRod(1), null, null, - null, null, null, - material.getRod(2))){ - Logger.WARNING("Rod Recipe: "+material.getLocalizedName()+" - Success"); - } - else { - Logger.WARNING("Rod Recipe: "+material.getLocalizedName()+" - Failed"); - } + if (ItemUtils.checkForInvalidItems(material.getRod(1)) && ItemUtils.checkForInvalidItems(material.getLongRod(1))) + if (RecipeUtils.recipeBuilder( + "craftingToolSaw", null, null, + material.getLongRod(1), null, null, + null, null, null, + material.getRod(2))){ + Logger.WARNING("Rod Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Logger.WARNING("Rod Recipe: "+material.getLocalizedName()+" - Failed"); + } //Two small to long rod - if (material.getLongRod(1) != null && material.getRod(1) != null) - if (RecipeUtils.recipeBuilder( - material.getRod(1), "craftingToolHardHammer", material.getRod(1), - null, null, null, - null, null, null, - material.getLongRod(1))){ - Logger.WARNING("Long Rod Recipe: "+material.getLocalizedName()+" - Success"); - } - else { - Logger.WARNING("Long Rod Recipe: "+material.getLocalizedName()+" - Failed"); - } + if (ItemUtils.checkForInvalidItems(material.getLongRod(1)) && ItemUtils.checkForInvalidItems(material.getRod(1))) + if (RecipeUtils.recipeBuilder( + material.getRod(1), "craftingToolHardHammer", material.getRod(1), + null, null, null, + null, null, null, + material.getLongRod(1))){ + Logger.WARNING("Long Rod Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Logger.WARNING("Long Rod Recipe: "+material.getLocalizedName()+" - Failed"); + } //Rotor Recipe - if (!material.isRadioactive && material.getRotor(1) != null && material.getRing(1) != null && material.getPlate(1) != null && material.getScrew(1) != null){ + if (!material.isRadioactive && ItemUtils.checkForInvalidItems(material.getRotor(1)) && ItemUtils.checkForInvalidItems(material.getRing(1)) && !material.isRadioactive && ItemUtils.checkForInvalidItems(material.getPlate(1)) && ItemUtils.checkForInvalidItems(material.getScrew(1))) { if (RecipeUtils.recipeBuilder( material.getPlate(1), "craftingToolHardHammer", material.getPlate(1), material.getScrew(1), material.getRing(1), "craftingToolFile", @@ -235,7 +237,7 @@ public class RecipeGen_ShapedCrafting extends RecipeGen_Base { } //Gear Recipe - if (!material.isRadioactive && material.getGear(1) != null && material.getPlate(1) != null && material.getRod(1) != null){ + if (!material.isRadioactive && ItemUtils.checkForInvalidItems(material.getGear(1)) && ItemUtils.checkForInvalidItems(material.getPlate(1)) && ItemUtils.checkForInvalidItems(material.getRod(1))) { if (RecipeUtils.recipeBuilder( material.getRod(1), material.getPlate(1), material.getRod(1), material.getPlate(1), "craftingToolWrench", material.getPlate(1), @@ -249,7 +251,7 @@ public class RecipeGen_ShapedCrafting extends RecipeGen_Base { } //Screws - if (!material.isRadioactive && material.getScrew(1) != null && material.getBolt(1) != null){ + if (!material.isRadioactive && ItemUtils.checkForInvalidItems(material.getScrew(1)) && ItemUtils.checkForInvalidItems(material.getBolt(1))) { if (RecipeUtils.recipeBuilder( "craftingToolFile", material.getBolt(1), null, material.getBolt(1), null, null, |