Commits

Fabian Faßbender authored and md_5 committed 66c832f8ca3
API for setting/removing hideflags on ItemStacks
No tags

src/main/java/org/bukkit/inventory/meta/ItemMeta.java

Modified
1 1 package org.bukkit.inventory.meta;
2 2
3 3 import java.util.List;
4 4 import java.util.Map;
5 +import java.util.Set;
5 6
6 7 import org.bukkit.configuration.serialization.ConfigurationSerializable;
7 8 import org.bukkit.enchantments.Enchantment;
9 +import org.bukkit.inventory.ItemFlag;
8 10
9 11 /**
10 12 * This type represents the storage mechanism for auxiliary item data.
11 13 * <p>
12 14 * An implementation will handle the creation and application for ItemMeta.
13 15 * This class should not be implemented by a plugin in a live environment.
14 16 */
15 17 public interface ItemMeta extends Cloneable, ConfigurationSerializable {
16 18
17 19 /**
117 119
118 120 /**
119 121 * Checks if the specified enchantment conflicts with any enchantments in
120 122 * this ItemMeta.
121 123 *
122 124 * @param ench enchantment to test
123 125 * @return true if the enchantment conflicts, false otherwise
124 126 */
125 127 boolean hasConflictingEnchant(Enchantment ench);
126 128
129 + /**
130 + * Set itemflags which should be ignored when rendering a ItemStack in the Client. This Method does silently ignore double set itemFlags.
131 + *
132 + * @param itemFlags The hideflags which shouldn't be rendered
133 + */
134 + void addItemFlags(ItemFlag... itemFlags);
135 +
136 + /**
137 + * Remove specific set of itemFlags. This tells the Client it should render it again. This Method does silently ignore double removed itemFlags.
138 + *
139 + * @param itemFlags Hideflags which should be removed
140 + */
141 + void removeItemFlags(ItemFlag... itemFlags);
142 +
143 + /**
144 + * Get current set itemFlags. The collection returned is unmodifiable.
145 + *
146 + * @return A set of all itemFlags set
147 + */
148 + Set<ItemFlag> getItemFlags();
149 +
150 + /**
151 + * Check if the specified flag is present on this item.
152 + *
153 + * @param flag the flag to check
154 + * @return if it is present
155 + */
156 + boolean hasItemFlag(ItemFlag flag);
157 +
127 158 @SuppressWarnings("javadoc")
128 159 ItemMeta clone();
129 160 }

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut