From 54529f60b1c074c4126944834769edfee7742744 Mon Sep 17 00:00:00 2001 From: rlnt Date: Tue, 22 Oct 2024 14:38:15 +0200 Subject: [PATCH] add logging for recipes with invalid recipe type --- CHANGELOG.md | 3 ++- .../unified/unification/recipe/RecipeJsonImpl.java | 2 +- .../almostreliable/unified/unification/recipe/RecipeLink.java | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6fdd37..de5b032 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,8 @@ All notable changes to this project will be documented in this file. ## Unreleased -- added better logging for cases where items are assigned to multiple unification tags +- added logging for cases where items are assigned to multiple unification tags +- added logging for cases where the recipe type can't be found - added Turkish translation ([#102](https://github.com/AlmostReliable/almostunified/pull/102)) - fixed crash when runtime isn't loaded ([#101](https://github.com/AlmostReliable/almostunified/issues/101)) - fixed newly created custom tags not being considered for unification diff --git a/Common/src/main/java/com/almostreliable/unified/unification/recipe/RecipeJsonImpl.java b/Common/src/main/java/com/almostreliable/unified/unification/recipe/RecipeJsonImpl.java index 5a40cae..6246fe0 100644 --- a/Common/src/main/java/com/almostreliable/unified/unification/recipe/RecipeJsonImpl.java +++ b/Common/src/main/java/com/almostreliable/unified/unification/recipe/RecipeJsonImpl.java @@ -28,7 +28,7 @@ public class RecipeJsonImpl implements RecipeJson { try { return ResourceLocation.parse(json.get("type").getAsString()); } catch (Exception e) { - throw new IllegalArgumentException("could not detect recipe type"); + throw new IllegalArgumentException("could not detect recipe type for recipe " + id); } } diff --git a/Common/src/main/java/com/almostreliable/unified/unification/recipe/RecipeLink.java b/Common/src/main/java/com/almostreliable/unified/unification/recipe/RecipeLink.java index 42fa990..857b8ec 100644 --- a/Common/src/main/java/com/almostreliable/unified/unification/recipe/RecipeLink.java +++ b/Common/src/main/java/com/almostreliable/unified/unification/recipe/RecipeLink.java @@ -29,7 +29,7 @@ public class RecipeLink implements RecipeData { try { this.type = ResourceLocation.parse(originalRecipe.get("type").getAsString()); } catch (Exception e) { - throw new IllegalArgumentException("could not detect recipe type"); + throw new IllegalArgumentException("could not detect recipe type for recipe " + id); } }