Beispiel #1
0
 void OnConsumeFuel(BaseOven oven, Item fuel, ItemModBurnable burnable)
 {
     if (!MessageDone)
     {
         Puts("Fire Burning.... LIGHTS OUT !! time is " + sky.Cycle.DateTime + "|" + oven.ToString());
         //PrintToChat("Night time, Fires Buring.... LIGHTS OUT !! time is " + sky.Cycle.DateTime + " Dont forget to /vote ^_*");
         PrintToChat(lang.GetMessage("nightTime", this).Replace("{time}", sky.Cycle.DateTime.ToString()));
         lightsList.Add("MessageDone");
         MessageDone = true;
     }
     //DEBUG LINE //PrintToChat(" Is Night: " + sky.IsNight.ToString() + "|" + oven.ToString() + "| RUST Time: " + sky.Cycle.DateTime.ToString("HH:mm:ss")); //DEBUG
     //if (sky.Cycle.Hour >= 18 && sky.Cycle.Hour <= 6) // <-- another way to do it with more targeted times ?
     if (sky.IsNight)
     {
         if (lightsList != null)
         {
             if (lightsList.Contains(oven.ToString()) == false)
             {
                 oven.StopCooking();
                 oven.SetFlag(BaseEntity.Flags.On, false);
                 lightsList.Add(oven.ToString());
             }
         }
     }
     else
     {
         if (lightsList != null)
         {
             if (lightsList.Count > 0)
             {
                 lightsList.Clear();
             }
         }
     }
 }