1
0
mirror of https://github.com/BentoBoxWorld/Warps.git synced 2024-09-28 23:27:32 +02:00
addon-welcomewarpsigns/src/bskyblock/addin/warps/commands/WarpsCommand.java

51 lines
1.3 KiB
Java
Raw Normal View History

/**
*
*/
package bskyblock.addin.warps.commands;
import java.util.List;
import bskyblock.addin.warps.Warp;
2018-01-07 20:25:38 +01:00
import us.tastybento.bskyblock.Constants;
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-01-07 20:25:38 +01:00
this.setPermission(Constants.PERMPREFIX + "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) {
if (plugin.getWarpSignsManager().listWarps().isEmpty()) {
user.sendMessage("warps.error.no-warps-yet");
user.sendMessage("warps.warpTip");
} else {
plugin.getWarpPanelManager().showWarpPanel(user,0);
}
return true;
}
}