From e485927a4bb75360e1aadc232fbba14f328b037b Mon Sep 17 00:00:00 2001 From: Yaruma3341 Date: Tue, 7 Jan 2020 23:25:27 +0100 Subject: [PATCH] code cleanup and hotfix --- .../de/steamwar/scoreboard/SWScoreboard.java | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/SpigotCore_Main/src/de/steamwar/scoreboard/SWScoreboard.java b/SpigotCore_Main/src/de/steamwar/scoreboard/SWScoreboard.java index 883057b..bbe6ed2 100644 --- a/SpigotCore_Main/src/de/steamwar/scoreboard/SWScoreboard.java +++ b/SpigotCore_Main/src/de/steamwar/scoreboard/SWScoreboard.java @@ -41,34 +41,34 @@ public class SWScoreboard { return true; } - public boolean removeScoreboard(Player player) { - if(playerBoards.containsKey(player)) { - switch (Core.getVersion()) { - case 8: - ((SWScoreboard_8) playerBoards.get(player)).deleteScoreboard(player); - break; - case 9: - ((SWScoreboard_9) playerBoards.get(player)).deleteScoreboard(player); - break; - case 10: - ((SWScoreboard_10) playerBoards.get(player)).deleteScoreboard(player); - break; - case 12: - ((SWScoreboard_12) playerBoards.get(player)).deleteScoreboard(player); - break; - case 14: - ((SWScoreboard_14) playerBoards.get(player)).deleteScoreboard(player); - break; - case 15: - ((SWScoreboard_15) playerBoards.get(player)).deleteScoreboard(player); - break; - default: - return false; - } - playerBoards.remove(player); - return true; + public static boolean removeScoreboard(Player player) { + if(!playerBoards.containsKey(player)) + return false; + + switch (Core.getVersion()) { + case 8: + ((SWScoreboard_8) playerBoards.get(player)).deleteScoreboard(player); + break; + case 9: + ((SWScoreboard_9) playerBoards.get(player)).deleteScoreboard(player); + break; + case 10: + ((SWScoreboard_10) playerBoards.get(player)).deleteScoreboard(player); + break; + case 12: + ((SWScoreboard_12) playerBoards.get(player)).deleteScoreboard(player); + break; + case 14: + ((SWScoreboard_14) playerBoards.get(player)).deleteScoreboard(player); + break; + case 15: + ((SWScoreboard_15) playerBoards.get(player)).deleteScoreboard(player); + break; + default: + return false; } - return false; + playerBoards.remove(player); + return true; } //Scoreboard Updater