mojira.dev
MC-94325

Shadow of obfuscated text does not match with displayed character

The bug

The shadow of obfuscated text nearly never matches with the character displayed.

How to reproduce

  1. Print obfuscated text, for example

    /tellraw @p {"text":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","obfuscated":true}
  2. Move the window (this causes the text to stop rendering)
    You will see that the shadows do not match with the displayed characters

Even though you could argue that it creates more randomness this is very likely unintended as it is supposed to be a shadow and not a random character.

The reason

The reason for that is that the method func_175065_a(String p_175065_1_, float p_175065_2_, float p_175065_3_, int p_175065_4_, boolean p_175065_5_) of the class net.minecraft.client.gui.FontRenderer (MCP 1.8 names) is used to print text with shadows. There are actually other methods that use the main drawing method as well, but these always disable the shadow.
This method then calls the method func_180455_b(String p_180455_1_, float p_180455_2_, float p_180455_3_, int p_180455_4_, boolean p_180455_5_) twice which means it prints twice a random character (the first time as the actual character, the second time as shadow). Doing this all in the renderStringAtPos(String p_78255_1_, boolean p_78255_2_) method would solve this problem. This might increase the performance as well because currently as unicode is supposed to have no shadow, its shadow is drawn at the same position of the character (in 1.8).

Linked issues

Attachments

Comments 4

Can confirm for 1.10.

Can confirm for MC 1.12.1.

Can confirm for 1.13-pre1

Can confirm for 1.13-pre3

marcono1234

Nathan Adams

Confirmed

obfuscated, random, shadow, text

Minecraft 15w50a, Minecraft 1.10, Minecraft 1.10.2, Minecraft 16w42a, Minecraft 16w43a, ..., Minecraft 17w48a, Minecraft 18w01a, Minecraft 18w11a, Minecraft 1.13-pre1, Minecraft 1.13-pre3

Minecraft 1.13-pre6

Retrieved