[MC-40] Calculate name plate length based on username stripped of color codes Created: 24/Oct/12  Updated: 09/Feb/13  Resolved: 25/Oct/12

Status: Resolved
Project: Minecraft: Java Edition
Component/s: None
Affects Version/s: Minecraft 1.4.1
Fix Version/s: Minecraft 1.4.3

Type: Bug
Reporter: lol768 Assignee: [Mojang] Grum (Erik Broes)
Resolution: Fixed Votes: 1
Labels: None
Environment:

All operating systems + java versions are affected.


Attachments: PNG File uSXx5.png    
Issue Links:
Relates
relates to MC-3887 Issues with name colors in tab list Resolved
Confirmation Status: Unconfirmed

 Description   

Note: This may well be fixed in 1.4, but it's impossible for me to check due to the lack of a Bukkit build.

Currently, adding colour codes to a user's name plate causes the length calculation for the blackbox under the text to be inaccurate, leaving a gap at the end as shown in the screenshot that is attached.

To fix this, the nameplate length needs to be calculated after using a version of the username stripped of all characters. This would allow colouring nameplates without this visual glitch, at least until the API is ready.



 Comments   
Comment by TerrorBite [ 30/Nov/12 ]

@Grum
Was this fixed for more than just player nameplates? I notice that related issues are also fixed.

For example, if color codes are used in a kick message, the text is now properly center-justified, whereas it would previously be incorrectly offset. Colored text on signs is also now centered correctly.

Either way, thanks for the fix!

Comment by [Mojang] Grum (Erik Broes) [ 25/Oct/12 ]

Fixed when I test it here locally.

Comment by lol768 [ 24/Oct/12 ]

Strictly speaking, it can only be encountered with a modded server, but as PvP + CTF etc etc servers are becoming more popular, I feel this bug is kinda important w/ regards to being fixed.

Vanilla is probably less used than CraftBukkit anyway, due to its superior functionality and API, which are lacking from the vanilla server.

Comment by Nuxas [ 24/Oct/12 ]

Related it would be good if the nameplate length limit was lifted.

As it is now if we are using color codes we must cut down the name to 16 characters to avoid breakage. For the longest usernames that results in cut down names. This also applies to the playerlist(think it is related).

Comment by Cloudy (Aaron Mills) [ 24/Oct/12 ]

Considering this is a bug that can only be experienced by using third party software, I'm not sure that it really counts as a bug. I agree that it is unfortunate for modders, but until the API comes this won't be a vanilla problem. I'm not going to close this as I think someone from Mojang should look at this, but just my two cents.

Generated at Sun Jan 12 11:49:36 UTC 2025 using Jira 9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13.