aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/util
diff options
context:
space:
mode:
authorGlease <4586901+Glease@users.noreply.github.com>2022-03-28 23:19:52 +0800
committerGitHub <noreply@github.com>2022-03-28 17:19:52 +0200
commit31be1f73d6e6e3fb599e9470176269cadb83742f (patch)
tree8e1edc0a36a1c44c4d3a9dfe86c028697e363c3f /src/main/java/gregtech/api/util
parent148873802933b807a47c0c09df237fed071d57b1 (diff)
downloadGT5-Unofficial-31be1f73d6e6e3fb599e9470176269cadb83742f.tar.gz
GT5-Unofficial-31be1f73d6e6e3fb599e9470176269cadb83742f.tar.bz2
GT5-Unofficial-31be1f73d6e6e3fb599e9470176269cadb83742f.zip
Add a sanity check to catch invalid assline recipes (#995)
Diffstat (limited to 'src/main/java/gregtech/api/util')
-rw-r--r--src/main/java/gregtech/api/util/GT_Recipe.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main/java/gregtech/api/util/GT_Recipe.java b/src/main/java/gregtech/api/util/GT_Recipe.java
index 63f46e2c1e..2a0733420f 100644
--- a/src/main/java/gregtech/api/util/GT_Recipe.java
+++ b/src/main/java/gregtech/api/util/GT_Recipe.java
@@ -558,6 +558,20 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
public static class GT_Recipe_AssemblyLine{
public static final ArrayList<GT_Recipe_AssemblyLine> sAssemblylineRecipes = new ArrayList<GT_Recipe_AssemblyLine>();
+ static {
+ GregTech_API.sFirstWorldTick.add(GT_Recipe_AssemblyLine::checkInvalidRecipes);
+ }
+
+ private static void checkInvalidRecipes() {
+ boolean foundInvalid = false;
+ for (GT_Recipe_AssemblyLine recipe : sAssemblylineRecipes) {
+ if (recipe.getPersistentHash() == 0)
+ foundInvalid = true;
+ }
+ if (foundInvalid)
+ throw new RuntimeException("There are invalid assembly line recipes! Check logs for details!");
+ }
+
public ItemStack mResearchItem;
public int mResearchTime;
public ItemStack[] mInputs;