use of com.gmail.stefvanschiedev.buildinggame.utils.guis.ArenaSelection in project buildinggame by stefvanschie.
the class CommandManager method onJoin.
/**
* Called whenever a player wants to join an arena
*
* @param player the player
* @param arena the arena to join
* @since 5.8.0
*/
@Subcommand("join")
@Description("Join an arena")
@CommandPermission("bg.join")
@CommandCompletion("@arenas")
public void onJoin(Player player, @Optional Arena arena) {
YamlConfiguration messages = SettingsManager.getInstance().getMessages();
if (arena == null) {
for (Arena a : ArenaManager.getInstance().getArenas()) {
if (!a.canJoin()) {
continue;
}
new ArenaSelection().show(player);
return;
}
MessageManager.getInstance().send(player, messages.getStringList("join.no-arena"));
return;
}
arena.join(player);
}
Aggregations