-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<string> commandsToKeep = new List<string> { "help", "commands", "compile", "plugin", "restart", }; // Add all commands you wish to keep | ||
List<Command> commandsToRemove = new List<Command>(); | ||
|
||
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) | ||
{ | ||
} | ||
} | ||
} |