diff --git a/changelog.md b/changelog.md index 6f93ebe4..14347206 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ ## Ex Deorum 1.50 - Fixed Crucible bug where pending solids could be converted to another fluid while tank was empty (#180) +- Fixed Sieve and Hammer recipes not properly reporting missing `result_amount` (#184) ## Ex Deorum 1.49 - Fixed more issues with _Thirst Was Taken_, thanks to pawjwp (#170) diff --git a/src/main/java/thedarkcolour/exdeorum/recipe/RecipeUtil.java b/src/main/java/thedarkcolour/exdeorum/recipe/RecipeUtil.java index 7ff49f3f..fea0a712 100644 --- a/src/main/java/thedarkcolour/exdeorum/recipe/RecipeUtil.java +++ b/src/main/java/thedarkcolour/exdeorum/recipe/RecipeUtil.java @@ -210,7 +210,14 @@ public final class RecipeUtil { public static NumberProvider readNumberProvider(JsonObject json, String key) { var obj = json.get(key); - return LootDataType.PREDICATE.parser().fromJson(obj, NumberProvider.class); + if (obj == null || obj.isJsonNull()) { + throw new JsonSyntaxException("Missing required \"" + key + "\" number provider"); + } + var provider = LootDataType.PREDICATE.parser().fromJson(obj, NumberProvider.class); + if (provider == null) { + throw new JsonSyntaxException("Invalid \"" + key + "\" number provider: " + obj); + } + return provider; } public static void toNetworkNumberProvider(FriendlyByteBuf buffer, NumberProvider provider) {