forked from RepoMirrors/kami-blue
Rename to default if no name was specified
This commit is contained in:
parent
b96f0cb778
commit
71fc4a847e
|
@ -18,9 +18,6 @@ public class RenameModuleCommand extends Command {
|
||||||
if (args.length == 0) {
|
if (args.length == 0) {
|
||||||
sendChatMessage("Please specify a module!");
|
sendChatMessage("Please specify a module!");
|
||||||
return;
|
return;
|
||||||
} else if (args.length == 1) {
|
|
||||||
sendChatMessage("Please specify a name!");
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Module module = ModuleManager.getModuleByName(args[0]);
|
Module module = ModuleManager.getModuleByName(args[0]);
|
||||||
|
@ -29,7 +26,7 @@ public class RenameModuleCommand extends Command {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String name = args[1];
|
String name = args.length == 1 ? module.getOriginalName() : args[1];
|
||||||
|
|
||||||
if (!(name.matches("[a-zA-Z]+"))) {
|
if (!(name.matches("[a-zA-Z]+"))) {
|
||||||
sendChatMessage("Name must be alphabetic!");
|
sendChatMessage("Name must be alphabetic!");
|
||||||
|
|
|
@ -61,6 +61,10 @@ public class Module {
|
||||||
ModuleManager.updateLookup();
|
ModuleManager.updateLookup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getOriginalName() {
|
||||||
|
return originalName;
|
||||||
|
}
|
||||||
|
|
||||||
public enum Category
|
public enum Category
|
||||||
{
|
{
|
||||||
COMBAT("Combat", false),
|
COMBAT("Combat", false),
|
||||||
|
|
Loading…
Reference in New Issue