From b07755e2d09837fd2f2a0f2790caa319424dad29 Mon Sep 17 00:00:00 2001 From: MATRIX-feather Date: Fri, 20 Dec 2024 17:32:51 +0800 Subject: [PATCH] fix: RecipeManager throws 'Cannot get key of Legacy Material' when looking up Material from ID --- .../xyz/nifeather/morph/misc/recipe/RecipeManager.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/xyz/nifeather/morph/misc/recipe/RecipeManager.java b/src/main/java/xyz/nifeather/morph/misc/recipe/RecipeManager.java index bc660633..69fe1a82 100644 --- a/src/main/java/xyz/nifeather/morph/misc/recipe/RecipeManager.java +++ b/src/main/java/xyz/nifeather/morph/misc/recipe/RecipeManager.java @@ -66,8 +66,11 @@ private Material getMaterialFrom(String str) { var key = NamespacedKey.fromString(str); - return Arrays.stream(Material.values()).parallel().filter(m -> m.key().equals(key)) - .findFirst().orElse(null); + return Arrays.stream(Material.values()) + .parallel() + .filter(m -> !m.isLegacy() && m.key().equals(key)) + .findFirst() + .orElse(null); } @NotNull