Add hardmode-related commands

-/hardmode - starts hardmode and converts the world
-/stophardmode - sets hardmode state to false, does not revert world.
This commit is contained in:
Deathmax 2011-12-04 23:05:50 +08:00
parent c53a85b3c7
commit 2c45598c08
2 changed files with 15 additions and 0 deletions

View file

@ -189,6 +189,8 @@ namespace TShockAPI
add(Permissions.buff, Buff, "buff");
add(Permissions.buffplayer, GBuff, "gbuff", "buffplayer");
add(Permissions.grow, Grow, "grow");
add(Permissions.hardmode, StartHardMode, "hardmode");
add(Permissions.hardmode, DisableHardMode, "stophardmode", "disablehardmode");
}
public static bool HandleCommand(TSPlayer player, string text)
@ -1104,6 +1106,16 @@ namespace TShockAPI
}
}
private static void StartHardMode(CommandArgs args)
{
WorldGen.StartHardmode();
}
private static void DisableHardMode(CommandArgs args)
{
Main.hardMode = false;
}
#endregion Cause Events and Spawn Monsters Commands
#region Teleport Commands

View file

@ -138,6 +138,9 @@ namespace TShockAPI
[Description("")]
public static readonly string grow;
[Description("User can change hardmode state.")]
public static readonly string hardmode;
static Permissions()
{
foreach (var field in typeof(Permissions).GetFields())