+ * IMPORTANT: An ItemStack is only designed to contain items. Do not + * use this class to encapsulate Materials for which {@link Material#isItem()} + * returns false. */ public class ItemStack implements Cloneable, ConfigurationSerializable { private Material type = Material.AIR; @@ -28,7 +32,11 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { protected ItemStack() {} /** - * Defaults stack size to 1, with no extra data + * Defaults stack size to 1, with no extra data. + *
+ * IMPORTANT: An ItemStack is only designed to contain + * items. Do not use this class to encapsulate Materials for which + * {@link Material#isItem()} returns false. * * @param type item material */ @@ -37,7 +45,11 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { } /** - * An item stack with no extra data + * An item stack with no extra data. + *
+ * IMPORTANT: An ItemStack is only designed to contain + * items. Do not use this class to encapsulate Materials for which + * {@link Material#isItem()} returns false. * * @param type item material * @param amount stack size @@ -109,7 +121,11 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { /** * Sets the type of this item *
- * Note that in doing so you will reset the MaterialData for this stack + * Note that in doing so you will reset the MaterialData for this stack. + *
+ * IMPORTANT: An ItemStack is only designed to contain + * items. Do not use this class to encapsulate Materials for which + * {@link Material#isItem()} returns false. * * @param type New type to set the items in this stack to */