Development Assistance Tab list name longer than 16 characters and Colored

Discussion in 'Plugin Help/Development/Requests' started by I Al Istannen, Apr 21, 2015.

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

    I Al Istannen

    Hi,
    I have a problem with the tablist name. I am using a scoreboard team to set the prefix. The prefix can be as long as it wants, but as soon as I color the prefix and its too long it kicks all clients because the "io.netty.ha ndler.coeec.decoderException: The recieved String length is longer than maximum allowed (x > 16)"

    My code is like this:

    Code:
        Player play = null;
         Scoreboard board = Bukkit.getScoreboardManager().getNewScoreboard();
      
         for(Teams team1 : Teams.values()) {
              
           Team team = board.registerNewTeam(team1.getNiceName());
           team.setAllowFriendlyFire(false);
           String prefix = ChatColor.translateAlternateColorCodes('&',Quidditch.getInstance().getConfig().getString("Team Prefix." + team1.getNiceName()));
    //       if(prefix.length() > 16) {
    //        prefix = ChatColor.stripColor(prefix); // just a work around
    //       }
           team.setPrefix(prefix);
           team.setNameTagVisibility(NameTagVisibility.ALWAYS);
        
           for(UUID id : TeamManager.getInstance().getPlayerinTeam(team1)) {
             play = Bukkit.getPlayer(id);
    
             team.addPlayer(play);
          
             play.setScoreboard(board);
           }
         }
    
    Teams is a custom enum, Quidditch the class extending JavaPlugin. TeamManager is another custom class.
    Any help is appreciated(right word?) :)
     
    Last edited: Apr 21, 2015
  2. Offline

    pie_flavor

    @I Al Istannen What version of what server are you using? Because I know for a fact that if you NBT edited the scoreboard prefix, and did it automatically, it would work in vanilla.
     
  3. Offline

    I Al Istannen

    @pie_flavor I am using "Craftbukkit" 1.8.3. I will have a look at what you said after school. Thank you :)
     
Thread Status:
Not open for further replies.

Share This Page