From 8cb7a76eeb2df0ab9d68dff40b2e89b438460751 Mon Sep 17 00:00:00 2001 From: graywolf336 Date: Sat, 24 May 2014 14:20:37 -0500 Subject: [PATCH] Fix #27, all scoreboards are managed by UUIDs and no longer names. --- src/main/java/com/graywolf336/jail/ScoreBoardManager.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/graywolf336/jail/ScoreBoardManager.java b/src/main/java/com/graywolf336/jail/ScoreBoardManager.java index 2559963..0c8f0a2 100644 --- a/src/main/java/com/graywolf336/jail/ScoreBoardManager.java +++ b/src/main/java/com/graywolf336/jail/ScoreBoardManager.java @@ -43,13 +43,13 @@ public class ScoreBoardManager { * @param pris data for the provided prisoner */ public void addScoreBoard(Player player, Prisoner pris) { - if(!boards.containsKey(player.getName())) { + if(!boards.containsKey(player.getUniqueId())) { boards.put(player.getUniqueId(), man.getNewScoreboard()); - Objective o = boards.get(player.getName()).registerNewObjective("test", "dummy"); + Objective o = boards.get(player.getUniqueId()).registerNewObjective("test", "dummy"); o.setDisplaySlot(DisplaySlot.SIDEBAR); o.setDisplayName(Util.getColorfulMessage(pl.getConfig().getString(Settings.SCOREBOARDTITLE.getPath()))); o.getScore(time).setScore(pris.getRemainingTimeInMinutesInt()); - player.setScoreboard(boards.get(player.getName())); + player.setScoreboard(boards.get(player.getUniqueId())); }else { updatePrisonersBoard(player, pris); } @@ -99,6 +99,6 @@ public class ScoreBoardManager { * @param pris data for the player */ private void updatePrisonersBoard(Player player, Prisoner pris) { - boards.get(player.getName()).getObjective("test").getScore(time).setScore(pris.getRemainingTimeInMinutesInt()); + boards.get(player.getUniqueId()).getObjective("test").getScore(time).setScore(pris.getRemainingTimeInMinutesInt()); } }