Use control panel if it exists.
This commit is contained in:
parent
5b25c2ddc8
commit
cf04358d14
|
@ -73,6 +73,9 @@ public class IslandCommand extends CompositeCommand {
|
||||||
if (args.isEmpty()) {
|
if (args.isEmpty()) {
|
||||||
// If user has an island, go
|
// If user has an island, go
|
||||||
if (getPlugin().getIslands().getIsland(getWorld(), user.getUniqueId()) != null) {
|
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);
|
return getSubCommand("go").map(goCmd -> goCmd.call(user, goCmd.getLabel(), new ArrayList<>())).orElse(false);
|
||||||
}
|
}
|
||||||
// No islands currently
|
// No islands currently
|
||||||
|
|
Loading…
Reference in New Issue