diff options
author | Glease <4586901+Glease@users.noreply.github.com> | 2022-03-28 23:19:52 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-28 17:19:52 +0200 |
commit | 31be1f73d6e6e3fb599e9470176269cadb83742f (patch) | |
tree | 8e1edc0a36a1c44c4d3a9dfe86c028697e363c3f /src/main/java | |
parent | 148873802933b807a47c0c09df237fed071d57b1 (diff) | |
download | GT5-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')
-rw-r--r-- | src/main/java/gregtech/api/util/GT_Recipe.java | 14 |
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; |