private void SaveServer(On.Terraria.Main.orig_UpdateTime orig) { orig(); var serverConfig = Config.Get <AServerConfig>(); if (Main.dedServ && !serverConfig.AutosaveDisabled) { //Only make this run on a server if (!saveTime.IsRunning) { saveTime.Start(); } int serverInterval = serverConfig.AutosaveInterval; if (saveTime.ElapsedMilliseconds > serverInterval * 1000) { saveTime.Reset(); string message = "Autosaved World"; if (serverConfig.Notify) { Print(message); } WorldGen.saveAndPlay(); } } }
private void HookAdjustTaxRate(On.Terraria.Main.orig_UpdateTime orig) { if (NPC.taxCollector && Main.netMode != NetmodeID.Server && !Main.gameMenu) { Main.LocalPlayer.taxTimer += (int)(Main.dayRate * (ModHandler.parser.CalculateTimerRate() - 1f)); } orig(); }