Allow users to disable hardmode from occurring.
This commit is contained in:
parent
b497183423
commit
c8c2307935
2 changed files with 10 additions and 0 deletions
|
|
@ -223,6 +223,9 @@ namespace TShockAPI
|
||||||
[Description("Kicks banned users by their IP")]
|
[Description("Kicks banned users by their IP")]
|
||||||
public bool EnableIPBans = true;
|
public bool EnableIPBans = true;
|
||||||
|
|
||||||
|
[Description("Disables hardmode, can't never be activated. Overrides /starthardmode")]
|
||||||
|
public bool DisableHardmode = false;
|
||||||
|
|
||||||
public static ConfigFile Read(string path)
|
public static ConfigFile Read(string path)
|
||||||
{
|
{
|
||||||
if (!File.Exists(path))
|
if (!File.Exists(path))
|
||||||
|
|
|
||||||
|
|
@ -200,6 +200,7 @@ namespace TShockAPI
|
||||||
NetHooks.GreetPlayer += OnGreetPlayer;
|
NetHooks.GreetPlayer += OnGreetPlayer;
|
||||||
NpcHooks.StrikeNpc += NpcHooks_OnStrikeNpc;
|
NpcHooks.StrikeNpc += NpcHooks_OnStrikeNpc;
|
||||||
ProjectileHooks.SetDefaults += OnProjectileSetDefaults;
|
ProjectileHooks.SetDefaults += OnProjectileSetDefaults;
|
||||||
|
WorldHooks.StartHardMode += OnStartHardMode;
|
||||||
|
|
||||||
GetDataHandlers.InitGetDataHandler();
|
GetDataHandlers.InitGetDataHandler();
|
||||||
Commands.InitCommands();
|
Commands.InitCommands();
|
||||||
|
|
@ -868,6 +869,12 @@ namespace TShockAPI
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OnStartHardMode(HandledEventArgs e)
|
||||||
|
{
|
||||||
|
if (Config.DisableHardmode)
|
||||||
|
e.Handled = true;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Useful stuff:
|
* Useful stuff:
|
||||||
* */
|
* */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue