Random sized space at end of nameplate

Discussion in 'Plugin Development' started by Superckl1, Jan 28, 2014.

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

    Superckl1

    Hey everyone,

    I'm having a problem with Scoreboards Teams. As you can see in this image:
    [​IMG]

    there is a huge space at the end of a player's nameplate. This space appears whether or not I apply a suffix or prefix to players. However, if I don't assign the player a suffix or prefix, the space isn't there. Here is the code I use to set teams:

    Code:java
    1. final Team team = this.instance.getScoreboard().registerNewTeam(e.getPlayer().getName());
    2. team.setPrefix(ChatColor.translateAlternateColorCodes('&', user.getPrefix()));
    3. team.setSuffix((ChatColor.RESET+" -"+ChatColor.YELLOW+" Level "+player.getExpLevel()).trim());
    4. team.addPlayer(e.getPlayer());


    Does anyone know why this is happening?

    EDIT: I tried it without color codes, and the space is gone. Does anyone know why color codes would cause that space?
     
  2. Offline

    Garris0n

    Why does your text look like that?
     
  3. Offline

    Superckl1

    Garris0n
    I assume you mean the font? I have a texture pack on in that picture. It is there without the texture pack.
     
  4. Offline

    Garris0n

    Ah, alright. Maybe it's just a bug in nameplates...what happens if you put a reset code on the end of it?
     
  5. Offline

    Superckl1

    Garris0n

    I tried that. Another developer and I have developed a theory that Minecraft makes the nameplate box the size of the text before removing the color codes, and thus a huge space is created at the end. Can anyone confirm or deny this?
     
  6. Offline

    L33m4n123


    try it out. Add even more color codes and see if it gets bigger
     
  7. Offline

    Superckl1

    L33m4n123

    That's how we stumbled on that theory. I was just hoping it was false.

    EDIT: I just sifted through a bit of MCP for 1.5.2 and regrettably confirmed my theory. Thanks for the help everyone.

    L33m4n123
    Garris0n
    Never mind, I'm no longer entirely sure what's happening at all. The size of the space randomly changed a little while ago, and I experimented more with color codes and realized they actually don't change it. I'm really confused with this one...

    Could it be another plugin? We don't have any plugins that modify Teams but we do have plugins like ProtocolLib and ControllableMobs that I use for other things.

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

    Garris0n

    Would you mind giving a plugin list?
     
  9. Offline

    Superckl1

    Garris0n
    Sure.
    [​IMG]
    MODCore is my plugin.
     
  10. Offline

    Garris0n

    You should see if the space is there when only your plugin is on the server.
     
  11. Offline

    Superckl1

    Garris0n

    Yeah, I tested it with no plugins and it will still there. :(

    Anymore ideas?
     
  12. Offline

    Garris0n

    Is that the only team code in your plugin?
     
  13. Offline

    Superckl1

    Garris0n

    Besides this when they quit:
    Code:java
    1. this.instance.getScoreboard().getTeam(e.getPlayer().getName()).unregister();

    Yes.
     
  14. Offline

    Garris0n

    I'm basically just making stuff up at this point, but what happens if you remove all the text and just add random color codes?
     
  15. Offline

    Superckl1

    With only color codes, the space is, unfortunately, there:

    [​IMG]
     
Thread Status:
Not open for further replies.

Share This Page