Search in sources :

Example 1 with ItemAttributeModifier

use of org.bukkit.attribute.ItemAttributeModifier in project Arcade2 by ShootGame.

the class BoundedItemModifierParser method parseNode.

@Override
protected ParserResult<BoundedItemModifier> parseNode(Node node, String name, String value) throws ParserException {
    AttributeKey key = this.keyParser.parse(node.property("attribute", "attribute-key", "attributekey", "attr", "key")).orFail();
    ItemAttributeModifier itemModifier = this.itemModifierParser.parseWithDefinition(node, name, value).orFail();
    return ParserResult.fine(node, name, value, new BoundedItemModifier(key, itemModifier));
}
Also used : ItemAttributeModifier(org.bukkit.attribute.ItemAttributeModifier)

Example 2 with ItemAttributeModifier

use of org.bukkit.attribute.ItemAttributeModifier in project Arcade2 by ShootGame.

the class ItemAttributeModifierParser method parseNode.

@Override
protected ParserResult<ItemAttributeModifier> parseNode(Node node, String name, String value) throws ParserException {
    EquipmentSlot slot = this.slotParser.parse(node.property("slot", "equipment-slot", "equipmentslot")).orDefaultNull();
    AttributeModifier modifier = this.modifierParser.parseWithDefinition(node, name, value).orFail();
    return ParserResult.fine(node, name, value, new ItemAttributeModifier(slot, modifier));
}
Also used : EquipmentSlot(org.bukkit.inventory.EquipmentSlot) ItemAttributeModifier(org.bukkit.attribute.ItemAttributeModifier) AttributeModifier(org.bukkit.attribute.AttributeModifier) ItemAttributeModifier(org.bukkit.attribute.ItemAttributeModifier)

Aggregations

ItemAttributeModifier (org.bukkit.attribute.ItemAttributeModifier)2 AttributeModifier (org.bukkit.attribute.AttributeModifier)1 EquipmentSlot (org.bukkit.inventory.EquipmentSlot)1