mojira.dev
MC-91499

"Your game mode has been changed" message doesn't print new gamemode in gray and italic everywhere

See attached screenshot for what I mean. It only works this way in singleplayer and LAN games, but only for the host. It doesn't work at all on a server.

It always prints the whole line, but it is not cursive/grey everywhere. It should be cursive everywhere.


Code analysis by @unknown can be found in this comment.

Linked issues

Attachments

Comments 6

I don't think this is an issue but ya this happens to me to

confirmed for 15w45a
just for clairification:
it does print the "updated to XXXX", but only not in cursive/gray

Please link to this comment in the description

The following is based on a decompiled version of Minecraft 1.9 using MCP 9.24 beta.

The bug is that the gamemode is italic and grey. The reason why this happens is because the method net.minecraft.command.CommandGameMode.execute(MinecraftServer, ICommandSender, String[]) passes the net.minecraft.command.CommandGameMode.execute(MinecraftServer, ICommandSender, String[]).itextcomponent (translation for gamemode) directly to the method net.minecraft.command.CommandBase.notifyOperators(ICommandSender, ICommand, int, String, Object...). The problem is that this TextComponentTranslation is used for the feedback in chat as well, however the method notifyOperators(ICommandSender, ICommand, int, String, Object...) sets the color to grey and italic to true. As it is still the same TextComponentTranslation object you will see the changed style in the chat as well. This affects only the owner of a single player world, for example other players joining a LAN server will not see the game mode grey and italic.
This could be probably fixed by creating a new TextComponentTranslation (field net.minecraft.command.ServerCommandManager.notifyOperators(ICommandSender, ICommand, int, String, Object...).itextcomponent) with a copy of all the elements of the argument net.minecraft.command.ServerCommandManager.notifyOperators(ICommandSender, ICommand, int, String, Object...).msgParams.

Affects Version 1.10.2

Minecraft 18w22a removed the text being gray and italic.

[Mod] redstonehelper

(Unassigned)

Confirmed

command-feedback, gamemode, italic

Minecraft 15w43c, Minecraft 15w45a, Minecraft 15w49b, Minecraft 16w43a, Minecraft 1.11, Minecraft 16w50a, Minecraft 1.11.2

Minecraft 1.13.1

Retrieved