diff --git a/mappings/net/minecraft/SharedConstants.mapping b/mappings/net/minecraft/SharedConstants.mapping index 08e767f207..ae82d13ee6 100644 --- a/mappings/net/minecraft/SharedConstants.mapping +++ b/mappings/net/minecraft/SharedConstants.mapping @@ -30,6 +30,15 @@ CLASS net/minecraft/class_155 net/minecraft/SharedConstants ARG 0 gameVersion METHOD method_36208 createGameVersion ()V METHOD method_643 isValidChar (C)Z + COMMENT {@return true if the character is not {@linkplain + COMMENT net.minecraft.util.Formatting#FORMATTING_CODE_PREFIX the formatting code + COMMENT prefix} (\u00a7), C0 control code (\u0000 to \u001f) or + COMMENT delete (\u007f)} + COMMENT + COMMENT @apiNote This method is used to determine if the server should + COMMENT accept a chat message sent from client. + COMMENT + COMMENT @see net.minecraft.server.network.ServerPlayNetworkHandler#onChatMessage ARG 0 chr METHOD method_644 stripInvalidChars (Ljava/lang/String;)Ljava/lang/String; ARG 0 s diff --git a/mappings/net/minecraft/client/gui/hud/ChatHud.mapping b/mappings/net/minecraft/client/gui/hud/ChatHud.mapping index dde96fbf5e..a1bc71ff17 100644 --- a/mappings/net/minecraft/client/gui/hud/ChatHud.mapping +++ b/mappings/net/minecraft/client/gui/hud/ChatHud.mapping @@ -1,4 +1,8 @@ CLASS net/minecraft/class_338 net/minecraft/client/gui/hud/ChatHud + COMMENT Responsible for rendering various game messages such as chat messages or + COMMENT join/leave messages. + COMMENT + COMMENT @see net.minecraft.client.gui.screen.ChatScreen FIELD field_2061 messages Ljava/util/List; FIELD field_2062 client Lnet/minecraft/class_310; FIELD field_2063 messageHistory Ljava/util/List; diff --git a/mappings/net/minecraft/client/gui/screen/ChatScreen.mapping b/mappings/net/minecraft/client/gui/screen/ChatScreen.mapping index a74cc7d585..8faa0409bc 100644 --- a/mappings/net/minecraft/client/gui/screen/ChatScreen.mapping +++ b/mappings/net/minecraft/client/gui/screen/ChatScreen.mapping @@ -1,4 +1,10 @@ CLASS net/minecraft/class_408 net/minecraft/client/gui/screen/ChatScreen + COMMENT A screen that allows player to input a chat message. It can be opened by + COMMENT pressing {@linkplain net.minecraft.client.option.GameOptions#keyChat the + COMMENT chat key} or {@linkplain net.minecraft.client.option.GameOptions#keyCommand + COMMENT the command key}. + COMMENT + COMMENT @see net.minecraft.client.gui.hud.ChatHud FIELD field_18973 originalChatText Ljava/lang/String; FIELD field_21616 commandSuggestor Lnet/minecraft/class_4717; FIELD field_2382 chatField Lnet/minecraft/class_342; diff --git a/mappings/net/minecraft/client/network/ClientPlayerEntity.mapping b/mappings/net/minecraft/client/network/ClientPlayerEntity.mapping index 338c9a6903..7e6637907d 100644 --- a/mappings/net/minecraft/client/network/ClientPlayerEntity.mapping +++ b/mappings/net/minecraft/client/network/ClientPlayerEntity.mapping @@ -80,7 +80,20 @@ CLASS net/minecraft/class_746 net/minecraft/client/network/ClientPlayerEntity METHOD method_3141 onRecipeDisplayed (Lnet/minecraft/class_1860;)V ARG 1 recipe METHOD method_3142 sendChatMessage (Ljava/lang/String;)V + COMMENT Sends a chat message to the server. + COMMENT + COMMENT
The message will be truncated to at most 256 characters before + COMMENT sending to the server. + COMMENT + COMMENT
If the message contains an invalid character (see {@link + COMMENT net.minecraft.SharedConstants#isValidChar isValidChar}), the server will + COMMENT reject the message and disconnect the client. + COMMENT + COMMENT @apiNote This method is used to send a message typed in {@linkplain + COMMENT net.minecraft.client.gui.screen the chat screen}. This includes a + COMMENT command message (a message that starts with {@code /}). ARG 1 message + COMMENT the message to send METHOD method_3143 getStatHandler ()Lnet/minecraft/class_3469; METHOD method_3144 isRiding ()Z METHOD method_3145 setExperience (FII)V diff --git a/mappings/net/minecraft/entity/player/PlayerEntity.mapping b/mappings/net/minecraft/entity/player/PlayerEntity.mapping index 47d82526c8..985ad72a6b 100644 --- a/mappings/net/minecraft/entity/player/PlayerEntity.mapping +++ b/mappings/net/minecraft/entity/player/PlayerEntity.mapping @@ -286,8 +286,24 @@ CLASS net/minecraft/class_1657 net/minecraft/entity/player/PlayerEntity METHOD method_7351 getBlockBreakingSpeed (Lnet/minecraft/class_2680;)F ARG 1 block METHOD method_7353 sendMessage (Lnet/minecraft/class_2561;Z)V + COMMENT Adds a message to this player's HUD. + COMMENT + COMMENT
If it's called on {@link net.minecraft.server.network.ServerPlayerEntity + COMMENT ServerPlayerEntity}, it sends a message to the client corresponding to + COMMENT this player so that the client can add a message to their HUD. If it's + COMMENT called on {@link net.minecraft.client.network.ClientPlayerEntity + COMMENT ClientPlayerEntity}, it just adds a message to their HUD. + COMMENT + COMMENT @see net.minecraft.server.network.ServerPlayerEntity#sendMessage(Text, boolean) + COMMENT @see net.minecraft.client.network.ClientPlayerEntity#sendMessage(Text, boolean) + COMMENT @see net.minecraft.client.gui.hud.ChatHud#addMessage(Text) + COMMENT @see net.minecraft.client.gui.hud.InGameHud#setOverlayMessage ARG 1 message + COMMENT the message to add ARG 2 actionBar + COMMENT {@code true} to show the message as an overlay; {@code false} to add the + COMMENT message to {@linkplain net.minecraft.client.gui.hud.ChatHud the chat + COMMENT hud} METHOD method_7355 sendAbilitiesUpdate ()V METHOD method_7356 getShoulderEntityLeft ()Lnet/minecraft/class_2487; METHOD method_7357 getItemCooldownManager ()Lnet/minecraft/class_1796; diff --git a/mappings/net/minecraft/network/packet/c2s/play/ChatMessageC2SPacket.mapping b/mappings/net/minecraft/network/packet/c2s/play/ChatMessageC2SPacket.mapping index c669bc9acc..ee80a84864 100644 --- a/mappings/net/minecraft/network/packet/c2s/play/ChatMessageC2SPacket.mapping +++ b/mappings/net/minecraft/network/packet/c2s/play/ChatMessageC2SPacket.mapping @@ -1,4 +1,17 @@ CLASS net/minecraft/class_2797 net/minecraft/network/packet/c2s/play/ChatMessageC2SPacket + COMMENT A packet used to send a chat message to the server. + COMMENT + COMMENT
This truncates the message to at most {@value #MAX_LENGTH} characters + COMMENT before sending to the server on the client. If the server receives the + COMMENT message longer than {@value #MAX_LENGTH} characters, it will reject + COMMENT the message and disconnect the client. + COMMENT + COMMENT
If the message contains an invalid character (see {@link
+ COMMENT net.minecraft.SharedConstants#isValidChar isValidChar}), the server will
+ COMMENT reject the message and disconnect the client.
+ COMMENT
+ COMMENT @see net.minecraft.client.network.ClientPlayerEntity#sendChatMessage
+ COMMENT @see net.minecraft.server.network.ServerPlayNetworkHandler#onChatMessage
FIELD field_12764 chatMessage Ljava/lang/String;
FIELD field_33359 MAX_LENGTH I
METHOD