Allow users to disable hardmode from occurring.

This commit is contained in:
Deathmax 2011-12-18 21:08:04 +08:00
parent b497183423
commit c8c2307935
2 changed files with 10 additions and 0 deletions

View file

@ -223,6 +223,9 @@ namespace TShockAPI
[Description("Kicks banned users by their IP")]
public bool EnableIPBans = true;
[Description("Disables hardmode, can't never be activated. Overrides /starthardmode")]
public bool DisableHardmode = false;
public static ConfigFile Read(string path)
{
if (!File.Exists(path))

View file

@ -200,6 +200,7 @@ namespace TShockAPI
NetHooks.GreetPlayer += OnGreetPlayer;
NpcHooks.StrikeNpc += NpcHooks_OnStrikeNpc;
ProjectileHooks.SetDefaults += OnProjectileSetDefaults;
WorldHooks.StartHardMode += OnStartHardMode;
GetDataHandlers.InitGetDataHandler();
Commands.InitCommands();
@ -868,6 +869,12 @@ namespace TShockAPI
e.Handled = true;
}
void OnStartHardMode(HandledEventArgs e)
{
if (Config.DisableHardmode)
e.Handled = true;
}
/*
* Useful stuff:
* */