use of co.aikar.commands.annotation.CommandCompletion 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.CommandCompletion in project VoxelGamesLibv2 by VoxelGamesLib.
the class StatsCommands method decrement.
@Subcommand("decrement")
@Description("Allows you to decrement the stats of another user")
@CommandPermission("%admin")
@CommandCompletion("@players @stats")
public void decrement(User sender, @Description("the user which stats should be changed") @Flags("other") User user, @Description("the stats type to change") Trackable type, @Description("the amount to decrement, defaults to 1") @Default("1") int amount) {
StatInstance stat = user.getUserData().getStat(type);
stat.decrement(amount);
Lang.msg(sender, LangKey.STATS_DECREMENT, user.getDisplayName(), type.getDisplayName(), type.formatLong(stat.getVal(), sender.getLocale()));
}
use of co.aikar.commands.annotation.CommandCompletion in project VoxelGamesLibv2 by VoxelGamesLib.
the class StatsCommands method set.
@Subcommand("set")
@Description("Allows you to set the stats of another user")
@CommandPermission("%admin")
@CommandCompletion("@players @stats")
public void set(User sender, @Description("the user which stats should be changed") @Flags("other") User user, @Description("the stats type to change") Trackable type, @Description("the new amount") double amount) {
StatInstance stat = user.getUserData().getStat(type);
stat.setVal(amount);
Lang.msg(sender, LangKey.STATS_SET, user.getDisplayName(), type.getDisplayName(), type.formatShort(stat.getVal()));
}
use of co.aikar.commands.annotation.CommandCompletion in project VoxelGamesLibv2 by VoxelGamesLib.
the class StatsCommands method increment.
@Subcommand("increment")
@Description("Allows you to increment the stats of another user")
@CommandPermission("%admin")
@CommandCompletion("@players @stats")
public void increment(User sender, @Description("the user which stats should be changed") @Flags("other") User user, @Description("the stats type to change") Trackable type, @Description("the amount to increment, defaults to 1") @Default("1") int amount) {
StatInstance stat = user.getUserData().getStat(type);
stat.increment(amount);
Lang.msg(sender, LangKey.STATS_INCREMENT, user.getDisplayName(), type.getDisplayName(), type.formatLong(stat.getVal(), sender.getLocale()));
}
Aggregations