Added command to toggle anti-build.

This commit is contained in:
Shank 2011-06-12 02:49:37 -06:00
parent 2fe906744f
commit feea5700ac

View file

@ -223,6 +223,7 @@ namespace TShockAPI
commands.Add(new Command("auth", "", AuthToken));
commands.Add(new Command("me", "", ThirdPerson));
commands.Add(new Command("p", "", PartyChat));
commands.Add(new Command("antibuild", "editspawn", ToggleAntiBuild));
if (ConfigurationManager.distributationAgent != "terraria-online")
{
commands.Add(new Command("kill", "kill", Kill));
@ -236,6 +237,18 @@ namespace TShockAPI
#region Command Methods
public static void ToggleAntiBuild(CommandArgs args)
{
Tools.SendMessage(args.PlayerID, "Toggled world anti-build.");
if (ConfigurationManager.disableBuild)
{
ConfigurationManager.disableBuild = false;
} else
{
ConfigurationManager.disableBuild = true;
}
}
public static void CheckUpdates(CommandArgs args)
{
ThreadPool.QueueUserWorkItem(UpdateManager.CheckUpdate);