Fixed Sieve and Hammer recipes not properly reporting missing result_amount

Closes #184
This commit is contained in:
thedarkcolour 2026-05-31 17:17:32 -07:00
parent 67079effd7
commit 89f71e7a29
2 changed files with 9 additions and 1 deletions

View File

@ -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)

View File

@ -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) {