Lines being cut off
zeronerve opened this issue · 14 comments
The text in my holo is being cut off at various lengths. See the attached image. I'm running Paper 1.13.2 with the latest version of HD. Is there a line length limit?
Here's the code that generates the holo. I've tried this without StringBuilder with no change. I'm not using StringBuilder for any useful purpose, other than to see if it magically fixed the problem.
I'm using a singlar/plural method sp() to return appropriate labels.
If I log the textLine String, it returns the proper length.
If I remove all the ChatColors, the problem still occurs.
...
while (leadersIterator.hasNext()) {
Leader l = (Leader) leadersIterator.next();
StringBuilder textLine = new StringBuilder();
textLine.append(ChatColor.YELLOW + "#" + i + " " + ChatColor.GOLD + l.getUsername() + " : ");
textLine.append("" + ChatColor.WHITE + l.getPoints() + " " + ChatColor.LIGHT_PURPLE + sp(l.getPoints(), "Point", "Points"));
textLine.append(" " + ChatColor.WHITE + l.getCaptures() + " " + ChatColor.LIGHT_PURPLE + sp(l.getCaptures(), "Cap", "Caps"));
textLine.append(" " + ChatColor.WHITE + l.getWins() + " " + ChatColor.LIGHT_PURPLE + sp(l.getWins(), "Win", "Wins"));
textLine.append(" " + ChatColor.WHITE + l.getKills() + " " + ChatColor.LIGHT_PURPLE + sp(l.getKills(), "Kill", "Kills"));
textLine.append(" " + ChatColor.WHITE + l.getDeaths() + " " + ChatColor.LIGHT_PURPLE + sp(l.getDeaths(), "Death", "Deaths"));
textLine.append(" " + ChatColor.WHITE + l.getRecoveries() + " " + ChatColor.LIGHT_PURPLE + sp(l.getRecoveries(), "Recovery", "Recoveries"));
textLine.append(" " + ChatColor.WHITE + l.getGamesPlayed() + " " + ChatColor.LIGHT_PURPLE + sp(l.getGamesPlayed(), "Game", "Games"));
TextLine line3 = leaderboardHolo.appendTextLine(textLine.toString());
if (i > 3) leadersIterator.remove();
i++;
}
Before setting the line, could you get the string and check the length? The current length limit is 300, counting colors too (each one is 2 characters).
I did some testing on 1.8.9. There is a limit of 256 characters, including colors, client side, and that cannot be bypassed. However, I've counted the characters in the screenshot and the total is 64 including colors. Are you using the vanilla 1.8.9 client?
The image you are talking about was not uploaded. About 1.8.9 vs 1.13.2, are you talking about the client versions only? What version is the server running?
I found the issue in ProtocolSupport's code: https://github.com/ProtocolSupport/ProtocolSupport/blob/master/src/protocolsupport/protocol/typeremapper/entity/metadata/types/base/LivingEntityMetadataRemapper.java#L17
It incorrectly limits the nametag to 64 characters, like it was in 1.6. Please open an issue on their repository. I'm closing this one, as the bug is not caused by Holographic Displays.