mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-23 04:32:50 -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; }
|
if (message == "") { Help(p); return; }
|
||||||
string cmdName = message.SplitSpaces()[0];
|
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);
|
Command cmd = Command.all.Find(cmdName);
|
||||||
if (cmd == null) {
|
if (cmd == null) {
|
||||||
Player.Message(p, "\"{0}\" is not a valid or loaded command.", cmdName); return;
|
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);
|
Command.all.Remove(cmd);
|
||||||
foreach (Group grp in Group.GroupList)
|
foreach (Group grp in Group.GroupList)
|
||||||
grp.commands.Remove(cmd);
|
grp.commands.Remove(cmd);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user