/// <summary> /// Set the specified armor model as the player model. Args: player, armorSlot, partialTick /// </summary> protected virtual int SetArmorModel(EntityPlayer par1EntityPlayer, int par2, float par3) { ItemStack itemstack = par1EntityPlayer.Inventory.ArmorItemInSlot(3 - par2); if (itemstack != null) { Item item = itemstack.GetItem(); if (item is ItemArmor) { ItemArmor itemarmor = (ItemArmor)item; LoadTexture((new StringBuilder()).Append("/armor/").Append(ArmorFilenamePrefix[itemarmor.RenderIndex]).Append("_").Append(par2 != 2 ? 1 : 2).Append(".png").ToString()); ModelBiped modelbiped = par2 != 2 ? ModelArmorChestplate : ModelArmor; modelbiped.BipedHead.ShowModel = par2 == 0; modelbiped.BipedHeadwear.ShowModel = par2 == 0; modelbiped.BipedBody.ShowModel = par2 == 1 || par2 == 2; modelbiped.BipedRightArm.ShowModel = par2 == 1; modelbiped.BipedLeftArm.ShowModel = par2 == 1; modelbiped.BipedRightLeg.ShowModel = par2 == 2 || par2 == 3; modelbiped.BipedLeftLeg.ShowModel = par2 == 2 || par2 == 3; SetRenderPassModel(modelbiped); return(!itemstack.IsItemEnchanted() ? 1 : 15); } } return(-1); }
/// <summary> /// Return an item rarity from EnumRarity /// </summary> public virtual Rarity GetRarity(ItemStack par1ItemStack) { if (par1ItemStack.IsItemEnchanted()) { return(Rarity.Rare); } else { return(Rarity.Common); } }
public virtual bool HasEffect(ItemStack par1ItemStack) { return(par1ItemStack.IsItemEnchanted()); }