mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-22 12:05:51 -04:00
Don't allow core commands to be unloaded by using their shortcut
This commit is contained in:
parent
c856372f07
commit
e9d12b5127
@ -26,15 +26,15 @@ namespace MCGalaxy.Commands.Scripting {
|
||||
if (message == "") { Help(p); return; }
|
||||
string cmdName = message.SplitSpaces()[0];
|
||||
|
||||
if (Command.core.Contains(cmdName)) {
|
||||
Player.Message(p, "/{0} is a core command, you cannot unload it.", cmdName); return;
|
||||
}
|
||||
|
||||
Command cmd = Command.all.Find(cmdName);
|
||||
if (cmd == null) {
|
||||
Player.Message(p, "\"{0}\" is not a valid or loaded command.", cmdName); return;
|
||||
}
|
||||
|
||||
if (Command.core.Contains(cmd)) {
|
||||
Player.Message(p, "/{0} is a core command, you cannot unload it.", cmdName); return;
|
||||
}
|
||||
|
||||
Command.all.Remove(cmd);
|
||||
foreach (Group grp in Group.GroupList)
|
||||
grp.commands.Remove(cmd);
|
||||
|
Loading…
x
Reference in New Issue
Block a user