178    {
  183        {
  186            {
  187                break;
  188            }
  189            int num = 
item2.stack;
 
  190            if (
alchemy && Main.player[Main.myPlayer].alchemyTable)
 
  191            {
  192                if (num > 1)
  193                {
  195                    for (
int j = 0; 
j < num; 
j++)
 
  196                    {
  197                        if (Main.rand.Next(3) == 0)
  198                        {
  200                        }
  201                    }
  203                }
  204                else if (Main.rand.Next(3) == 0)
  205                {
  206                    num = 0;
  207                }
  208            }
  209            if (num <= 0)
  210            {
  211                continue;
  212            }
  213            array = Main.player[Main.myPlayer].inventory;
 
  214            for (
int k = 0; 
k < 58; 
k++)
 
  215            {
  217                if (num <= 0)
  218                {
  219                    break;
  220                }
  222                {
  223                    if (
item.stack > num)
 
  224                    {
  225                        item.stack -= num;
  226                        num = 0;
  227                    }
  228                    else
  229                    {
  232                    }
  233                }
  234            }
  235            if (Main.player[Main.myPlayer].chest != -1)
  236            {
  237                if (Main.player[Main.myPlayer].chest > -1)
  238                {
  239                    array = Main.chest[Main.player[Main.myPlayer].chest].item;
 
  240                }
  241                else if (Main.player[Main.myPlayer].chest == -2)
  242                {
  243                    array = Main.player[Main.myPlayer].bank.item;
 
  244                }
  245                else if (Main.player[Main.myPlayer].chest == -3)
  246                {
  247                    array = Main.player[Main.myPlayer].bank2.item;
 
  248                }
  249                else if (Main.player[Main.myPlayer].chest == -4)
  250                {
  251                    array = Main.player[Main.myPlayer].bank3.item;
 
  252                }
  253                else if (Main.player[Main.myPlayer].chest == -5)
  254                {
  255                    array = Main.player[Main.myPlayer].bank4.item;
 
  256                }
  257                for (
int l = 0; 
l < 40; 
l++)
 
  258                {
  260                    if (num <= 0)
  261                    {
  262                        break;
  263                    }
  265                    {
  266                        continue;
  267                    }
  268                    if (
item.stack > num)
 
  269                    {
  270                        item.stack -= num;
  271                        if (Main.netMode == 1 && Main.player[Main.myPlayer].chest >= 0)
  272                        {
  273                            NetMessage.SendData(32, -1, -1, 
null, Main.player[Main.myPlayer].chest, 
l);
 
  274                        }
  275                        num = 0;
  276                    }
  277                    else
  278                    {
  281                        if (Main.netMode == 1 && Main.player[Main.myPlayer].chest >= 0)
  282                        {
  283                            NetMessage.SendData(32, -1, -1, 
null, Main.player[Main.myPlayer].chest, 
l);
 
  284                        }
  285                    }
  286                }
  287            }
  288            if (!Main.player[Main.myPlayer].useVoidBag() || Main.player[Main.myPlayer].chest == -5)
  289            {
  290                continue;
  291            }
  292            array = Main.player[Main.myPlayer].bank4.item;
 
  293            for (
int m = 0; 
m < 40; 
m++)
 
  294            {
  296                if (num <= 0)
  297                {
  298                    break;
  299                }
  301                {
  302                    continue;
  303                }
  304                if (
item.stack > num)
 
  305                {
  306                    item.stack -= num;
  307                    if (Main.netMode == 1 && Main.player[Main.myPlayer].chest >= 0)
  308                    {
  309                        NetMessage.SendData(32, -1, -1, 
null, Main.player[Main.myPlayer].chest, 
m);
 
  310                    }
  311                    num = 0;
  312                }
  313                else
  314                {
  317                    if (Main.netMode == 1 && Main.player[Main.myPlayer].chest >= 0)
  318                    {
  319                        NetMessage.SendData(32, -1, -1, 
null, Main.player[Main.myPlayer].chest, 
m);
 
  320                    }
  321                }
  322            }
  323        }
  327    }
static void NotifyItemCraft(Recipe recipe)
static void NotifyItemPickup(Player player, Item item)
bool AcceptedByItemGroups(int invType, int reqType)
bool useWood(int invType, int reqType)
static int maxRequirements
bool usePressurePlate(int invType, int reqType)
bool useFragment(int invType, int reqType)
static void FindRecipes(bool canDelayCheck=false)
bool useSand(int invType, int reqType)
bool useIronBar(int invType, int reqType)