1
0
mirror of https://github.com/BentoBoxWorld/Warps.git synced 2024-11-05 02:19:39 +01:00
addon-welcomewarpsigns/src/bskyblock/addon/warps/commands/WarpsCommand.java

50 lines
1.3 KiB
Java
Raw Normal View History

/**
*
*/
2018-04-16 20:05:26 +02:00
package bskyblock.addon.warps.commands;
import java.util.List;
2018-04-16 20:05:26 +02:00
import bskyblock.addon.warps.Warp;
import us.tastybento.bskyblock.api.commands.CompositeCommand;
2018-03-12 01:38:40 +01:00
import us.tastybento.bskyblock.api.user.User;
/**
* @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");
this.setOnlyPlayer(true);
2017-12-31 23:08:36 +01:00
this.setDescription("warps.help.description");
}
/* (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()) {
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);
}
return true;
}
}