Advertisement
Simagdo

Player sort

Feb 8th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. for (int i = 0; i < this.plugin.online.size(); i++) {
  2. if (this.plugin.redTeam.size() > this.plugin.blueTeam.size()) {
  3. this.plugin.blueTeam.add(player);
  4. Bukkit.broadcastMessage(player.getName() + " joined the Blue Team");
  5. this.plugin.online.remove(player);
  6. } else if (this.plugin.blueTeam.size() > this.plugin.redTeam.size()) {
  7. this.plugin.redTeam.add(player);
  8. Bukkit.broadcastMessage(player.getName() + " joined the Red Team");
  9. this.plugin.online.remove(player);
  10. } else {
  11. Random random = new Random();
  12. if (random.nextBoolean()) {
  13. this.plugin.redTeam.add(player);
  14. Bukkit.broadcastMessage(player.getName() + " joined the Red Team");
  15. } else {
  16. this.plugin.blueTeam.add(player);
  17. Bukkit.broadcastMessage(player.getName() + " joined the Blue Team");
  18. }
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement