From 4ba2e8c96c56f1819407c4e3a4156a9004dc89b6 Mon Sep 17 00:00:00 2001 From: Cheese Date: Tue, 8 Dec 2015 10:31:11 +1100 Subject: [PATCH] fixed old staff being stuck invis. partially changed scoreboard to show playercount --- .../src/mineplex/hub/HubClient.java | 14 +------------- .../src/mineplex/hub/HubManager.java | 17 ++++++++--------- .../hub/modules/HubVisibilityManager.java | 2 +- 3 files changed, 10 insertions(+), 23 deletions(-) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/HubClient.java b/Plugins/Mineplex.Hub/src/mineplex/hub/HubClient.java index 4008f1b63..4b56eff02 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/HubClient.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/HubClient.java @@ -22,9 +22,7 @@ public class HubClient public int DisplayLength = 16; private int _lastGemCount = 0; - - private int _lastCoinCount = 0; - + public HubClient(String name) { ScoreboardString = " Welcome " + name + ", to the Mineplex Network!"; @@ -133,14 +131,4 @@ public class HubClient return display; } - - public void SetLastCoinCount(int coins) - { - _lastCoinCount = coins; - } - - public int GetLastCoinCount() - { - return _lastCoinCount; - } } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java index ea96b4c65..8e78486e7 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java @@ -165,7 +165,7 @@ public class HubManager extends MiniClientPlugin private HashMap _scoreboards = new HashMap(); private String _serverName = ""; - + private int _lastPlayerCount = 0; private boolean _shuttingDown; private HashMap _portalTime = new HashMap(); @@ -719,15 +719,14 @@ public class HubManager extends MiniClientPlugin //Space obj.getScore(" ").setScore(line--); - //Coins - obj.getScore(C.cYellow + C.Bold + "Coins").setScore(line--); + //Players + obj.getScore(C.cYellow + C.Bold + "Players").setScore(line--); - // Remove Old - player.getScoreboard().resetScores(Get(player.getName()).GetLastCoinCount() + ""); - // Add New - obj.getScore(GetDonation().Get(player.getName()).getCoins() + "").setScore(line--); - - Get(player.getName()).SetLastCoinCount(GetDonation().Get(player.getName()).getCoins()); + player.getScoreboard().resetScores(_lastPlayerCount + ""); + + _lastPlayerCount++; + + obj.getScore(_lastPlayerCount + "").setScore(line--); //Space diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/HubVisibilityManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/HubVisibilityManager.java index db7624cd9..1733a2fcc 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/HubVisibilityManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/HubVisibilityManager.java @@ -65,7 +65,7 @@ public class HubVisibilityManager extends MiniPlugin { boolean hideMe = Manager.GetTutorial().InTutorial(player) || UtilMath.offset2d(player.getLocation(), Manager.GetSpawn()) == 0 || - Manager.getPreferences().Get(player).Invisibility || + (Manager.getPreferences().Get(player).Invisibility && Manager.GetClients().Get(player).GetRank().has(Rank.MODERATOR)) || _hiddenPlayers.contains(player); for (Player other : UtilServer.getPlayers())