Need some scoreboard advice

Discussion in 'Plugin Development' started by gamemster2468, Jun 11, 2016.

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

    gamemster2468

    Hi there,

    So for the last 2 days I have been struggling a lot with updating scoreboards, and please before referring me to another thread just listen: I have looked through thread after thread trying different methods, such as using buffers, team prefixes, and trying to save the data in a HashMap then retrieving it and using the resetScore() method. I decided to go with the Team way, using the setPrefix() and setSuffix() methods because community members said that it was a good way, to not have flash and to not know the previous score.

    My goal here is not to have a complete flash proof scoreboard, but one that doesn't flash every second and I can update a Score without knowing the previous score. (For example, I have a Score that is formatted time for a game: 00:00 and I can just update it every second without having to do math (or not) and figure out the previous score)

    So far, I have tried to make a Scoreboard util class: http://hastebin.com/uzexucupol.avrasm Which the output is: http://i.imgur.com/lzbah1w.png

    If anyone has any advice or tips, not actual code, because being spoon fed is not what I want, that would be great!

    Thank you
    Stargate
     
  2. Offline

    Zombie_Striker

    @gamemster2468
    First, what do you mean by "flash"? Second, nothing in the code provided should 'flash' in any way. For us to know what is causing this flashing, we would need to see how you are creating and modifying the scoreboards. Finally, you say you want to be able to update the score without knowing the previous score. This does not really make sense to me. Do you mean you want to be able to modify an entry without knowing the previous score for that entry?

    btw: It's always nice seeing someone who doesn't want to be spoonfed.
     
  3. Offline

    gamemster2468

    Flash or Flicker, same thing.
    This is what I mean't, sorry lol.

    @Zombie_Striker
     
  4. Offline

    Zombie_Striker

    @gamemster2468
    First, I still do not know what you mean by flash or flicker. Also, I still do not know why this is even happening, as you have not posted how you are creating the scoreboards.

    As for modifying an entry, the to do that would be to have a reference object. That means you will have to provide an entry that will either be above of below the new entry. To code it, you would take the score of the reference object, add or subtract 1 from it, set that as the score for the new entry, and modify the scores of the entries above or below it.
     
  5. Offline

    gamemster2468

    That's exactly what I want to avoid >.>

    Also, the utility is there, the actual "code" that you want is two lines. The problems occur in the utility.

    Anyone else have any ideas?
     
  6. Offline

    Zombie_Striker

    public void updateScore(String teamName, String text) {
    Team team = scoreboard.getTeam(teamName);
    team.setPrefix("");
    team.setPrefix(text);

    could this be you're issue? You're setting the prefix to two things in the same method.
     
Thread Status:
Not open for further replies.

Share This Page