mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2025-02-07 07:11:25 +01:00
Added ability to get leaderboard position of offline players
This commit is contained in:
parent
a9e3dc6148
commit
154aab7ee5
@ -83,6 +83,14 @@ public class LeaderboardManager {
|
||||
}
|
||||
|
||||
public int getPlayerIslandLeaderboardPosition(Player player, Leaderboard.Type type) {
|
||||
return getPlayerIslandLeaderboardPosition(player.getUniqueId(), type);
|
||||
}
|
||||
|
||||
public int getPlayerIslandLeaderboardPosition(OfflinePlayer offlinePlayer, Leaderboard.Type type) {
|
||||
return getPlayerIslandLeaderboardPosition(offlinePlayer.getUniqueId(), type);
|
||||
}
|
||||
|
||||
public int getPlayerIslandLeaderboardPosition(UUID uuid, Leaderboard.Type type) {
|
||||
VisitManager visitManager = skyblock.getVisitManager();
|
||||
visitManager.loadIslands();
|
||||
|
||||
@ -111,7 +119,7 @@ public class LeaderboardManager {
|
||||
leaderboardPlayers.sort(Comparator.comparingLong(LeaderboardPlayer::getValue).reversed());
|
||||
|
||||
for (int i = 0; i < leaderboardPlayers.size(); i++) {
|
||||
if (leaderboardPlayers.get(i).getUUID().equals(player.getUniqueId())) {
|
||||
if (leaderboardPlayers.get(i).getUUID().equals(uuid) {
|
||||
return i + 1;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user