2017-12-31 06:15:47 +01:00
|
|
|
/**
|
2018-07-19 07:58:14 +02:00
|
|
|
*
|
2017-12-31 06:15:47 +01:00
|
|
|
*/
|
2018-08-04 08:32:05 +02:00
|
|
|
package bentobox.addon.warps.commands;
|
2017-12-31 06:15:47 +01:00
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
2018-08-04 08:32:05 +02:00
|
|
|
import bentobox.addon.warps.Warp;
|
2018-08-01 18:47:57 +02:00
|
|
|
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
|
|
|
import world.bentobox.bentobox.api.user.User;
|
2017-12-31 06:15:47 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @author ben
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public class WarpsCommand extends CompositeCommand {
|
|
|
|
|
|
|
|
private Warp plugin;
|
|
|
|
|
|
|
|
public WarpsCommand(Warp plugin, CompositeCommand bsbIslandCmd) {
|
|
|
|
super(bsbIslandCmd, "warps");
|
|
|
|
this.plugin = plugin;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* (non-Javadoc)
|
|
|
|
* @see us.tastybento.bskyblock.api.commands.BSBCommand#setup()
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
public void setup() {
|
2018-06-03 04:20:37 +02:00
|
|
|
this.setPermission("island.warp");
|
2017-12-31 06:15:47 +01:00
|
|
|
this.setOnlyPlayer(true);
|
2017-12-31 23:08:36 +01:00
|
|
|
this.setDescription("warps.help.description");
|
2017-12-31 06:15:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* (non-Javadoc)
|
|
|
|
* @see us.tastybento.bskyblock.api.commands.BSBCommand#execute(us.tastybento.bskyblock.api.commands.User, java.util.List)
|
|
|
|
*/
|
|
|
|
@Override
|
2018-07-19 07:58:14 +02:00
|
|
|
public boolean execute(User user, String label, List<String> args) {
|
2018-05-29 00:42:03 +02:00
|
|
|
if (plugin.getWarpSignsManager().listWarps(getWorld()).isEmpty()) {
|
2017-12-31 06:15:47 +01:00
|
|
|
user.sendMessage("warps.error.no-warps-yet");
|
2018-09-28 06:09:20 +02:00
|
|
|
user.sendMessage("warps.warpTip", "[text]", getAddon().getConfig().getString("welcomeLine", "[WELCOME]"));
|
2017-12-31 06:15:47 +01:00
|
|
|
} else {
|
2018-05-29 00:42:03 +02:00
|
|
|
plugin.getWarpPanelManager().showWarpPanel(getWorld(), user,0);
|
2017-12-31 06:15:47 +01:00
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|