Beispiel #1
0
        private void OnReload(ReloadEventArgs args)
        {
            Economy.Economy.Products = QueryShop.GetProducts();
            args.Player.SendInfoMessage($"[Economy] Pomyslnie zaladowano {Economy.Economy.Products.Count} produktow.");

            Change.Config = ChangeConfig.Read("powelder/recipes.json");
            if (!File.Exists("powelder/recipes.json"))
            {
                Change.Config.Write("powelder/recipes.json");
            }
            Change.Recipes = new Dictionary <int, Recipe>();
            for (int i = 0; i < Change.Config.Recipes.Count(); i++)
            {
                Change.Recipes.Add(i, Change.Config.Recipes[i]);
            }
        }
Beispiel #2
0
 public static void OnInitialize(EventArgs e)
 {
     Config = Config.Read("powelder/srvconfig.json");
     if (!File.Exists("powelder/srvconfig.json"))
     {
         Config.Write("powelder/srvconfig.json");
     }
     Change.Config = ChangeConfig.Read("powelder/recipes.json");
     if (!File.Exists("powelder/recipes.json"))
     {
         Change.Config.Write("powelder/recipes.json");
     }
     Change.Recipes = new Dictionary <int, Recipe>();
     for (int i = 0; i < Change.Config.Recipes.Count(); i++)
     {
         Change.Recipes.Add(i, Change.Config.Recipes[i]);
     }
 }