From c36c0c247faa82e0af0793dd39c988a6ea0d4190 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Mon, 26 Jul 2021 19:02:11 +0100 Subject: [PATCH] Fixed enchant support in crafting recipes --- eco-api/src/main/java/com/willfp/eco/core/items/Items.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/eco-api/src/main/java/com/willfp/eco/core/items/Items.java b/eco-api/src/main/java/com/willfp/eco/core/items/Items.java index 6bc6b0c24..c5afa65ae 100644 --- a/eco-api/src/main/java/com/willfp/eco/core/items/Items.java +++ b/eco-api/src/main/java/com/willfp/eco/core/items/Items.java @@ -70,7 +70,7 @@ public TestableItem lookup(@NotNull final String key) { String[] split = args[0].toLowerCase().split(":"); if (split.length == 1) { - Material material = Material.getMaterial(key.toUpperCase()); + Material material = Material.getMaterial(args[0].toUpperCase()); if (material == null || material == Material.AIR) { return new EmptyTestableItem(); } @@ -113,6 +113,10 @@ public TestableItem lookup(@NotNull final String key) { requiredEnchantments.put(enchantment, level); } + if (requiredEnchantments.isEmpty()) { + return item; + } + ItemBuilder builder = new ItemStackBuilder(item.getItem()); requiredEnchantments.forEach(builder::addEnchantment); ItemStack example = builder.build();