aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2021-11-16 17:33:54 +0000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2021-11-16 17:33:54 +0000
commita40b1e3b79709baa60ae2ced9ab57279c065cb7d (patch)
treedc1e13e6ea4e1ad904b939a5926c29de1b2df802
parent3ab6eb22055b45e5bc6036ce9ded62296e380b59 (diff)
downloadGT5-Unofficial-a40b1e3b79709baa60ae2ced9ab57279c065cb7d.tar.gz
GT5-Unofficial-a40b1e3b79709baa60ae2ced9ab57279c065cb7d.tar.bz2
GT5-Unofficial-a40b1e3b79709baa60ae2ced9ab57279c065cb7d.zip
Implemented use of GT_AssemblyLineUtils for the Scanner and Assembly line.
Cleaned up Assembly Line recipe handling code. Cleaned up Scanner AL recipe handling code. Cleaned up GT_AssemblyLineUtils a touch and added a little more debugging. (Turn D1 on in GT)
-rw-r--r--src/main/java/gregtech/api/util/GT_AssemblyLineUtils.java86
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java97
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java207
3 files changed, 167 insertions, 223 deletions
diff --git a/src/main/java/gregtech/api/util/GT_AssemblyLineUtils.java b/src/main/java/gregtech/api/util/GT_AssemblyLineUtils.java
index bf10b93ce8..f35f1962d1 100644
--- a/src/main/java/gregtech/api/util/GT_AssemblyLineUtils.java
+++ b/src/main/java/gregtech/api/util/GT_AssemblyLineUtils.java
@@ -27,6 +27,8 @@ public class GT_AssemblyLineUtils {
*/
private static HashMap<String, GT_Recipe_AssemblyLine> sRecipeCacheByRecipeHash = new HashMap<String, GT_Recipe_AssemblyLine>();
+
+
/**
* Checks the DataStick for deprecated/invalid recipes, updating them as required.
* @param aDataStick - The DataStick to process
@@ -49,25 +51,35 @@ public class GT_AssemblyLineUtils {
return true;
}
+
/**
* Finds an Assembly Line recipe from a DataStick.
* @param aDataStick - The DataStick to check.
* @return The GT_Recipe_AssemblyLine recipe contained on the DataStick, if any.
*/
public static GT_Recipe_AssemblyLine findAssemblyLineRecipeFromDataStick(ItemStack aDataStick) {
+ return findAssemblyLineRecipeFromDataStick(aDataStick, false);
+ }
+
+ /**
+ * Finds an Assembly Line recipe from a DataStick.
+ * @param aDataStick - The DataStick to check.
+ * @param aReturnBuiltRecipe - Do we return a GT_Recipe_AssemblyLine built from the data on the Data Stick instead of searching the Recipe Map?
+ * @return The GT_Recipe_AssemblyLine recipe contained on the DataStick, if any.
+ */
+ public static GT_Recipe_AssemblyLine findAssemblyLineRecipeFromDataStick(ItemStack aDataStick, boolean aReturnBuiltRecipe) {
if (!isItemDataStick(aDataStick)) {
return null;
}
ItemStack[] aInputs = new ItemStack[15];
ItemStack[] aOutputs = new ItemStack[1];
FluidStack[] aFluidInputs = new FluidStack[4];
- boolean aFoundRecipe = false;
NBTTagCompound aTag = aDataStick.getTagCompound();
if (aTag == null) {
return null;
}
-
+
//Get From Cache
if (doesDataStickHaveRecipeHash(aDataStick)) {
GT_Recipe_AssemblyLine aRecipeFromCache = sRecipeCacheByRecipeHash.get(getHashFromDataStack(aDataStick));
@@ -112,7 +124,9 @@ public class GT_AssemblyLineUtils {
}
}
- if (GT_Values.D1) GT_FML_LOGGER.info("All Items done, start fluid check");
+ if (GT_Values.D1) {
+ GT_FML_LOGGER.info("All Items done, start fluid check");
+ }
for (int i = 0; i < 4; i++) {
if (!aTag.hasKey("f" + i)) continue;
aFluidInputs[i] = GT_Utility.loadFluid(aTag, "f" + i);
@@ -124,35 +138,36 @@ public class GT_AssemblyLineUtils {
GT_FML_LOGGER.info(i + " accepted");
}
}
-
- if (GT_Values.D1) {
- GT_FML_LOGGER.info("Input accepted, check other values");
- }
aOutputs = new ItemStack[]{GT_Utility.loadItem(aTag, "output")};
if (!aTag.hasKey("output") || !aTag.hasKey("time") || aTag.getInteger("time") <= 0 || !aTag.hasKey("eu") || aOutputs[0] == null || !GT_Utility.isStackValid(aOutputs[0])) {
return null;
}
if (GT_Values.D1) {
- GT_FML_LOGGER.info("Find Data Stick recipe");
+ GT_FML_LOGGER.info("Found Data Stick recipe");
}
- aFoundRecipe = true;
-
- if (aFoundRecipe) {
- int aTime = aTag.getInteger("time");
- int aEU = aTag.getInteger("eu");
- for (GT_Recipe_AssemblyLine aRecipe : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes) {
- if (aRecipe.mEUt == aEU && aRecipe.mDuration == aTime) {
- if (GT_Utility.areStacksEqual(aOutputs[0], aRecipe.mOutput, true)) {
- if (Arrays.equals(aRecipe.mInputs, aInputs) && Arrays.equals(aRecipe.mFluidInputs, aFluidInputs)) {
- // Cache it
- String aRecipeHash = generateRecipeHash(aRecipe);
- sRecipeCacheByRecipeHash.put(aRecipeHash, aRecipe);
- sRecipeCacheByOutput.put(new GT_ItemStack(aRecipe.mOutput), aRecipe);
- return aRecipe;
- }
+
+ int aTime = aTag.getInteger("time");
+ int aEU = aTag.getInteger("eu");
+
+ // Try build a recipe instance
+ if (aReturnBuiltRecipe) {
+ GT_Recipe_AssemblyLine aBuiltRecipe = new GT_Recipe_AssemblyLine(null, 0, aInputs, aFluidInputs, aOutputs[0], aTime, aEU);
+ return aBuiltRecipe;
+ }
+
+
+ for (GT_Recipe_AssemblyLine aRecipe : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes) {
+ if (aRecipe.mEUt == aEU && aRecipe.mDuration == aTime) {
+ if (GT_Utility.areStacksEqual(aOutputs[0], aRecipe.mOutput, true)) {
+ if (Arrays.equals(aRecipe.mInputs, aInputs) && Arrays.equals(aRecipe.mFluidInputs, aFluidInputs)) {
+ // Cache it
+ String aRecipeHash = generateRecipeHash(aRecipe);
+ sRecipeCacheByRecipeHash.put(aRecipeHash, aRecipe);
+ sRecipeCacheByOutput.put(new GT_ItemStack(aRecipe.mOutput), aRecipe);
+ return aRecipe;
}
}
- }
+ }
}
return null;
}
@@ -167,14 +182,14 @@ public class GT_AssemblyLineUtils {
if (aOutput == null) {
return null;
}
-
+
// Check the cache
GT_ItemStack aCacheStack = new GT_ItemStack(aOutput);
GT_Recipe_AssemblyLine aRecipeFromCache = sRecipeCacheByOutput.get(aCacheStack);
if (aRecipeFromCache != null) {
return aRecipeFromCache;
}
-
+
// Iterate all recipes and return the first matching based on Output.
for (GT_Recipe_AssemblyLine aRecipe : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes) {
ItemStack aRecipeOutput = aRecipe.mOutput;
@@ -321,13 +336,26 @@ public class GT_AssemblyLineUtils {
String s = aNewRecipe.mOutput.getDisplayName();
if (FMLCommonHandler.instance().getEffectiveSide().isServer()) {
s = GT_Assemblyline_Server.lServerNames.get(aNewRecipe.mOutput.getDisplayName());
- if (s == null)
+ if (s == null) {
s = aNewRecipe.mOutput.getDisplayName();
+ }
+ }
+
+ String aHash = generateRecipeHash(aNewRecipe);
+ if (GT_Values.D1) {
+ GT_Recipe_AssemblyLine aOldRecipe = findAssemblyLineRecipeFromDataStick(aDataStick, true);
+ GT_FML_LOGGER.info("Updating data stick: "+aDataStick.getDisplayName()+" | Old Recipe Hash: "+generateRecipeHash(aOldRecipe)+", New Recipe Hash: "+aHash);
}
+
//remove possible old NBTTagCompound
aDataStick.setTagCompound(new NBTTagCompound());
- GT_Utility.ItemNBT.setBookTitle(aDataStick, s + " Construction Data");
+ if (GT_Values.D1) {
+ GT_Utility.ItemNBT.setBookTitle(aDataStick, s + " Construction Data ("+aHash+")");
+ }
+ else {
+ GT_Utility.ItemNBT.setBookTitle(aDataStick, s + " Construction Data");
+ }
NBTTagCompound tNBT = aDataStick.getTagCompound();
if (tNBT == null) {
@@ -403,7 +431,7 @@ public class GT_AssemblyLineUtils {
tNBT.setTag("pages", tNBTList);
aDataStick.setTagCompound(tNBT);
// Set recipe hash
- setRecipeHashOnDataStick(aDataStick, generateRecipeHash(aNewRecipe));
+ setRecipeHashOnDataStick(aDataStick, aHash);
return true;
}
return false;
diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java
index 48eeb6c8fb..1573c951eb 100644
--- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java
+++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Scanner.java
@@ -254,6 +254,7 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine {
if (failScanner) {
return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
}
+
String s = tRecipe.mOutput.getDisplayName();
if (FMLCommonHandler.instance().getEffectiveSide().isServer()) {
@@ -262,95 +263,19 @@ public class GT_MetaTileEntity_Scanner extends GT_MetaTileEntity_BasicMachine {
s = tRecipe.mOutput.getDisplayName();
}
this.mOutputItems[0] = GT_Utility.copyAmount(1L, getSpecialSlot());
- //remove possible old NBTTagCompound
- this.mOutputItems[0].setTagCompound(new NBTTagCompound());
- GT_Utility.ItemNBT.setBookTitle(this.mOutputItems[0], s + " Construction Data");
-
- NBTTagCompound tNBT = this.mOutputItems[0].getTagCompound();
- if (tNBT == null) {
- tNBT = new NBTTagCompound();
- }
-
- tNBT.setTag("output", tRecipe.mOutput.writeToNBT(new NBTTagCompound()));
- tNBT.setInteger("time", tRecipe.mDuration);
- tNBT.setInteger("eu", tRecipe.mEUt);
- for (int i = 0; i < tRecipe.mInputs.length; i++) {
- tNBT.setTag("" + i, tRecipe.mInputs[i].writeToNBT(new NBTTagCompound()));
- }
- for (int i = 0; i < tRecipe.mOreDictAlt.length; i++) {
- if (tRecipe.mOreDictAlt[i] != null && tRecipe.mOreDictAlt[i].length > 0) {
- tNBT.setInteger("a" + i, tRecipe.mOreDictAlt[i].length);
- for (int j = 0; j < tRecipe.mOreDictAlt[i].length; j++) {
- tNBT.setTag("a" + i + ":" + j, tRecipe.mOreDictAlt[i][j].writeToNBT(new NBTTagCompound()));
- }
- }
- }
- for (int i = 0; i < tRecipe.mFluidInputs.length; i++) {
- tNBT.setTag("f" + i, tRecipe.mFluidInputs[i].writeToNBT(new NBTTagCompound()));
- }
- tNBT.setString("author", "Assembling Line Recipe Generator");
- NBTTagList tNBTList = new NBTTagList();
- s = tRecipe.mOutput.getDisplayName();
- if (FMLCommonHandler.instance().getEffectiveSide().isServer()) {
- s = GT_Assemblyline_Server.lServerNames.get(tRecipe.mOutput.getDisplayName());
- if (s == null)
- s = tRecipe.mOutput.getDisplayName();
- }
- tNBTList.appendTag(new NBTTagString("Construction plan for " + tRecipe.mOutput.stackSize + " " + s + ". Needed EU/t: " + tRecipe.mEUt + " Production time: " + (tRecipe.mDuration / 20)));
- for (int i = 0; i < tRecipe.mInputs.length; i++) {
- if (tRecipe.mOreDictAlt[i] != null) {
- int count = 0;
- StringBuilder tBuilder = new StringBuilder("Input Bus " + (i + 1) + ": ");
- for (ItemStack tStack : tRecipe.mOreDictAlt[i]) {
- if (tStack != null) {
- s = tStack.getDisplayName();
- if (FMLCommonHandler.instance().getEffectiveSide().isServer()) {
- s = GT_Assemblyline_Server.lServerNames.get(tStack.getDisplayName());
- if (s == null)
- s = tStack.getDisplayName();
- }
-
+
- tBuilder.append(count == 0 ? "" : "\nOr ").append(tStack.stackSize).append(" ").append(s);
- count++;
- }
- }
- if (count > 0) tNBTList.appendTag(new NBTTagString(tBuilder.toString()));
- } else if (tRecipe.mInputs[i] != null) {
- s = tRecipe.mInputs[i].getDisplayName();
- if (FMLCommonHandler.instance().getEffectiveSide().isServer()) {
- s = GT_Assemblyline_Server.lServerNames.get(tRecipe.mInputs[i].getDisplayName());
- if (s == null)
- s = tRecipe.mInputs[i].getDisplayName();
- }
- tNBTList.appendTag(new NBTTagString("Input Bus " + (i + 1) + ": " + tRecipe.mInputs[i].stackSize + " " + s));
- }
- }
- for (int i = 0; i < tRecipe.mFluidInputs.length; i++) {
- if (tRecipe.mFluidInputs[i] != null) {
- s = tRecipe.mFluidInputs[i].getLocalizedName();
- if (FMLCommonHandler.instance().getEffectiveSide().isServer()) {
- s = GT_Assemblyline_Server.lServerNames.get(tRecipe.mFluidInputs[i].getLocalizedName());
- if (s == null)
- s = tRecipe.mFluidInputs[i].getLocalizedName();
- }
- tNBTList.appendTag(new NBTTagString("Input Hatch " + (i + 1) + ": " + tRecipe.mFluidInputs[i].amount + "L " + s));
- }
+ // Use Assline Utils
+ if (GT_AssemblyLineUtils.setAssemblyLineRecipeOnDataStick(this.mOutputItems[0], tRecipe)) {
+ aStack.stackSize -= 1;
+ calculateOverclockedNess(30, tRecipe.mResearchTime);
+ //In case recipe is too OP for that machine
+ if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1)
+ return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
+ getSpecialSlot().stackSize -= 1;
+ return 2;
}
- tNBT.setTag("pages", tNBTList);
-
- this.mOutputItems[0].setTagCompound(tNBT);
- // Add Recipe Hash String to Data stick.
- GT_AssemblyLineUtils.setRecipeHashOnDataStick(this.mOutputItems[0], GT_AssemblyLineUtils.generateRecipeHash(tRecipe));
-
- aStack.stackSize -= 1;
- calculateOverclockedNess(30, tRecipe.mResearchTime);
- //In case recipe is too OP for that machine
- if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1)
- return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
- getSpecialSlot().stackSize -= 1;
- return 2;
}
}
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java
index 060c086741..c2460213c8 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java
@@ -20,6 +20,7 @@ import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_AssemblyLineUtils;
import gregtech.api.util.GT_Multiblock_Tooltip_Builder;
import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Recipe.GT_Recipe_AssemblyLine;
import gregtech.api.util.GT_Utility;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
@@ -157,123 +158,111 @@ public class GT_MetaTileEntity_AssemblyLine extends GT_MetaTileEntity_EnhancedMu
@Override
public boolean checkRecipe(ItemStack aStack) {
- if (GT_Values.D1)
- GT_FML_LOGGER.info("Start ALine recipe check");
+ if (GT_Values.D1) {
+ GT_FML_LOGGER.info("Start ALine recipe check");
+ }
ArrayList<ItemStack> tDataStickList = getDataItems(2);
- if (tDataStickList.isEmpty()) return false;
- if (GT_Values.D1)
- GT_FML_LOGGER.info("Stick accepted, " + tDataStickList.size() + " Data Sticks found");
+ if (tDataStickList.isEmpty()) {
+ return false;
+ }
+ if (GT_Values.D1) {
+ GT_FML_LOGGER.info("Stick accepted, " + tDataStickList.size() + " Data Sticks found");
+ }
- ItemStack[] tStack = new ItemStack[15];
- FluidStack[] tFluids = new FluidStack[4];
+ ItemStack[] tStack = null;
+ FluidStack[] tFluids = null;
boolean findRecipe = false;
- nextDS:
+
+ nextDataStick:
for (ItemStack tDataStick : tDataStickList) {
- NBTTagCompound tTag = tDataStick.getTagCompound();
- if (tTag == null)
- continue;
+ GT_Recipe_AssemblyLine aFoundRecipe = GT_AssemblyLineUtils.findAssemblyLineRecipeFromDataStick(tDataStick);
+
+ // Check if the recipe on the data stick is the current recipe for it's given output, if not we update it and continue to next.
+ if (!GT_AssemblyLineUtils.processDataStick(tDataStick)) {
+ continue;
+ }
+
+ tStack = aFoundRecipe.mInputs;
+ tFluids = aFoundRecipe.mFluidInputs;
+
+ // So here we check against the recipe found on the data stick.
+ // If we run into missing buses/hatches or bad inputs, we go to the next data stick.
+ // This check only happens if we have a valid up to date data stick.
+
+ // Check Inputs allign
+ int aItemCount = aFoundRecipe.mInputs.length;
for (int i = 0; i < 15; i++) {
- int count = tTag.getInteger("a" + i);
- if (!tTag.hasKey("" + i) && count <= 0)
- continue;
- if (mInputBusses.get(i) == null) {
- continue nextDS;
- }
-
- ItemStack stackInSlot = mInputBusses.get(i).getBaseMetaTileEntity().getStackInSlot(0);
- boolean flag = true;
- if (count > 0) {
- for (int j = 0; j < count; j++) {
- tStack[i] = GT_Utility.loadItem(tTag, "a" + i + ":" + j);
- if (tStack[i] == null) continue;
- if (GT_Values.D1)
- GT_FML_LOGGER.info("Item " + i + " : " + tStack[i].getUnlocalizedName());
- if (GT_Utility.areStacksEqual(tStack[i], stackInSlot, true) && tStack[i].stackSize <= stackInSlot.stackSize) {
- flag = false;
- break;
- }
- }
- }
- if (flag) {
- tStack[i] = GT_Utility.loadItem(tTag, "" + i);
- if (tStack[i] == null) {
- flag = false;
- continue;
- }
- if (GT_Values.D1)
- GT_FML_LOGGER.info("Item " + i + " : " + tStack[i].getUnlocalizedName());
- if (GT_Utility.areStacksEqual(tStack[i], stackInSlot, true) && tStack[i].stackSize <= stackInSlot.stackSize) {
- flag = false;
+ if (i >= aItemCount) {
+ continue;
+ }
+ else {
+ if (mInputBusses.get(i) == null) {
+ continue nextDataStick;
}
- }
- if (GT_Values.D1)
- GT_FML_LOGGER.info(i + (flag ? " not accepted" : " accepted"));
- if (flag)
- continue nextDS;
- }
-
- if (GT_Values.D1) GT_FML_LOGGER.info("All Items done, start fluid check");
- for (int i = 0; i < 4; i++) {
- if (!tTag.hasKey("f" + i)) continue;
- tFluids[i] = GT_Utility.loadFluid(tTag, "f" + i);
- if (tFluids[i] == null) continue;
- if (GT_Values.D1)
- GT_FML_LOGGER.info("Fluid " + i + " " + tFluids[i].getUnlocalizedName());
- if (mInputHatches.get(i) == null) {
- continue nextDS;
- }
- FluidStack fluidInHatch = mInputHatches.get(i).mFluid;
- if (!GT_Utility.areFluidsEqual(fluidInHatch, tFluids[i], true) || fluidInHatch.amount < tFluids[i].amount) {
- if (GT_Values.D1)
- GT_FML_LOGGER.info(i + " not accepted");
- continue nextDS;
- }
- if (GT_Values.D1)
- GT_FML_LOGGER.info(i + " accepted");
- }
-
- if (GT_Values.D1)
- GT_FML_LOGGER.info("Input accepted, check other values");
- if (!tTag.hasKey("output"))
- continue;
- mOutputItems = new ItemStack[]{GT_Utility.loadItem(tTag, "output")};
- if (mOutputItems[0] == null || !GT_Utility.isStackValid(mOutputItems[0]))
- continue;
-
- if (!tTag.hasKey("time"))
- continue;
- int tMaxProgressTime = tTag.getInteger("time");
- if (tMaxProgressTime <= 0)
- continue;
-
- if (!tTag.hasKey("eu"))
- continue;
-
- if (GT_Values.D1) GT_FML_LOGGER.info("Check overclock");
-
- calculateOverclockedNessMulti(tTag.getInteger("eu"), tMaxProgressTime, 1, getMaxInputVoltage());
- //In case recipe is too OP for that machine
- if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) {
- if (GT_Values.D1) GT_FML_LOGGER.info("Recipe too OP");
- continue;
+ else {
+ ItemStack stackInSlot = mInputBusses.get(i).getBaseMetaTileEntity().getStackInSlot(0);
+ if (!GT_Utility.areStacksEqual(tStack[i], stackInSlot, true) || tStack[i].stackSize <= stackInSlot.stackSize) {
+ continue nextDataStick;
+ }
+ if (GT_Values.D1) {
+ GT_FML_LOGGER.info("Item: " + i + " accepted");
+ }
+ }
+ }
}
-
- if (GT_Values.D1) GT_FML_LOGGER.info("Find avaiable recipe");
- // Check data stick is valid.
- if (GT_AssemblyLineUtils.processDataStick(tDataStick)) {
- findRecipe = true;
+ // Check Fluid Inputs allign
+ int aFluidCount = aFoundRecipe.mFluidInputs.length;
+ for (int i = 0; i < 4; i++){
+ if (i >= aFluidCount) {
+ continue;
+ }
+ else {
+ if (mInputHatches.get(i) == null) {
+ continue nextDataStick;
+ }
+ else {
+ FluidStack fluidInHatch = mInputHatches.get(i).mFluid;
+ if (!GT_Utility.areFluidsEqual(fluidInHatch, tFluids[i], true) || fluidInHatch.amount < tFluids[i].amount) {
+ continue nextDataStick;
+ }
+ if (GT_Values.D1) {
+ GT_FML_LOGGER.info("Fluid:" + i + " accepted");
+ }
+ }
+ }
}
-
- break;
+
+ if (GT_Values.D1) {
+ GT_FML_LOGGER.info("Check overclock");
+ }
+ calculateOverclockedNessMulti(aFoundRecipe.mEUt, aFoundRecipe.mDuration, 1, getMaxInputVoltage());
+ //In case recipe is too OP for that machine
+ if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) {
+ if (GT_Values.D1) {
+ GT_FML_LOGGER.info("Recipe too OP");
+ }
+ continue;
+ }
+ if (GT_Values.D1) {
+ GT_FML_LOGGER.info("Find available recipe");
+ }
+ findRecipe = true;
+ }
+
+ // Best not to run this recipe.
+ if (!findRecipe || tStack == null || tStack.length <= 0 || tFluids == null || tFluids.length <= 0) {
+ return false;
}
- if (!findRecipe) return false;
- if (GT_Values.D1) GT_FML_LOGGER.info("All checked start consuming inputs");
+ if (GT_Values.D1) {
+ GT_FML_LOGGER.info("All checked start consuming inputs");
+ }
for (int i = 0; i < 15; i++) {
- if (tStack[i] == null)
- continue;
+ if (tStack[i] == null) {
+ continue;
+ }
ItemStack stackInSlot = mInputBusses.get(i).getBaseMetaTileEntity().getStackInSlot(0);
stackInSlot.stackSize -= tStack[i].stackSize;
}
@@ -287,13 +276,15 @@ public class GT_MetaTileEntity_AssemblyLine extends GT_MetaTileEntity_EnhancedMu
}
}
- if (this.mEUt > 0)
- this.mEUt = -this.mEUt;
+ if (this.mEUt > 0) {
+ this.mEUt = -this.mEUt;
+ }
this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
this.mEfficiencyIncrease = 10000;
updateSlots();
- if (GT_Values.D1)
- GT_FML_LOGGER.info("Recipe sucessfull");
+ if (GT_Values.D1) {
+ GT_FML_LOGGER.info("Recipe sucessfull");
+ }
return true;
}