Skip to content

Commit f7e78c4

Browse files
authored
Merge pull request #58 from quat1024/complain-about-remainders
Complain when mods return null from getCraftingRemainingItem instead of crashing
2 parents 758a38b + fffe9b1 commit f7e78c4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/main/java/org/violetmoon/zeta/util/handler/RecipeCrawlHandler.java

+9-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,15 @@ private static void digest(Recipe<?> recipe, RegistryAccess access) {
156156
for (Ingredient ingredient : ingredients) {
157157
for (ItemStack inStack : ingredient.getItems()) {
158158
//don't include catalyst items. This includes partial ones like buckets and such
159-
if (inStack.getCraftingRemainingItem().isEmpty()) {
159+
ItemStack remaining = inStack.getCraftingRemainingItem();
160+
161+
if(remaining == null) {
162+
//sigh. let's at least not make this into our problem
163+
ZetaMod.LOGGER.error("Item {} returned NULL from getCraftingRemainingItem. This is wrong and will cause problems down the line", inStack.getItem());
164+
continue;
165+
}
166+
167+
if (remaining.isEmpty()) {
160168
vanillaRecipeDigestion.put(inStack.getItem(), out);
161169
backwardsVanillaDigestion.put(outItem, inStack);
162170
}

0 commit comments

Comments
 (0)