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 (Ljava/lang/String;)V diff --git a/mappings/net/minecraft/network/packet/s2c/play/GameMessageS2CPacket.mapping b/mappings/net/minecraft/network/packet/s2c/play/GameMessageS2CPacket.mapping index 48c7d94ab8..eb737787b3 100644 --- a/mappings/net/minecraft/network/packet/s2c/play/GameMessageS2CPacket.mapping +++ b/mappings/net/minecraft/network/packet/s2c/play/GameMessageS2CPacket.mapping @@ -1,4 +1,8 @@ CLASS net/minecraft/class_2635 net/minecraft/network/packet/s2c/play/GameMessageS2CPacket + COMMENT A packet used to send a game message to the client. + COMMENT + COMMENT @see net.minecraft.server.network.ServerPlayerEntity#sendMessage(Text, MessageType, UUID) + COMMENT @see net.minecraft.client.network.ClientPlayNetworkHandler#onGameMessage FIELD field_12112 message Lnet/minecraft/class_2561; FIELD field_12113 type Lnet/minecraft/class_2556; FIELD field_25133 sender Ljava/util/UUID; @@ -11,3 +15,6 @@ CLASS net/minecraft/class_2635 net/minecraft/network/packet/s2c/play/GameMessage METHOD method_11388 getMessage ()Lnet/minecraft/class_2561; METHOD method_11389 getType ()Lnet/minecraft/class_2556; METHOD method_29175 getSender ()Ljava/util/UUID; + COMMENT {@return {@linkplain net.minecraft.entity.Entity#getUuid the UUID of the + COMMENT entity} that sends the message or {@link net.minecraft.util.Util#NIL_UUID} + COMMENT if the message is not sent by an entity} diff --git a/mappings/net/minecraft/server/PlayerManager.mapping b/mappings/net/minecraft/server/PlayerManager.mapping index faea58996a..265fb408a1 100644 --- a/mappings/net/minecraft/server/PlayerManager.mapping +++ b/mappings/net/minecraft/server/PlayerManager.mapping @@ -136,6 +136,7 @@ CLASS net/minecraft/class_3324 net/minecraft/server/PlayerManager COMMENT message or a join/leave message. COMMENT COMMENT @see #broadcast(Text, Function, MessageType, UUID) + COMMENT @see ServerPlayerEntity#sendMessage(Text, MessageType, UUID) ARG 1 message COMMENT the message to broadcast ARG 2 type @@ -158,6 +159,7 @@ CLASS net/minecraft/class_3324 net/minecraft/server/PlayerManager COMMENT screen}. COMMENT COMMENT @see #broadcast(Text, MessageType, UUID) + COMMENT @see ServerPlayerEntity#sendMessage(Text, MessageType, UUID) ARG 1 serverMessage COMMENT the message to send to the server console ARG 2 playerMessageFactory diff --git a/mappings/net/minecraft/server/network/ServerPlayerEntity.mapping b/mappings/net/minecraft/server/network/ServerPlayerEntity.mapping index fbb9c8bfac..e13becace8 100644 --- a/mappings/net/minecraft/server/network/ServerPlayerEntity.mapping +++ b/mappings/net/minecraft/server/network/ServerPlayerEntity.mapping @@ -134,9 +134,17 @@ CLASS net/minecraft/class_3222 net/minecraft/server/network/ServerPlayerEntity ARG 1 level METHOD method_14253 getRecipeBook ()Lnet/minecraft/class_3441; METHOD method_14254 sendMessage (Lnet/minecraft/class_2561;Lnet/minecraft/class_2556;Ljava/util/UUID;)V + COMMENT Sends a message to the client corresponding to this player. + COMMENT + COMMENT @see net.minecraft.server.PlayerManager#broadcast(Text, MessageType, UUID) ARG 1 message + COMMENT the message to send ARG 2 type + COMMENT the message type ARG 3 sender + COMMENT {@linkplain Entity#getUuid the UUID of the entity} that sends a message + COMMENT or {@link net.minecraft.util.Util#NIL_UUID} to indicate that the message + COMMENT is not sent by an entity METHOD method_14255 sendResourcePackUrl (Ljava/lang/String;Ljava/lang/String;ZLnet/minecraft/class_2561;)V ARG 1 url ARG 2 hash