diff --git a/MCGalaxy/Plugins/DisableCommands.cs b/MCGalaxy/Plugins/DisableCommands.cs new file mode 100644 index 0000000..4fac5fb --- /dev/null +++ b/MCGalaxy/Plugins/DisableCommands.cs @@ -0,0 +1,36 @@ +// NOTE: If you have other plugins that add commands, you should probably rename this file to something along the lines of 'zzDisableCommands' so those are disabled as well. + +using System; +using System.Collections.Generic; + +namespace MCGalaxy +{ + public class DisableCommands : Plugin + { + public override string name { get { return "DisableCommands"; } } + public override string MCGalaxy_Version { get { return "1.9.4.9"; } } + public override string creator { get { return "Venk"; } } + + public override void Load(bool startup) + { + List commandsToKeep = new List { "help", "commands", "compile", "plugin", "restart", }; // Add all commands you wish to keep + List commandsToRemove = new List(); + + foreach (Command cmd in Command.allCmds) + { + if (commandsToKeep.Contains(cmd.name.ToLower())) continue; + commandsToRemove.Add(cmd); + } + + foreach (Command cmd in commandsToRemove) Command.Unregister(cmd); + } + + public override void Unload(bool shutdown) + { + } + + public override void Help(Player p) + { + } + } +}