Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-94325

Shadow of obfuscated text does not match with displayed character

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Minecraft 1.13-pre6
    • Minecraft 15w50a, Minecraft 1.10, Minecraft 1.10.2, Minecraft 16w42a, Minecraft 16w43a, Minecraft 1.11, Minecraft 1.11.2, Minecraft 17w18b, Minecraft 1.12 Pre-Release 6, Minecraft 1.12.1, Minecraft 1.12.2, Minecraft 17w43a, Minecraft 17w43b, Minecraft 17w45a, Minecraft 17w48a, Minecraft 18w01a, Minecraft 18w11a, Minecraft 1.13-pre1, Minecraft 1.13-pre3
    • Confirmed

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

            dinnerbone [Mojang] Nathan Adams
            marcono1234 [Mod] Marcono1234
            Votes:
            7 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: