From 5da8c8ea0aecb72bc88e9e05700f20f7d5837a1b Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Sat, 7 May 2022 23:59:08 -0400 Subject: [PATCH] fix Top.java --- src/main/java/net/tylermurphy/hideAndSeek/command/Top.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/Top.java b/src/main/java/net/tylermurphy/hideAndSeek/command/Top.java index 760bb2c..51e3574 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/command/Top.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/command/Top.java @@ -50,6 +50,10 @@ public class Top implements ICommand { ChatColor.WHITE, ChatColor.BOLD, ChatColor.GRAY, page, ChatColor.WHITE)); List infos = Database.playerInfo.getInfoPage(page); int i = 1 + (page-1)*10; + if(infos == null){ + sender.sendMessage(errorPrefix + message("NO_GAME_INFO")); + return; + } for(PlayerInfo info : infos){ String name = Main.plugin.getServer().getOfflinePlayer(info.uuid).getName(); ChatColor color; @@ -60,7 +64,7 @@ public class Top implements ICommand { default: color = ChatColor.WHITE; break; } message.append(String.format("%s%s. %s%s %s%s\n", - color, i, ChatColor.RED, info.wins, ChatColor.WHITE, name)); + color, i, ChatColor.RED, info.seeker_wins+info.hider_wins, ChatColor.WHITE, name)); i++; } sender.sendMessage(message.toString());