Add new method to check if any players are in any arena

This commit is contained in:
addstar 2015-05-07 14:34:31 +10:00
parent e144827afd
commit b353589963

View File

@ -457,4 +457,14 @@ public class ArenaHandler {
arena.timer = 0;
arena.playersInArena.clear();
}
}
public static boolean noPlayersInArenas() {
// Check if there are any players in any arena (quick way to early exit for event handlers)
for (Arena arena : W.arenaList) {
if (arena.playersInArena.size() > 0) {
return false;
}
}
return true;
}
}