aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api
diff options
context:
space:
mode:
authorbartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>2018-08-31 04:23:47 +0200
committerbartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>2018-08-31 04:23:47 +0200
commit4f73acc83a6e7c051efa4393d3734155c287c669 (patch)
tree5d7f044f297bdca08540421a7231ecab3689dc38 /src/main/java/gregtech/api
parent9a31bb81bfe903af44d55fb2870ae996a42f32bd (diff)
downloadGT5-Unofficial-4f73acc83a6e7c051efa4393d3734155c287c669.tar.gz
GT5-Unofficial-4f73acc83a6e7c051efa4393d3734155c287c669.tar.bz2
GT5-Unofficial-4f73acc83a6e7c051efa4393d3734155c287c669.zip
added config option to allow broken recipe map for debug purposes
Diffstat (limited to 'src/main/java/gregtech/api')
-rw-r--r--src/main/java/gregtech/api/enums/GT_Values.java5
-rw-r--r--src/main/java/gregtech/api/util/GT_Recipe.java27
2 files changed, 29 insertions, 3 deletions
diff --git a/src/main/java/gregtech/api/enums/GT_Values.java b/src/main/java/gregtech/api/enums/GT_Values.java
index ca3fe505bf..f36ea881d8 100644
--- a/src/main/java/gregtech/api/enums/GT_Values.java
+++ b/src/main/java/gregtech/api/enums/GT_Values.java
@@ -170,4 +170,9 @@ public class GT_Values {
* If you have to give something a World Parameter but there is no World... (Dummy World)
*/
public static World DW;
+
+ /**
+ * This will prevent NEI from crashing but spams the Log.
+ */
+ public static boolean allow_broken_recipemap = false;
}
diff --git a/src/main/java/gregtech/api/util/GT_Recipe.java b/src/main/java/gregtech/api/util/GT_Recipe.java
index ea8294d834..d32516912f 100644
--- a/src/main/java/gregtech/api/util/GT_Recipe.java
+++ b/src/main/java/gregtech/api/util/GT_Recipe.java
@@ -1601,12 +1601,33 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
ArrayList<PositionedStack> inputStacks = new ArrayList<PositionedStack>(inputlimit);
for (int i = 0; i < itemLimit; i++, j++) {
- inputStacks.add(new FixedPositionedStack(this.mInputs[i].copy(), 48 - j%3 * 18, (j >= 3 ? 5 : 23) ));
+ if (GT_Values.allow_broken_recipemap) {
+ if (this != null && this.mInputs != null && this.mInputs[i] != null)
+ inputStacks.add(new FixedPositionedStack(this.mInputs[i].copy(), 48 - j % 3 * 18, (j >= 3 ? 5 : 23)));
+ else {
+ if (this.mOutputs != null && this.mOutputs[0] != null)
+ GT_Log.out.println("recipe " + this.toString() + " Output 0:" + this.mOutputs[0].getDisplayName() + " has errored!");
+ else
+ GT_Log.out.println("recipe " + this.toString() + " has errored!");
+ inputStacks.add(new FixedPositionedStack(new ItemStack(Items.command_block_minecart), 48 - j % 3 * 18, (j >= 3 ? 5 : 23)));
+ }
+ }else
+ inputStacks.add(new FixedPositionedStack(this.mInputs[i].copy(), 48 - j % 3 * 18, (j >= 3 ? 5 : 23)));
}
for (int i = 0; i < fluidLimit; i++, j++) {
- inputStacks.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(this.mFluidInputs[i], true), 48 - j%3 * 18, (j >= 3 ? 5 : 23)));
- }
+ if (GT_Values.allow_broken_recipemap) {
+ if (this != null && this.mFluidInputs != null && this.mFluidInputs[i] != null)
+ inputStacks.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(this.mFluidInputs[i], true), 48 - j % 3 * 18, (j >= 3 ? 5 : 23)));
+ else {
+ if (this.mOutputs != null && this.mOutputs[0] != null)
+ GT_Log.out.println("recipe " + this.toString() + " Output 0:" + this.mOutputs[0].getDisplayName() + " has errored!");
+ else
+ GT_Log.out.println("recipe " + this.toString() + " has errored!");
+ }
+ }else
+ inputStacks.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(this.mFluidInputs[i], true), 48 - j % 3 * 18, (j >= 3 ? 5 : 23)));
+ }
return inputStacks;
}