[STILL UNSOLVED] Need Help

Discussion in 'Plugin Development' started by BungeeTheCookie, Jul 12, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    BungeeTheCookie

    Hey guys. Since all of Bukkit's getOfflinePlayer() methods and scoreboard whatever junk have been deprecated, I have moved to using Strings for the scoreboard. I am trying to create scrolling scores for the Scoreboard [sort of like Mineplex's] and I am using ScrollerAPI, but whenever I use it, the scoreboard gets filled up with new objective lines and it disappears. This didn't happen with Bukkit.getOffline() player. I am storing stuff in hashmaps to detect whether or not the player has been sent the score before it, and if it has, it will reset that score and put a new one. How do I do this without using getOfflinePlayer()? Here is my current code for example:

    Code:
    private HashMap<String, Score> onlinePlayer = new HashMap<>();
                            Score onlinePlayers = o.getScore((ChatColor.translateAlternateColorCodes('&', "&4&lPlayers")));
                            Score onlinePlayersCount = o.getScore((ChatColor.translateAlternateColorCodes('&', "&6" + ((Integer)Bukkit.getServer().getOnlinePlayers().length).toString() + "        ")));
                            if(onlinePlayer.containsKey(onlinePlayers.toString())){
                                scoreboard.resetScores(onlinePlayers.toString());
                            }
                            onlinePlayer.put(onlinePlayers.toString(), onlinePlayersCount);
    For example, this is used to keep track of online players. When a new player joins, it adds a new score with the current online player instead of deleting the old one. This seems like a question for mbaxter :p

    My question still remains unanswered.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
  2. Offline

    ZodiacTheories

  3. BungeeTheCookie
    Don't tag staff unless it's something important (no offense). I was experiencing this same thing a while back. What I ended up doing was just unregistering the old objective and creating a new one.
     
  4. Offline

    BungeeTheCookie

    ZodiacTheories
    Is that it? No piece of advice?

    Assist
    So for every run, I have to unregister the current objective and load a new one, as opposed to using resetScores()? Wouldn't that cause the scoreboard to glitch?
     
  5. Offline

    mazentheamazin

    BungeeTheCookie
    Enforcing the rules is technically advice to keep your bukkit forums account in good standings.
     
    ZodiacTheories likes this.
Thread Status:
Not open for further replies.

Share This Page