Fixed enchant support in crafting recipes
This commit is contained in:
@@ -70,7 +70,7 @@ public final class Items {
|
||||
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 final class Items {
|
||||
requiredEnchantments.put(enchantment, level);
|
||||
}
|
||||
|
||||
if (requiredEnchantments.isEmpty()) {
|
||||
return item;
|
||||
}
|
||||
|
||||
ItemBuilder builder = new ItemStackBuilder(item.getItem());
|
||||
requiredEnchantments.forEach(builder::addEnchantment);
|
||||
ItemStack example = builder.build();
|
||||
|
||||
Reference in New Issue
Block a user