summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/org/bukkit/inventory/ItemFlag.java32
-rw-r--r--src/main/java/org/bukkit/inventory/meta/ItemMeta.java31
2 files changed, 63 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/inventory/ItemFlag.java b/src/main/java/org/bukkit/inventory/ItemFlag.java
new file mode 100644
index 00000000..2a8af7ba
--- /dev/null
+++ b/src/main/java/org/bukkit/inventory/ItemFlag.java
@@ -0,0 +1,32 @@
+package org.bukkit.inventory;
+
+/**
+ * A ItemFlag can hide some Attributes from ItemStacks
+ */
+public enum ItemFlag {
+
+ /**
+ * Setting to show/hide enchants
+ */
+ HIDE_ENCHANTS,
+ /**
+ * Setting to show/hide Attributes like Damage
+ */
+ HIDE_ATTRIBUTES,
+ /**
+ * Setting to show/hide the unbreakable State
+ */
+ HIDE_UNBREAKABLE,
+ /**
+ * Setting to show/hide what the ItemStack can break/destroy
+ */
+ HIDE_DESTROYS,
+ /**
+ * Setting to show/hide where this ItemStack can be build/placed on
+ */
+ HIDE_PLACED_ON,
+ /**
+ * Setting to show/hide potion effects on this ItemStack
+ */
+ HIDE_POTION_EFFECTS;
+}
diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
index 00f71ce2..459e09ca 100644
--- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
@@ -2,9 +2,11 @@ package org.bukkit.inventory.meta;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.bukkit.enchantments.Enchantment;
+import org.bukkit.inventory.ItemFlag;
/**
* This type represents the storage mechanism for auxiliary item data.
@@ -124,6 +126,35 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable {
*/
boolean hasConflictingEnchant(Enchantment ench);
+ /**
+ * Set itemflags which should be ignored when rendering a ItemStack in the Client. This Method does silently ignore double set itemFlags.
+ *
+ * @param itemFlags The hideflags which shouldn't be rendered
+ */
+ void addItemFlags(ItemFlag... itemFlags);
+
+ /**
+ * Remove specific set of itemFlags. This tells the Client it should render it again. This Method does silently ignore double removed itemFlags.
+ *
+ * @param itemFlags Hideflags which should be removed
+ */
+ void removeItemFlags(ItemFlag... itemFlags);
+
+ /**
+ * Get current set itemFlags. The collection returned is unmodifiable.
+ *
+ * @return A set of all itemFlags set
+ */
+ Set<ItemFlag> getItemFlags();
+
+ /**
+ * Check if the specified flag is present on this item.
+ *
+ * @param flag the flag to check
+ * @return if it is present
+ */
+ boolean hasItemFlag(ItemFlag flag);
+
@SuppressWarnings("javadoc")
ItemMeta clone();
}