Online Players sorted by Rank

Discussion in 'BungeeCord Plugin Development' started by Preodym, May 24, 2016.

  1. Hey,

    I want to make a Staff-list on which the Staff members are sorted by rank. How can I 'BungeeCord.getInstance ().GetPlayers ()' can be sorted by rank?
     
  2. Do you mean in Tabbar
     
  3. No, i mean in /staff. I wish that /staff list all online Staff Members sorted by rank :)
     
  4. https://docs.oracle.com/javase/7/do...ml#sort(java.util.List, java.util.Comparator)

    You probably want to use that method. You provide it with a list and comparator, and it will return you a ordered list. Based on your implementation of the comparator, the person with the highest rank will be on top or on the bottom of the returned list. Of course you need something to compare online users to, so I would suggest creating a object with a 'rankLevel' or something similar to compare.
     
  5. 'BungeeCord.getInstance ().GetPlayers ()