aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api
diff options
context:
space:
mode:
authorDream-Master <dream-master@gmx.net>2018-09-01 23:29:18 +0200
committerDream-Master <dream-master@gmx.net>2018-09-01 23:29:18 +0200
commit03b4933a315d8607228d6ef513950eef0859646a (patch)
tree19f89321ed3b573843f10d3199cee06842ba1cee /src/main/java/gregtech/api
parent20d16111a6acc6523c8735dc9d3f626de09cbba7 (diff)
parenta5ec7adb43dd4ace210eb9f034b6453bf6683e21 (diff)
downloadGT5-Unofficial-03b4933a315d8607228d6ef513950eef0859646a.tar.gz
GT5-Unofficial-03b4933a315d8607228d6ef513950eef0859646a.tar.bz2
GT5-Unofficial-03b4933a315d8607228d6ef513950eef0859646a.zip
Merge branch 'experimental' into High_tier_circuits_dev
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 9f850c4ef2..17f1ef81a3 100644
--- a/src/main/java/gregtech/api/util/GT_Recipe.java
+++ b/src/main/java/gregtech/api/util/GT_Recipe.java
@@ -1602,12 +1602,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;
}