protected void Func_27265_a(StatCrafting par1StatCrafting, int par2, int par3, bool par4)
 {
     if (par1StatCrafting != null)
     {
         string s = par1StatCrafting.Func_27084_a(GuiStats.GetStatsFileWriter(Field_27269_g).WriteStat(par1StatCrafting));
         Field_27269_g.DrawString(GuiStats.GetFontRenderer(Field_27269_g), s, par2 - (int)GuiStats.GetFontRenderer(Field_27269_g).GetStringWidth(s), par3 + 5, par4 ? 0xffffff : 0x909090);
     }
     else
     {
         string s1 = "-";
         Field_27269_g.DrawString(GuiStats.GetFontRenderer(Field_27269_g), s1, par2 - (int)GuiStats.GetFontRenderer(Field_27269_g).GetStringWidth(s1), par3 + 5, par4 ? 0xffffff : 0x909090);
     }
 }
        public virtual int Func_27297_a(StatCrafting par1StatCrafting, StatCrafting par2StatCrafting)
        {
            int      i         = par1StatCrafting.GetItemID();
            int      j         = par2StatCrafting.GetItemID();
            StatBase statbase  = null;
            StatBase statbase1 = null;

            if (SlotStatsBlockGUI.Field_27271_e == 2)
            {
                statbase  = StatList.MineBlockStatArray[i];
                statbase1 = StatList.MineBlockStatArray[j];
            }
            else if (SlotStatsBlockGUI.Field_27271_e == 0)
            {
                statbase  = StatList.ObjectCraftStats[i];
                statbase1 = StatList.ObjectCraftStats[j];
            }
            else if (SlotStatsBlockGUI.Field_27271_e == 1)
            {
                statbase  = StatList.ObjectUseStats[i];
                statbase1 = StatList.ObjectUseStats[j];
            }

            if (statbase != null || statbase1 != null)
            {
                if (statbase == null)
                {
                    return(1);
                }

                if (statbase1 == null)
                {
                    return(-1);
                }

                int k = GuiStats.GetStatsFileWriter(SlotStatsBlockGUI.Field_27274_a).WriteStat(statbase);
                int l = GuiStats.GetStatsFileWriter(SlotStatsBlockGUI.Field_27274_a).WriteStat(statbase1);

                if (k != l)
                {
                    return((k - l) * SlotStatsBlockGUI.Field_27270_f);
                }
            }

            return(i - j);
        }
Exemplo n.º 3
0
        public GuiSlotStatsItem(GuiStats par1GuiStats) : base(par1GuiStats)
        {
            Field_27275_a = par1GuiStats;
            Field_27273_c = new List <StatCrafting>();

            IEnumerator <StatCrafting> iterator = StatList.ItemStats.GetEnumerator();

            do
            {
                if (!iterator.MoveNext())
                {
                    break;
                }

                StatCrafting statcrafting = (StatCrafting)iterator.Current;
                bool         flag         = false;
                int          i            = statcrafting.GetItemID();

                if (GuiStats.GetStatsFileWriter(par1GuiStats).WriteStat(statcrafting) > 0)
                {
                    flag = true;
                }
                else if (StatList.ObjectBreakStats[i] != null && GuiStats.GetStatsFileWriter(par1GuiStats).WriteStat(StatList.ObjectBreakStats[i]) > 0)
                {
                    flag = true;
                }
                else if (StatList.ObjectCraftStats[i] != null && GuiStats.GetStatsFileWriter(par1GuiStats).WriteStat(StatList.ObjectCraftStats[i]) > 0)
                {
                    flag = true;
                }

                if (flag)
                {
                    Field_27273_c.Add(statcrafting);
                }
            }while (true);

            Field_27272_d = new SorterStatsItem(this, par1GuiStats);
        }