default tab completion + plot chat for merged plots

This commit is contained in:
Jesse Boyd
2016-03-28 22:52:22 +11:00
parent b6bdb02fa2
commit dcd1a50a0c
4 changed files with 30 additions and 5 deletions

View File

@ -394,6 +394,28 @@ public abstract class Command {
return cmd;
}
public Command getCommand(Class clazz) {
for (Command cmd : allCommands) {
if (cmd.getClass() == clazz) {
return cmd;
}
}
return null;
}
public Command getCommandById(String id) {
Command exact = staticCommands.get(id);
if (exact != null) {
return exact;
}
for (Command cmd : allCommands) {
if (cmd.getId().equals(id)) {
return cmd;
}
}
return null;
}
public boolean canExecute(PlotPlayer player, boolean message) {
if (!required.allows(player)) {
if (message) {