Search in sources :

Example 1 with DefaultStage

use of com.elmakers.mine.bukkit.arena.DefaultStage in project MagicPlugin by elBukkit.

the class ArenaCommandExecutor method onNameArenaStage.

protected void onNameArenaStage(CommandSender sender, Arena arena, String[] args) {
    EditingStage stage = arena.getEditingStage();
    if (stage instanceof DefaultStage) {
        sender.sendMessage(ChatColor.RED + "Can't rename default stage");
        return;
    }
    if (args.length == 0) {
        stage.setName(null);
        sender.sendMessage("Cleared name of " + ChatColor.YELLOW + stage.getName());
        return;
    }
    String name = StringUtils.join(args, " ");
    stage.setName(name);
    sender.sendMessage("Set name to " + ChatColor.YELLOW + stage.getName());
}
Also used : EditingStage(com.elmakers.mine.bukkit.arena.EditingStage) DefaultStage(com.elmakers.mine.bukkit.arena.DefaultStage)

Aggregations

DefaultStage (com.elmakers.mine.bukkit.arena.DefaultStage)1 EditingStage (com.elmakers.mine.bukkit.arena.EditingStage)1