Updated to latest CompositeCommand API

This commit is contained in:
tastybento 2018-07-18 22:59:03 -07:00
parent fdf1b0a13b
commit 0ae1f70365
2 changed files with 11 additions and 11 deletions

View File

@ -15,10 +15,10 @@ import us.tastybento.bskyblock.commands.admin.AdminSetRankCommand;
import us.tastybento.bskyblock.commands.admin.AdminTeleportCommand;
import us.tastybento.bskyblock.commands.admin.AdminUnregisterCommand;
import us.tastybento.bskyblock.commands.admin.AdminVersionCommand;
import us.tastybento.bskyblock.commands.admin.teams.AdminTeamAddCommand;
import us.tastybento.bskyblock.commands.admin.teams.AdminTeamDisbandCommand;
import us.tastybento.bskyblock.commands.admin.teams.AdminTeamKickCommand;
import us.tastybento.bskyblock.commands.admin.teams.AdminTeamMakeLeaderCommand;
import us.tastybento.bskyblock.commands.admin.team.AdminTeamAddCommand;
import us.tastybento.bskyblock.commands.admin.team.AdminTeamDisbandCommand;
import us.tastybento.bskyblock.commands.admin.team.AdminTeamKickCommand;
import us.tastybento.bskyblock.commands.admin.team.AdminTeamMakeLeaderCommand;
public class AcidCommand extends CompositeCommand {
@ -55,7 +55,7 @@ public class AcidCommand extends CompositeCommand {
}
@Override
public boolean execute(User user, List<String> args) {
public boolean execute(User user, String label, List<String> args) {
if (!args.isEmpty()) {
user.sendMessage("general.errors.unknown-command", "[label]", "acid");
return false;

View File

@ -19,10 +19,10 @@ import us.tastybento.bskyblock.commands.island.IslandSethomeCommand;
import us.tastybento.bskyblock.commands.island.IslandSetnameCommand;
import us.tastybento.bskyblock.commands.island.IslandSettingsCommand;
import us.tastybento.bskyblock.commands.island.IslandUnbanCommand;
import us.tastybento.bskyblock.commands.island.teams.IslandTeamCommand;
import us.tastybento.bskyblock.commands.island.team.IslandTeamCommand;
public class AiCommand extends CompositeCommand {
public AiCommand(Addon addon) {
super(addon, "ai");
}
@ -60,17 +60,17 @@ public class AiCommand extends CompositeCommand {
* @see us.tastybento.bskyblock.api.commands.CommandArgument#execute(org.bukkit.command.CommandSender, java.lang.String[])
*/
@Override
public boolean execute(User user, List<String> args) {
public boolean execute(User user, String label, List<String> args) {
if (user == null) {
return false;
}
}
if (args.isEmpty()) {
// If in world, go
if (getPlugin().getIslands().getIsland(getWorld(), user.getUniqueId()) != null) {
return getSubCommand("go").map(goCmd -> goCmd.execute(user, new ArrayList<>())).orElse(false);
return getSubCommand("go").map(goCmd -> goCmd.execute(user, label, new ArrayList<>())).orElse(false);
}
// No islands currently
return getSubCommand("create").map(createCmd -> createCmd.execute(user, new ArrayList<>())).orElse(false);
return getSubCommand("create").map(createCmd -> createCmd.execute(user, label, new ArrayList<>())).orElse(false);
}
user.sendMessage("general.errors.unknown-command", "[label]", getLabel());
return false;