public void SetTypeId(int type) { this.type = type; if (this.meta != null) { this.meta = Bukkit.ItemFactory.asMetaFor(meta, GetType0()); } CreateData((byte)0); }
private bool SetItemMeta0(IItemMeta itemMeta, Material material) { if (itemMeta == null) { this.meta = null; return(true); } if (!Bukkit.ItemFactory.IsApplicable(itemMeta, material)) { return(false); } this.meta = Bukkit.ItemFactory.AsMetaFor(itemMeta, material); if (this.meta == itemMeta) { this.meta = itemMeta.Clone(); } return(true); }
public bool SetItemMeta(IItemMeta itemMeta) { return(SetItemMeta0(itemMeta, GetType0())); }
public void AddUnsafeEnchantment(Enchantment ench, int level) { (meta == null ? meta = Bukkit.ItemFactory.GetItemMeta(GetType0()) : meta).AddEnchant(ench, level, true); }