Use control panel if it exists.

This commit is contained in:
tastybento 2020-02-07 13:11:54 -08:00
parent 5b25c2ddc8
commit cf04358d14
1 changed files with 3 additions and 0 deletions

View File

@ -73,6 +73,9 @@ public class IslandCommand extends CompositeCommand {
if (args.isEmpty()) {
// If user has an island, go
if (getPlugin().getIslands().getIsland(getWorld(), user.getUniqueId()) != null) {
if (getSubCommand("controlpanel").isPresent()) {
return getSubCommand("controlpanel").get().call(user, label, new ArrayList<>());
}
return getSubCommand("go").map(goCmd -> goCmd.call(user, goCmd.getLabel(), new ArrayList<>())).orElse(false);
}
// No islands currently