Switch to using call instead of execute to enable perms to be used

https://github.com/BentoBoxWorld/BentoBox/issues/759
This commit is contained in:
tastybento 2019-07-28 15:21:34 -07:00
parent fdd4bc795b
commit 20e4786f08

View File

@ -64,10 +64,10 @@ 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) {
return getSubCommand("go").map(goCmd -> goCmd.execute(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
return getSubCommand("create").map(createCmd -> createCmd.execute(user, createCmd.getLabel(), new ArrayList<>())).orElse(false); return getSubCommand("create").map(createCmd -> createCmd.call(user, createCmd.getLabel(), new ArrayList<>())).orElse(false);
} }
user.sendMessage("general.errors.unknown-command", TextVariables.LABEL, getTopLabel()); user.sendMessage("general.errors.unknown-command", TextVariables.LABEL, getTopLabel());
return false; return false;