Ejemplo n.º 1
0
 public static int RemoveItemFromChestsIfCrop(List<Chest> chests)
 {
     foreach (Chest chest in chests)
     {
         foreach (Item item in chest.items)
         {
             if (item.Name == null) continue;
             int seedID = Automation.GetSeedIdFromCrop(item.parentSheetIndex);
             if (seedID != -1)
             {
                 item.Stack -= 1;
                 if (item.Stack <= 0)
                     chest.items.Remove(item);
                 chest.clearNulls();
                 return seedID;
             }
         }
     }
     return -1;
 }