Search in sources :

Example 1 with ItemEnchantment

use of pl.themolka.arcade.item.ItemEnchantment in project Arcade2 by ShootGame.

the class EnchantmentStorageMetaParser method parse.

@Override
public EnchantmentStorageMeta parse(Node root, ItemStack itemStack, EnchantmentStorageMeta itemMeta) throws ParserException {
    Node node = root.firstChild("enchanted-book");
    if (node != null) {
        for (Node enchantment : node.children("enchantment")) {
            ItemEnchantment value = this.enchantmentParser.parse(enchantment).orFail();
            itemMeta.addStoredEnchant(value.getType(), value.getLevel(), true);
        }
    }
    return itemMeta;
}
Also used : ItemEnchantment(pl.themolka.arcade.item.ItemEnchantment) Node(pl.themolka.arcade.dom.Node)

Aggregations

Node (pl.themolka.arcade.dom.Node)1 ItemEnchantment (pl.themolka.arcade.item.ItemEnchantment)1