Ejemplo n.º 1
0
        public override string GetItemDisplayName(ItemStack par1ItemStack)
        {
            if (par1ItemStack.GetItemDamage() == 0)
            {
                return(StatCollector.TranslateToLocal("item.emptyPotion.name").Trim());
            }

            string s = "";

            if (IsSplash(par1ItemStack.GetItemDamage()))
            {
                s = (new StringBuilder()).Append(StatCollector.TranslateToLocal("potion.prefix.grenade").Trim()).Append(" ").ToString();
            }

            List <PotionEffect> list = Item.Potion.GetEffects(par1ItemStack);

            if (list != null && list.Count > 0)
            {
                string s1 = ((PotionEffect)list[0]).GetEffectName();
                s1 = (new StringBuilder()).Append(s1).Append(".postfix").ToString();
                return((new StringBuilder()).Append(s).Append(StatCollector.TranslateToLocal(s1).Trim()).ToString());
            }
            else
            {
                string s2 = PotionHelper.Func_40359_b(par1ItemStack.GetItemDamage());
                return((new StringBuilder()).Append(StatCollector.TranslateToLocal(s2).Trim()).Append(" ").Append(base.GetItemDisplayName(par1ItemStack)).ToString());
            }
        }
        /// <summary>
        /// Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
        /// handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
        /// (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
        /// double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
        /// </summary>
        public override void DoRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
        {
            //GL.PushMatrix();
            //GL.Translate((float)par2, (float)par4, (float)par6);
            //GL.Enable(EnableCap.RescaleNormal);
            //GL.Scale(0.5F, 0.5F, 0.5F);
            LoadTexture("/gui/items.png");
            Tessellator tessellator = Tessellator.Instance;

            if (ItemIconIndex == 154)
            {
                int   i  = PotionHelper.Func_40358_a(((EntityPotion)par1Entity).GetPotionDamage(), false);
                float f  = (float)(i >> 16 & 0xff) / 255F;
                float f1 = (float)(i >> 8 & 0xff) / 255F;
                float f2 = (float)(i & 0xff) / 255F;
                //GL.Color3(f, f1, f2);
                //GL.PushMatrix();
                Func_40265_a(tessellator, 141);
                //GL.PopMatrix();
                //GL.Color3(1.0F, 1.0F, 1.0F);
            }

            Func_40265_a(tessellator, ItemIconIndex);
            //GL.Disable(EnableCap.RescaleNormal);
            //GL.PopMatrix();
        }
Ejemplo n.º 3
0
 public override int GetColorFromDamage(int par1, int par2)
 {
     if (par2 > 0)
     {
         return(0xffffff);
     }
     else
     {
         return(PotionHelper.Func_40358_a(par1, false));
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Returns a list of effects for the specified potion damage value.
        /// </summary>
        public virtual List <PotionEffect> GetEffects(int par1)
        {
            List <PotionEffect> list = EffectCache[par1];

            if (list == null)
            {
                list = PotionHelper.GetPotionEffects(par1, false);
                EffectCache[par1] = list;
            }

            return(list);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// The result of brewing a potion of the specified damage value with an ingredient itemstack.
        /// </summary>
        private int GetPotionResult(int par1, ItemStack par2ItemStack)
        {
            if (par2ItemStack == null)
            {
                return(par1);
            }

            if (Item.ItemsList[par2ItemStack.ItemID].IsPotionIngredient())
            {
                return(PotionHelper.ApplyIngredient(par1, Item.ItemsList[par2ItemStack.ItemID].GetPotionEffect()));
            }
            else
            {
                return(par1);
            }
        }