Display more than 16 characters in an entry of scoreboard?

Discussion in 'Plugin Development' started by TigerHix, Aug 2, 2014.

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

    TigerHix

    There was a trick which uses team's prefix and suffix to extend the limit to 48 characters. http://forums.bukkit.org/threads/util-simplescoreboard-make-pretty-scoreboards-with-ease.263041/

    But once UUID update is out, Bukkit.getOfflinePlayer(String name) now access Mojang's server for retrieving UUID and hence became unusable to set scoreboard's entries. If we instead use the scoreboard's built-in new method, objective.getScore(String string), the string still cannot be longer than 16 characters.

    Are there any "hacks" on this?
     
  2. Offline

    mactown21

    TigerHix Honestly, this is possible, but not for sure if it will longer stay possible. It may be best to make a scrolling one? And also, Getting the Offline Player does not make the scoreboard not usable.
     
  3. Offline

    fireblast709

    TigerHix have you tried using a score name which is also part of a Team?
     
  4. Offline

    TigerHix

    mactown21 nvm, the getOfflinePlayer hangs the whole thread if can't connect to mojang server. Before getOfflinePlayer doesn't require contacting mojang.

    fireblast709 KraZ__ Cmon I stated this trick in my first sentence.. As I said this still works but will cause the server to lag since you must use objective.getScore(Bukkit.getOfflinePlayer(name)).setScore(int), and the getOfflinePlayer here will connect to Mojang server and hang the thread. I require updating scoreboard per tick, so this method became unusable. If I run the code asynchronously, it's not thread-safe obviously and won't work on 3rd party server client like the one starts with letter S.

    KraZ__ ahh. Because objective.getScore(string) does not allow > 16 characters.

    KraZ__ ..I posted this question because only getOfflinePlayer allows > 16 characters, and it certainly won't work well. I am asking for an alternative solution.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Feb 8, 2022
  5. Offline

    fireblast709

    TigerHix do you use a fixed set of score names? If so you could just get them during onEnable(). If not, then multithreading might become a reality
     
  6. Offline

    TigerHix

    fireblast709 Nope it's fully dynamic. I considered multithreading but this still causes a delay between data changes, and sending 20 requests to mojang per second is still not a good idea. :(
     
  7. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı

    Seek support where you acquired your server mod
     
Thread Status:
Not open for further replies.

Share This Page