mojira.dev
MC-40

Calculate name plate length based on username stripped of color codes

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.

Linked issues

Attachments

Comments 5

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.

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).

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.

Fixed when I test it here locally.

@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!

lol768

Erik Broes

Unconfirmed

Minecraft 1.4.1

Minecraft 1.4.3

Retrieved