diff --git a/src/main/java/me/waterarchery/littournaments/models/TournamentLeaderboard.java b/src/main/java/me/waterarchery/littournaments/models/TournamentLeaderboard.java index 7a8c622..bbe3b41 100644 --- a/src/main/java/me/waterarchery/littournaments/models/TournamentLeaderboard.java +++ b/src/main/java/me/waterarchery/littournaments/models/TournamentLeaderboard.java @@ -6,6 +6,7 @@ import org.bukkit.scheduler.BukkitTask; import java.util.HashMap; +import java.util.Optional; public class TournamentLeaderboard { @@ -27,8 +28,8 @@ public int getPlayerPos(TournamentPlayer tournamentPlayer) { return 0; } - public TournamentValue getPlayer(int pos) { - return leaderboard.getOrDefault(pos, null); + public Optional getPlayer(int pos) { + return Optional.ofNullable(leaderboard.getOrDefault(pos, null)); } public void startRefreshTask() {