Search in sources :

Example 1 with ItemFlag

use of org.bukkit.inventory.ItemFlag in project Denizen-For-Bukkit by DenizenScript.

the class ItemFlags method flags.

public dList flags() {
    dList output = new dList();
    ItemStack itemStack = item.getItemStack();
    if (itemStack.hasItemMeta()) {
        for (ItemFlag flag : itemStack.getItemMeta().getItemFlags()) {
            output.add(flag.name());
        }
    }
    return output;
}
Also used : net.aufdemrand.denizencore.objects.dList(net.aufdemrand.denizencore.objects.dList) ItemStack(org.bukkit.inventory.ItemStack) ItemFlag(org.bukkit.inventory.ItemFlag)

Example 2 with ItemFlag

use of org.bukkit.inventory.ItemFlag in project Glowstone by GlowstoneMC.

the class GlowMetaItem method getItemFlags.

@Override
public Set<ItemFlag> getItemFlags() {
    Set<ItemFlag> currentFlags = EnumSet.noneOf(ItemFlag.class);
    ItemFlag[] values;
    for (int length = (values = ItemFlag.values()).length, i = 0; i < length; ++i) {
        ItemFlag f = values[i];
        if (hasItemFlag(f)) {
            currentFlags.add(f);
        }
    }
    return currentFlags;
}
Also used : ItemFlag(org.bukkit.inventory.ItemFlag)

Aggregations

ItemFlag (org.bukkit.inventory.ItemFlag)2 net.aufdemrand.denizencore.objects.dList (net.aufdemrand.denizencore.objects.dList)1 ItemStack (org.bukkit.inventory.ItemStack)1