1
0
mirror of https://github.com/BentoBoxWorld/Warps.git synced 2024-06-28 15:44:42 +02:00
addon-welcomewarpsigns/src/main/java/world/bentobox/warps/commands/WarpsCommand.java

50 lines
1.3 KiB
Java
Raw Normal View History

/**
2018-07-19 07:58:14 +02:00
*
*/
package world.bentobox.warps.commands;
import java.util.List;
import world.bentobox.warps.Warp;
2018-08-01 18:47:57 +02:00
import world.bentobox.bentobox.api.commands.CompositeCommand;
import world.bentobox.bentobox.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-06-03 04:20:37 +02:00
this.setPermission("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
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()) {
user.sendMessage("warps.error.no-warps-yet");
user.sendMessage("warps.warpTip", "[text]", getAddon().getConfig().getString("welcomeLine", "[WELCOME]"));
} else {
2018-05-29 00:42:03 +02:00
plugin.getWarpPanelManager().showWarpPanel(getWorld(), user,0);
}
return true;
}
}