diff options
Diffstat (limited to 'src/Java')
38 files changed, 724 insertions, 657 deletions
diff --git a/src/Java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java b/src/Java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java index f113a67996..4be90061a0 100644 --- a/src/Java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java +++ b/src/Java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java @@ -3,6 +3,12 @@ package gtPlusPlus.api.objects.minecraft; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.data.Pair; +import gtPlusPlus.core.block.ModBlocks; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.everglades.dimension.Dimension_Everglades; +import gtPlusPlus.xmod.forestry.bees.items.FR_ItemRegistry; +import gtPlusPlus.xmod.ic2.item.IC2_Items; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.ShapedOreRecipe; @@ -11,6 +17,8 @@ public class ShapedRecipe { private final static String CHARS = "abcdefghijklmnop"; public ShapedOreRecipe mRecipe; + ItemStack[] mBlackList = null; + public ShapedRecipe( Object aInput1, Object aInput2, Object aInput3, Object aInput4, Object aInput5, Object aInput6, @@ -27,11 +35,18 @@ public class ShapedRecipe { char[] aChar = new char[9]; String[] aLoggingInfo = new String[9]; - - + if (mBlackList == null) { + mBlackList = new ItemStack[] { + ItemUtils.getSimpleStack(ModBlocks.blockNet), + ItemUtils.getSimpleStack(ModBlocks.blockXpConverter), + ItemUtils.getSimpleStack(ModBlocks.blockWitherGuard), + ItemUtils.getSimpleStack(ModBlocks.blockMiningExplosive), + ItemUtils.getSimpleStack(Dimension_Everglades.blockPortalFrame), + }; + } + //Just to be safe try { - Logger.RECIPE("======== B R E A K P O I N T ========="); int xSlot = 0; int xNull = 0; for (Object u : aInputs) { @@ -40,7 +55,10 @@ public class ShapedRecipe { mInfo = (String) u; Logger.RECIPE("Input slot "+xSlot+++" contains "+mInfo); } - else if (u instanceof ItemStack) { + else if (u instanceof ItemStack || u instanceof Item) { + if (u instanceof Item) { + u = ItemUtils.getSimpleStack((Item) u); + } mInfo = ((ItemStack) u).getDisplayName(); Logger.RECIPE("Input slot "+xSlot+++" contains "+mInfo); } @@ -51,6 +69,13 @@ public class ShapedRecipe { Logger.RECIPE("Found "+xNull+" null inputs."); //Check if the output is invalid if (aOutput != null && xNull < 9) { + + for (ItemStack q : mBlackList) { + if (q.isItemEqual(aOutput)) { + Logger.RECIPE("Found recipe Alkalus is Debugging."); + } + } + Object[] mVarags2 = null; Logger.RECIPE("Generating Shaped Crafting Recipe for "+aOutput.getDisplayName()); @@ -75,7 +100,10 @@ public class ShapedRecipe { if (stack instanceof String) { mInfo = (String) stack; } - else if (stack instanceof ItemStack) { + else if (stack instanceof ItemStack || stack instanceof Item) { + if (stack instanceof Item) { + stack = ItemUtils.getSimpleStack((Item) stack); + } mInfo = ((ItemStack) stack).getDisplayName(); } aRecipePairs.put(new Pair<Character, Object>(CHARS.charAt(aCharSlot), stack)); @@ -120,11 +148,11 @@ public class ShapedRecipe { //Rebuild the Map without spaces aRecipePairs.clear(); aCharSlot = 0; - + //The amount of spaces in the Varags that the Shape strings takes. //Currently they are inserted as a single array into index 0. final int KEY_COUNTER = 1; - + int counter = KEY_COUNTER; for (Object stack : aInputs) { if (stack != null) { @@ -132,7 +160,10 @@ public class ShapedRecipe { if (stack instanceof String) { mInfo = (String) stack; } - else if (stack instanceof ItemStack) { + else if (stack instanceof ItemStack || stack instanceof Item) { + if (stack instanceof Item) { + stack = ItemUtils.getSimpleStack((Item) stack); + } mInfo = ((ItemStack) stack).getDisplayName(); } aRecipePairs.put(new Pair<Character, Object>(CHARS.charAt(aCharSlot), stack)); @@ -156,19 +187,27 @@ public class ShapedRecipe { int counter2 = KEY_COUNTER; for (Pair<Character, Object> r : aRecipePairs) { char c = r.getKey(); - Object o = r.getValue(); + Object o = r.getValue(); + + if (o instanceof ItemStack || o instanceof Item) { + if (o instanceof Item) { + o = ItemUtils.getSimpleStack((Item) o); + } + o = ((ItemStack) o).copy(); + } + mVarags2[counter2] = (char) c; mVarags2[counter2+1] = o; counter2 += 2; } - + Logger.RECIPE("Recipe Summary"); Logger.RECIPE("+ = + = + = +"); Logger.RECIPE("= "+aChar[0]+" = "+aChar[1]+" = "+aChar[2]+" ="); Logger.RECIPE("+ = + = + = +"); Logger.RECIPE("= "+aChar[3]+" = "+aChar[4]+" = "+aChar[5]+" ="); Logger.RECIPE("+ = + = + = +"); - Logger.RECIPE("=" +aChar[6]+" = "+aChar[7]+" = "+aChar[8]+" ="); + Logger.RECIPE("= "+aChar[6]+" = "+aChar[7]+" = "+aChar[8]+" ="); Logger.RECIPE("+ = + = + = +"); for (int r=0;r<9;r++) { if (aChar[r] != ' ') { @@ -213,7 +252,7 @@ public class ShapedRecipe { Logger.RECIPE("[Fix][1] Error thrown when making a ShapedOreRecipe object."); t.printStackTrace(); } - + } } diff --git a/src/Java/gtPlusPlus/core/common/CommonProxy.java b/src/Java/gtPlusPlus/core/common/CommonProxy.java index 6035bec37d..462f08184f 100644 --- a/src/Java/gtPlusPlus/core/common/CommonProxy.java +++ b/src/Java/gtPlusPlus/core/common/CommonProxy.java @@ -173,8 +173,8 @@ public class CommonProxy { COMPAT_HANDLER.RemoveRecipesFromOtherMods(); COMPAT_HANDLER.InitialiseHandlerThenAddRecipes(); COMPAT_HANDLER.startLoadingGregAPIBasedRecipes(); - COMPAT_HANDLER.runQueuedRecipes(); COMPAT_IntermodStaging.postInit(); + COMPAT_HANDLER.runQueuedRecipes(); } diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java index 53150ba4d9..9a4367396b 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_General.java @@ -154,6 +154,7 @@ public class RECIPES_General { } //Mining Explosive + Logger.RECIPE("[Inspection] Explosives"); if (RecipeUtils.recipeBuilder( CI.explosiveITNT, CI.explosiveTNT, CI.explosiveITNT, CI.explosiveTNT, "frameGtWroughtIron", CI.explosiveTNT, @@ -186,6 +187,7 @@ public class RECIPES_General { l++; }*/ + Logger.RECIPE("[Inspection] Wither Cage"); if (RecipeUtils.recipeBuilder( "stickBlackSteel", "plateTungstenSteel", "stickBlackSteel", "plateTungstenSteel", getSimpleStack(Items.nether_star), "plateTungstenSteel", @@ -194,6 +196,7 @@ public class RECIPES_General { Logger.INFO("Added a recipe for Wither Cages."); } + Logger.RECIPE("[Inspection] Xp Converter"); if (RecipeUtils.recipeBuilder( getSimpleStack(Items.experience_bottle), ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 2, 1), getSimpleStack(Items.experience_bottle), ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 5, 1), getSimpleStack(Items.nether_star), ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 5, 1), @@ -230,6 +233,7 @@ public class RECIPES_General { Logger.INFO("Added a recipe for Rope."); } + Logger.RECIPE("[Inspection] Net"); if (RecipeUtils.recipeBuilder( ItemUtils.getSimpleStack(ModItems.itemRope, 1), ItemUtils.getSimpleStack(ModItems.itemRope, 1), ItemUtils.getSimpleStack(ModItems.itemRope, 1), ItemUtils.getSimpleStack(ModItems.itemRope, 1), ItemUtils.getSimpleStack(ModItems.itemRope, 1), ItemUtils.getSimpleStack(ModItems.itemRope, 1), diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java index 1cf1685f91..dbcb49d359 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -1341,6 +1341,7 @@ public class RECIPES_Machines { //Mystic Frame + Logger.RECIPE("[Inspection] Portal Frame"); if (RecipeUtils.addShapedGregtechRecipe( "circuitMaster", ItemList.Field_Generator_MV.get(1, CI.circuitTier7), "circuitElite", CI.craftingToolScrewdriver, GregtechItemList.Casing_Multi_Use.get(1), CI.craftingToolWrench, diff --git a/src/Java/gtPlusPlus/core/util/minecraft/RecipeUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/RecipeUtils.java index b64c0995e7..c05438ba87 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/RecipeUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/RecipeUtils.java @@ -28,105 +28,29 @@ import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; public class RecipeUtils { - +public static int mInvalidID = 1; public static boolean recipeBuilder(final Object slot_1, final Object slot_2, final Object slot_3, final Object slot_4, final Object slot_5, final Object slot_6, final Object slot_7, final Object slot_8, final Object slot_9, ItemStack resultItem){ - - final ArrayList<Object> validSlots = new ArrayList<>(); if (resultItem == null){ - Logger.INFO("[1234abcd] Found a recipe with an invalid output, yet had a valid inputs. Using Dummy output so recipe can be found.."); + Logger.INFO("[Fix] Found a recipe with an invalid output, yet had a valid inputs. Using Dummy output so recipe can be found.."); resultItem = ItemUtils.getItemStackOfAmountFromOreDict("givemeabrokenitem", 1); + resultItem.setItemDamage(mInvalidID++); RegistrationHandler.recipesFailed++; //return false; } - - if ((slot_1 == null) && (slot_2 == null) && (slot_3 == null) && + else if ((slot_1 == null) && (slot_2 == null) && (slot_3 == null) && (slot_4 == null) && (slot_5 == null) && (slot_6 == null) && (slot_7 == null) && (slot_8 == null) && (slot_9 == null)){ - Logger.INFO("[1234abcd] Found a recipe with 0 inputs, yet had a valid output."); - Logger.INFO("[1234abcd] Error found while adding a recipe for: "+resultItem.getDisplayName()+" | Please report this issue on Github."); + Logger.INFO("[Fix] Found a recipe with 0 inputs, yet had a valid output."); + Logger.INFO("[Fix] Error found while adding a recipe for: "+resultItem != null ? resultItem.getDisplayName() : "Bad Output Item"+" | Please report this issue on Github."); RegistrationHandler.recipesFailed++; return false; } - - /* - //Utils.LOG_WARNING("Trying to add a recipe for "+resultItem.toString()); - String a,b,c,d,e,f,g,h,i; - if (slot_1 == null){ a = " ";} else { a = "1";validSlots.add('1');validSlots.add(slot_1);} - Logger.WARNING(a); - if (slot_2 == null){ b = " ";} else { b = "2";validSlots.add('2');validSlots.add(slot_2);} - Logger.WARNING(b); - if (slot_3 == null){ c = " ";} else { c = "3";validSlots.add('3');validSlots.add(slot_3);} - Logger.WARNING(c); - if (slot_4 == null){ d = " ";} else { d = "4";validSlots.add('4');validSlots.add(slot_4);} - Logger.WARNING(d); - if (slot_5 == null){ e = " ";} else { e = "5";validSlots.add('5');validSlots.add(slot_5);} - Logger.WARNING(e); - if (slot_6 == null){ f = " ";} else { f = "6";validSlots.add('6');validSlots.add(slot_6);} - Logger.WARNING(f); - if (slot_7 == null){ g = " ";} else { g = "7";validSlots.add('7');validSlots.add(slot_7);} - Logger.WARNING(g); - if (slot_8 == null){ h = " ";} else { h = "8";validSlots.add('8');validSlots.add(slot_8);} - Logger.WARNING(h); - if (slot_9 == null){ i = " ";} else { i = "9";validSlots.add('9');validSlots.add(slot_9);} - Logger.WARNING(i); - - - Logger.ERROR("_______"); - final String lineOne = a+b+c; - Logger.ERROR("|"+a+"|"+b+"|"+c+"|"); - Logger.ERROR("_______"); - final String lineTwo = d+e+f; - Logger.ERROR("|"+d+"|"+e+"|"+f+"|"); - Logger.ERROR("_______"); - final String lineThree = g+h+i; - Logger.ERROR("|"+g+"|"+h+"|"+i+"|"); - Logger.ERROR("_______"); - - //validSlots.add(0, lineOne); - //validSlots.add(1, lineTwo); - //validSlots.add(2, lineThree); - boolean advancedLog = false; - if (CORE.DEBUG){ - advancedLog = true; - } - if (advancedLog){ - int j = 0; - final int l = validSlots.size(); - Logger.WARNING("l:"+l); - while (j <= l) { - Logger.WARNING("j:"+j); - if (j <= 2){ - Logger.WARNING("ArrayList Values: "+validSlots.get(j)); - Logger.WARNING("Adding 1."); - j++; - } - else if (j == l){ - Logger.WARNING("Done iteration."); - break; - } - else { - Logger.WARNING("ArrayList Values: '"+validSlots.get(j)+"' "+validSlots.get(j+1)); - if (j < (l-2)){ - Logger.WARNING("Adding 2."); - j=j+2; - } - else { - Logger.WARNING("Done iteration."); - break; - } - } - if ((validSlots.get(j) instanceof String) || (validSlots.get(j) instanceof ItemStack)){ - //Utils.LOG_WARNING("Is Valid: "+validSlots.get(j)); - } - } - }*/ Object[] o = new Object[] {slot_1, slot_2, slot_3, slot_4, slot_5, slot_6, slot_7, slot_8, slot_9}; try { int size = COMPAT_HANDLER.mRecipesToGenerate.size(); COMPAT_HANDLER.mRecipesToGenerate.put(new InternalRecipeObject(o, resultItem, false)); - //Utils.LOG_WARNING("Success! Added a recipe for "+resultItem.getDisplayName()); if (COMPAT_HANDLER.mRecipesToGenerate.size() > size) { if (!COMPAT_HANDLER.areInitItemsLoaded){ @@ -144,7 +68,7 @@ public class RecipeUtils { //k.getClass(); //k.printStackTrace(); //k.getLocalizedMessage(); - Logger.INFO("@@@: Invalid Recipe detected for: "+resultItem != null ? resultItem.getUnlocalizedName() : "INVALID OUTPUT ITEM"); + Logger.INFO("[Fix] Invalid Recipe detected for: "+resultItem != null ? resultItem.getUnlocalizedName() : "INVALID OUTPUT ITEM"); if (!COMPAT_HANDLER.areInitItemsLoaded){ RegistrationHandler.recipesFailed++; } @@ -421,8 +345,7 @@ public class RecipeUtils { public static boolean addShapedGregtechRecipe(final Object[] inputs, ItemStack output){ if (inputs.length != 9){ - Logger.WARNING("Input array for "+output.getDisplayName()+" does not equal 9. "+inputs.length+" is the actual size."); - + Logger.RECIPE("[Fix] Input array for "+output.getDisplayName()+" does not equal 9. "+inputs.length+" is the actual size."); RegistrationHandler.recipesFailed++; return false; } @@ -432,21 +355,19 @@ public class RecipeUtils { inputs[x] = " "; Logger.WARNING("Input slot "+x+" changed from NULL to a blank space."); } - else if (!(inputs[x] instanceof ItemStack) && !(inputs[x] instanceof String)){ + else if (!(inputs[x] instanceof ItemStack) && !(inputs[x] instanceof String) && !(inputs[x] instanceof Item)){ if (output != null){ - Logger.WARNING("Invalid Item inserted into inputArray. Item:"+output.getDisplayName()+" has a bad recipe. Please report to Alkalus."); - + Logger.RECIPE("[Fix] Invalid Item inserted into inputArray. Item:"+output.getDisplayName()+" has a bad recipe. Please report to Alkalus."); RegistrationHandler.recipesFailed++; return false; } else { - Logger.WARNING("Output is Null for a recipe. Report to Alkalus."); + Logger.RECIPE("[Fix] Output is Null for a recipe. Report to Alkalus."); output = ItemUtils.getItemStackOfAmountFromOreDict("sadibasdkjnad", 1); } } } - int size = COMPAT_HANDLER.mGtRecipesToGenerate.size(); COMPAT_HANDLER.mGtRecipesToGenerate.put(new InternalRecipeObject(inputs, output, true)); @@ -557,6 +478,9 @@ public class RecipeUtils { if (o instanceof ItemStack) { aFiltered[aValid++] = o; } + else if (o instanceof Item) { + aFiltered[aValid++] = ItemUtils.getSimpleStack((Item) o); + } else if (o instanceof String) { aFiltered[aValid++] = o; } @@ -573,6 +497,9 @@ public class RecipeUtils { if (p instanceof ItemStack) { validCounter++; } + else if (p instanceof Item) { + validCounter++; + } else if (p instanceof String) { validCounter++; } diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/recipe/FR_Gregtech_Recipes.java b/src/Java/gtPlusPlus/xmod/forestry/bees/recipe/FR_Gregtech_Recipes.java index 1df25261d1..0bba3d1f84 100644 --- a/src/Java/gtPlusPlus/xmod/forestry/bees/recipe/FR_Gregtech_Recipes.java +++ b/src/Java/gtPlusPlus/xmod/forestry/bees/recipe/FR_Gregtech_Recipes.java @@ -41,7 +41,7 @@ public class FR_Gregtech_Recipes { private static ItemStack hiveFrameSlow = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameSlow); private static ItemStack hiveFrameStalilize = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameStalilize); private static ItemStack hiveFrameArborist = ItemUtils.getSimpleStack(FR_ItemRegistry.hiveFrameArborist); - + public static void registerItems(){ //Magic Bee Like Frames RecipeUtils.addShapedGregtechRecipe( @@ -99,31 +99,31 @@ public class FR_Gregtech_Recipes { null, itemClayDust, null, hiveFrameClay); } - + // Frame Items added by bartimaeusnek - RecipeUtils.addShapedGregtechRecipe( - ItemUtils.getItemStackOfAmountFromOreDict("stickLongTumbaga", 1),ItemUtils.getItemStackOfAmountFromOreDict("stickTumbaga", 1),ItemUtils.getItemStackOfAmountFromOreDict("stickLongTumbaga", 1), - ItemUtils.getItemStackOfAmountFromOreDict("stickLongTumbaga", 1),foil_Electrum,ItemUtils.getItemStackOfAmountFromOreDict("stickLongTumbaga", 1), - ItemUtils.getItemStackOfAmountFromOreDict("stickTumbaga", 1),ItemUtils.getItemStackOfAmountFromOreDict("stickTumbaga", 1),ItemUtils.getItemStackOfAmountFromOreDict("stickTumbaga", 1), - hiveFrameSlow); - - RecipeUtils.addShapedGregtechRecipe( - "stickLongWroughtIron","stickWroughtIron","stickLongWroughtIron", - "stickLongWroughtIron","foilWroughtIron","stickLongWroughtIron", - "stickWroughtIron","stickWroughtIron","stickWroughtIron", - hiveFrameDecay); - - RecipeUtils.addShapedGregtechRecipe( - "stickLongOsmiridium","stickOsmiridium","stickLongOsmiridium", - "stickLongOsmiridium","foilOsmiridium","stickLongOsmiridium", - "stickOsmiridium","stickOsmiridium","stickOsmiridium", - hiveFrameStalilize); - - RecipeUtils.addShapedGregtechRecipe( - "stickLongWoodSealed","stickWoodSealed","stickLongWoodSealed", - "stickLongWoodSealed",Items.paper,"stickLongWoodSealed", - "stickWoodSealed","stickWoodSealed","stickWoodSealed", - hiveFrameArborist); + RecipeUtils.addShapedGregtechRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("stickLongTumbaga", 1),ItemUtils.getItemStackOfAmountFromOreDict("stickTumbaga", 1),ItemUtils.getItemStackOfAmountFromOreDict("stickLongTumbaga", 1), + ItemUtils.getItemStackOfAmountFromOreDict("stickLongTumbaga", 1),foil_Electrum,ItemUtils.getItemStackOfAmountFromOreDict("stickLongTumbaga", 1), + ItemUtils.getItemStackOfAmountFromOreDict("stickTumbaga", 1),ItemUtils.getItemStackOfAmountFromOreDict("stickTumbaga", 1),ItemUtils.getItemStackOfAmountFromOreDict("stickTumbaga", 1), + hiveFrameSlow); + + RecipeUtils.addShapedGregtechRecipe( + "stickLongWroughtIron","stickWroughtIron","stickLongWroughtIron", + "stickLongWroughtIron","foilZinc","stickLongWroughtIron", + "stickWroughtIron","stickWroughtIron","stickWroughtIron", + hiveFrameDecay); + + RecipeUtils.addShapedGregtechRecipe( + "stickLongOsmiridium","stickOsmiridium","stickLongOsmiridium", + "stickLongOsmiridium","foilOsmiridium","stickLongOsmiridium", + "stickOsmiridium","stickOsmiridium","stickOsmiridium", + hiveFrameStalilize); + + RecipeUtils.addShapedGregtechRecipe( + "stickLongWoodSealed","stickWoodSealed","stickLongWoodSealed", + "stickLongWoodSealed",Items.paper,"stickLongWoodSealed", + "stickWoodSealed","stickWoodSealed","stickWoodSealed", + hiveFrameArborist); } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java index 372db7da10..0401d7e15a 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java @@ -242,6 +242,32 @@ GT_MetaTileEntity_MultiBlockBase { return true; } + /** + * A Static {@link Method} object which holds the current status of logging. + */ + Method aLogger = null; + + public void log(String s) { + boolean isDebugLogging = false; + boolean reset = false; + if (aLogger == null || reset) { + if (isDebugLogging) { + try { + aLogger = Logger.class.getMethod("INFO", String.class); + } catch (NoSuchMethodException | SecurityException e) {} + } + else { + try { + aLogger = Logger.class.getMethod("MACHINE_INFO", String.class); + } catch (NoSuchMethodException | SecurityException e) {} + } + } + try { + aLogger.invoke(null, s); + } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {} + + } + public boolean checkRecipeGeneric() { return checkRecipeGeneric(1, 100, 0); } @@ -264,6 +290,9 @@ GT_MetaTileEntity_MultiBlockBase { int aSpeedBonusPercent, int aOutputChanceRoll) { // Based on the Processing Array. A bit overkill, but very flexible. + + + // Reset outputs and progress stats this.mEUt = 0; this.mMaxProgresstime = 0; @@ -272,24 +301,24 @@ GT_MetaTileEntity_MultiBlockBase { long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - Logger.MACHINE_INFO("Running checkRecipeGeneric(0)"); + log("Running checkRecipeGeneric(0)"); GT_Recipe tRecipe = findRecipe( getBaseMetaTileEntity(), mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs); - Logger.MACHINE_INFO("Running checkRecipeGeneric(1)"); + log("Running checkRecipeGeneric(1)"); // Remember last recipe - an optimization for findRecipe() this.mLastRecipe = tRecipe; if (tRecipe == null) { - Logger.MACHINE_INFO("BAD RETURN - 1"); + log("BAD RETURN - 1"); return false; } if (!this.canBufferOutputs(tRecipe, aMaxParallelRecipes)) { - Logger.MACHINE_INFO("BAD RETURN - 2"); + log("BAD RETURN - 2"); return false; } @@ -299,23 +328,23 @@ GT_MetaTileEntity_MultiBlockBase { int parallelRecipes = 0; - Logger.MACHINE_INFO("parallelRecipes: "+parallelRecipes); - Logger.MACHINE_INFO("aMaxParallelRecipes: "+aMaxParallelRecipes); - Logger.MACHINE_INFO("tTotalEUt: "+tTotalEUt); - Logger.MACHINE_INFO("tVoltage: "+tVoltage); - Logger.MACHINE_INFO("tRecipeEUt: "+tRecipeEUt); + log("parallelRecipes: "+parallelRecipes); + log("aMaxParallelRecipes: "+aMaxParallelRecipes); + log("tTotalEUt: "+tTotalEUt); + log("tVoltage: "+tVoltage); + log("tRecipeEUt: "+tRecipeEUt); // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tVoltage - tRecipeEUt); parallelRecipes++) { if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) { - Logger.MACHINE_INFO("Broke at "+parallelRecipes+"."); + log("Broke at "+parallelRecipes+"."); break; } - Logger.MACHINE_INFO("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+"."); + log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tR |
