From 89f71e7a29b411618857b5746a268a139356cafd Mon Sep 17 00:00:00 2001 From: thedarkcolour <30441001+thedarkcolour@users.noreply.github.com> Date: Sun, 31 May 2026 17:17:32 -0700 Subject: [PATCH] Fixed Sieve and Hammer recipes not properly reporting missing `result_amount` Closes #184 --- changelog.md | 1 + .../java/thedarkcolour/exdeorum/recipe/RecipeUtil.java | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) 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) {