- Jigsaw blocks crash the game MC-251316
The big chat refactor continues; this time, they introduced "signed command arguments". This is used by MessageArgumentType
and TextArgumentType
. The client parses the commands and signs each argument. (see ArgumentSignatures
) This also means the packets for commands are now separate from the chat message packet. (see CommandExecutionC2SPacket
) Note that you can still use ClientPlayerEntity#sendChatMessage(String)
with /
-prefixed string to execute commands.
New classes:
ChatMessageSignature
is the signature for chat messages, containing the UUID, timestamp, andNetworkEncryptionUtils.SignatureData
. Thenone
static method returns the bogus signature - use this instead ofNetworkEncryptionUtils.SignatureData#NONE
.updateSignature
method signs the message.SignedChatMessage
contains the chat message text and the signature. (This is used inPlayerManager#broadcast
, etc.)ChatSigner
signs the chat message. (the actual logic is inChatMessageSignature
)CommandArgumentSigner
signs the commands.
To allow custom message texts without breaking signatures, Mojang has introduced custom message types that server sends to clients. They are DRM-managed and defined in data/(namespace)/chat_type
in the data packs. The message type contains "chat", "overlay", and "narration" fields, and are interpreted client-side.
The Display
for the "chat" and "overlay" and Narration
for the "narration" contain the "decoration" field, which specifies the decorations applied to the message. Decoration
consists of the translation key, parameters of the translation (can be chosen from sender name, message content, and the team name only for /teammsg
), and the style.
Message type can also control the "priority" of the narration. Currently there are only two types - chat and system, where system message narrations interrupt chat message narrations. (Note that this is also used to check if it should narrate in the first place when Narrator option is set to "narrate chat/narrate system".)
GameEvent
got a new inner class,Info
, that contains information about the event (like the emitted event and the emitter).- Banner patterns are no longer enums and instead use registry, making custom patterns way easier. The patterns that appear on Loom (the block, not build script) can be controlled by tags.
- Similarly, goat horn instruments are registry-controlled now.
RegistryKeyArgumentType
contains new static methods for use with the new/place
command.PacketByteBuf
: new methodsreadNullable
andwriteNullable
. Also,BiFunction
passed to writers are replaced withPacketByteBuf.PacketWriter
andFunction
passed to readers are replaced withPacketByteBuf.PacketReader
, but this only impacts those who extend the interface (like in Java 7) instead of using functional interfaces.asChatSender
now exists inEntity
rather thanPlayerEntity
. Again, recompile should be enough.ChatMessageSender
record now contains theteamName
field. To set the team name usewithTeamName
.- Server resource pack handling has changed, but I haven't reviewed it yet. One thing to note is that
resource-pack-hash
server property is obsoleted and they should switch toresource-pack-sha1
. Not providing the SHA1 hash will also lead to a console warning. ServerCommandSource
:isExecutedByPlayer
,getChatMessageSender
,getSigner
(returns the argument signer), andwithSigner
added.Style
now has a codec and theof
method that takesOptional
instead of nullable constructor.TextColor
andFormatting
also received codecs.Identifier#of
allows constructing an identifier from the namespace and the path, but unlike the constructor it returnsnull
when the arguments are invalid, instead of throwing.JsonHelper
got new methods that stringify the JSON object with sorted keys.StringHelper#truncateChat
truncates the passed message to at most 256 characters with no ellipsis. This is used by chat.Util#lastIndexGetter
is a reinvented wheel that returnsvalue -> Math.max(0, values.lastIndexOf(value))
.Uncaught SleepRequiredError: apple502j needs some sleep at ChangelogWriter.java @ 247