Terraria.Player.UpdateDyes C# (CSharp) Method

UpdateDyes() public method

public UpdateDyes ( int plr ) : void
plr int
return void
        public void UpdateDyes(int plr)
        {
            this.cHead = 0;
            this.cBody = 0;
            this.cLegs = 0;
            this.cHandOn = 0;
            this.cHandOff = 0;
            this.cBack = 0;
            this.cFront = 0;
            this.cShoe = 0;
            this.cWaist = 0;
            this.cShield = 0;
            this.cNeck = 0;
            this.cFace = 0;
            this.cBalloon = 0;
            this.cWings = 0;
            this.cCarpet = 0;
            this.cGrapple = this.cMount = this.cMinecart = this.cPet = this.cLight = this.cYorai = 0;
            if (this.dye[0] != null)
                this.cHead = (int)this.dye[0].dye;
            if (this.dye[1] != null)
                this.cBody = (int)this.dye[1].dye;
            if (this.dye[2] != null)
                this.cLegs = (int)this.dye[2].dye;
            if (this.wearsRobe)
                this.cLegs = this.cBody;
            if (this.miscDyes[0] != null)
                this.cPet = (int)this.miscDyes[0].dye;
            if (this.miscDyes[1] != null)
                this.cLight = (int)this.miscDyes[1].dye;
            if (this.miscDyes[2] != null)
                this.cMinecart = (int)this.miscDyes[2].dye;
            if (this.miscDyes[3] != null)
                this.cMount = (int)this.miscDyes[3].dye;
            if (this.miscDyes[4] != null)
                this.cGrapple = (int)this.miscDyes[4].dye;
            for (int index1 = 0; index1 < 20; ++index1)
            {
                int index2 = index1 % 10;
                if (this.dye[index2] != null && this.armor[index1].itemId > 0 && this.armor[index1].stack > 0 && (index1 / 10 >= 1 || !this.hideVisual[index2] || ((int)this.armor[index1].wingSlot > 0 || this.armor[index1].itemId == 934)))
                {
                    if ((int)this.armor[index1].handOnSlot > 0 && (int)this.armor[index1].handOnSlot < 19)
                        this.cHandOn = (int)this.dye[index2].dye;
                    if ((int)this.armor[index1].handOffSlot > 0 && (int)this.armor[index1].handOffSlot < 12)
                        this.cHandOff = (int)this.dye[index2].dye;
                    if ((int)this.armor[index1].backSlot > 0 && (int)this.armor[index1].backSlot < 10)
                        this.cBack = (int)this.dye[index2].dye;
                    if ((int)this.armor[index1].frontSlot > 0 && (int)this.armor[index1].frontSlot < 5)
                        this.cFront = (int)this.dye[index2].dye;
                    if ((int)this.armor[index1].shoeSlot > 0 && (int)this.armor[index1].shoeSlot < 18)
                        this.cShoe = (int)this.dye[index2].dye;
                    if ((int)this.armor[index1].waistSlot > 0 && (int)this.armor[index1].waistSlot < 12)
                        this.cWaist = (int)this.dye[index2].dye;
                    if ((int)this.armor[index1].shieldSlot > 0 && (int)this.armor[index1].shieldSlot < 6)
                        this.cShield = (int)this.dye[index2].dye;
                    if ((int)this.armor[index1].neckSlot > 0 && (int)this.armor[index1].neckSlot < 9)
                        this.cNeck = (int)this.dye[index2].dye;
                    if ((int)this.armor[index1].faceSlot > 0 && (int)this.armor[index1].faceSlot < 9)
                        this.cFace = (int)this.dye[index2].dye;
                    if ((int)this.armor[index1].balloonSlot > 0 && (int)this.armor[index1].balloonSlot < 16)
                        this.cBalloon = (int)this.dye[index2].dye;
                    if ((int)this.armor[index1].wingSlot > 0 && (int)this.armor[index1].wingSlot < 37)
                        this.cWings = (int)this.dye[index2].dye;
                    if (this.armor[index1].itemId == 934)
                        this.cCarpet = (int)this.dye[index2].dye;
                }
            }
            this.cYorai = this.cPet;
        }
Player