2017-12-31 06:15:47 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
2018-04-16 20:05:26 +02:00
|
|
|
package bskyblock.addon.warps.commands;
|
2017-12-31 06:15:47 +01:00
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
2018-04-16 20:05:26 +02:00
|
|
|
import bskyblock.addon.warps.Warp;
|
2017-12-31 06:15:47 +01:00
|
|
|
import us.tastybento.bskyblock.api.commands.CompositeCommand;
|
2018-03-12 01:38:40 +01:00
|
|
|
import us.tastybento.bskyblock.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-05-29 00:42:03 +02:00
|
|
|
this.setPermission(getPermissionPrefix() + "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
|
|
|
|
public boolean execute(User user, 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");
|
|
|
|
user.sendMessage("warps.warpTip");
|
|
|
|
} 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;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|