mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 11:05:40 +00:00
Fix uncaught ClassCastException from invalid recipe file (#4043)
A JsonSyntaxException will now be thrown, caught and logged when the conditions property of a recipe isn't an array
This commit is contained in:
1 parent
f670ec4f0b
commit
cb02f24cf2
2 files changed
+22
-1
No files matched your search
@@ -735,7 +735,7 @@ public class CraftingHelper {
|
||||
{
|
||||
reader = Files.newBufferedReader(f);
|
||||
JsonObject json = JsonUtils.fromJson(GSON, reader, JsonObject.class);
|
||||
if (json.has("conditions") && !CraftingHelper.processConditions(json.getAsJsonArray("conditions"), ctx))
|
||||
if (json.has("conditions") && !CraftingHelper.processConditions(JsonUtils.getJsonArray(json, "conditions"), ctx))
|
||||
continue;
|
||||
IRecipe recipe = CraftingHelper.getRecipe(json, ctx);
|
||||
ForgeRegistries.RECIPES.register(recipe.setRegistryName(key));
|
||||
|
||||
Reference in new issue
Block a user