use of co.aikar.commands.annotation.Subcommand in project VoxelGamesLibv2 by VoxelGamesLib.
the class GameCommands method gameStart.
@Subcommand("start")
@CommandCompletion("@gamemodes")
@Syntax("<mode> - the mode you want to start")
@CommandPermission("%premium")
public void gameStart(@Nonnull User sender, @Nonnull GameMode mode) {
if (handleGameLeaving(sender))
return;
Game game = gameHandler.startGame(mode);
if (game.getActivePhase().isRunning()) {
game.join(sender);
Lang.msg(sender, LangKey.GAME_GAME_STARTED);
if (config.announceNewGame) {
// TODO figure out which command to enter
Lang.broadcast(LangKey.GAME_ANNOUNCE_GAME_STARTED, "/game joinuuid " + game.getUuid().toString(), sender.getDisplayName(), mode.getName());
}
} else {
Lang.msg(sender, LangKey.GAME_COULD_NOT_START);
}
}
use of co.aikar.commands.annotation.Subcommand in project VoxelGamesLibv2 by VoxelGamesLib.
the class GameCommands method gameList.
@Subcommand("list")
@CommandPermission("%user")
public void gameList(@Nonnull User sender) {
Lang.msg(sender, LangKey.GAME_GAMELIST_HEADER);
for (Game game : gameHandler.getGames()) {
Lang.msg(sender, LangKey.GAME_GAMELIST_ENTRY, game.getUuid().toString().split("-")[0], game.getGameMode().getName(), game.getActivePhase().getName(), game.getPlayers().size(), game.getSpectators().size());
}
Lang.msg(sender, LangKey.GAME_GAMELIST_FOOTER);
}
use of co.aikar.commands.annotation.Subcommand in project VoxelGamesLibv2 by VoxelGamesLib.
the class WorldCreator method center.
@Subcommand("center")
@CommandPermission("%admin")
public void center(@Nonnull User sender) {
if (step != 2) {
Lang.msg(sender, LangKey.WORLD_CREATOR_WRONG_STEP, step, 2);
return;
}
center = new Vector3D(sender.getPlayer().getLocation().getX(), sender.getPlayer().getLocation().getY(), sender.getPlayer().getLocation().getZ());
Lang.msg(sender, LangKey.WORLD_CREATOR_ENTER_RADIUS, "/worldcreator radius ");
step = 3;
}
use of co.aikar.commands.annotation.Subcommand in project VoxelGamesLibv2 by VoxelGamesLib.
the class WorldCreator method author.
@Subcommand("author")
@CommandPermission("%admin")
public void author(@Nonnull User sender, @Nonnull String author) {
if (step != 5) {
Lang.msg(sender, LangKey.WORLD_CREATOR_WRONG_STEP, step, 5);
return;
}
this.author = author;
Lang.msg(sender, LangKey.WORLD_CREATOR_AUTHOR_SET, author);
for (GameMode mode : gameHandler.getGameModes()) {
sender.sendMessage(TextComponent.of(mode.getName() + " ").color(TextColor.YELLOW).clickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/worldcreator gamemode " + mode.getName())));
}
Lang.msg(sender, LangKey.WORLD_CREATOR_DONE_QUERY, "/worldcreator gamemode done");
step = 6;
}
use of co.aikar.commands.annotation.Subcommand in project VoxelGamesLibv2 by VoxelGamesLib.
the class WorldModifyCommands method center.
@Subcommand("center")
@CommandPermission("%admin")
public void center(@Nonnull User user, @Nullable @co.aikar.commands.annotation.Optional String set) {
if (!check(user))
return;
// view
if (set == null) {
Lang.msg(user, LangKey.WORLD_MODIFY_CENTER_VIEW, map.getCenter());
} else // edit
{
map.setCenter(new Vector3D(user.getPlayer().getLocation().getX(), user.getPlayer().getLocation().getY(), user.getPlayer().getLocation().getZ()));
Lang.msg(user, LangKey.WORLD_MODIFY_CENTER_EDIT, map.getCenter());
}
}
Aggregations