// Grab the old ArenaClass, if any, same => ignore
ArenaClass oldAC = arena.getArenaPlayer(p).getArenaClass();
if (ac.equals(oldAC)) return true;
// If the new class is full, inform the player.
ClassLimitManager clm = arena.getClassLimitManager();
if (!clm.canPlayerJoinClass(ac)) {
Messenger.tell(p, Msg.LOBBY_CLASS_FULL);
return true;
}
// Check price, balance, and inform
double price = ac.getPrice();
if (price > 0D) {
if (!am.getPlugin().hasEnough(p, price)) {
Messenger.tell(p, Msg.LOBBY_CLASS_TOO_EXPENSIVE, am.getPlugin().economyFormat(price));
return true;
}
}
// Otherwise, leave the old class, and pick the new!
clm.playerLeftClass(oldAC, p);
clm.playerPickedClass(ac, p);
if (!lowercase.equalsIgnoreCase("random")) {
if (arena.getSettings().getBoolean("use-class-chests", false)) {
Location loc = ac.getClassChest();
if (loc != null) {