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();