mirror of
https://github.com/BentoBoxWorld/AcidIsland.git
synced 2024-11-22 02:25:55 +01:00
Updated to latest CompositeCommand API
This commit is contained in:
parent
fdf1b0a13b
commit
0ae1f70365
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user