/** * Set the ItemMeta of this ItemStack. * * @param itemMeta new ItemMeta, or null to indicate meta data be cleared. * @return True if successfully applied ItemMeta, see {@link * ItemFactory#isApplicable(ItemMeta, ItemStack)} * @throws IllegalArgumentException if the item meta was not created by * the {@link ItemFactory} */ public boolean setItemMeta(ItemMeta itemMeta) { return setItemMeta0(itemMeta, getType0()); }
/** * Creates a new item stack derived from the specified stack * * @param stack the stack to copy * @throws IllegalArgumentException if the specified stack is null or * returns an item meta not created by the item factory */ public ItemStack(final ItemStack stack) throws IllegalArgumentException { Validate.notNull(stack, "Cannot copy null stack"); this.type = stack.getTypeId(); this.amount = stack.getAmount(); this.durability = stack.getDurability(); this.data = stack.getData(); if (stack.hasItemMeta()) { setItemMeta0(stack.getItemMeta(), getType0()); } }
/** * Set the ItemMeta of this ItemStack. * * @param itemMeta new ItemMeta, or null to indicate meta data be cleared. * @return True if successfully applied ItemMeta, see {@link * ItemFactory#isApplicable(ItemMeta, ItemStack)} * @throws IllegalArgumentException if the item meta was not created by * the {@link ItemFactory} */ public boolean setItemMeta(ItemMeta itemMeta) { return setItemMeta0(itemMeta, getType0()); }
/** * Creates a new item stack derived from the specified stack * * @param stack the stack to copy * @throws IllegalArgumentException if the specified stack is null or * returns an item meta not created by the item factory */ public ItemStack(final ItemStack stack) throws IllegalArgumentException { Validate.notNull(stack, "Cannot copy null stack"); this.type = stack.getTypeId(); this.amount = stack.getAmount(); this.durability = stack.getDurability(); this.data = stack.getData(); if (stack.hasItemMeta()) { setItemMeta0(stack.getItemMeta(), getType0()); } }