Document chat stuff (#2881)

* Document chat stuff

* Remove apiNote from ChatMessageC2SPacket

* Links broadcast from and to sendMessage

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
enbrain 2021-11-25 05:16:37 +09:00 committed by GitHub
parent 8dc444e87e
commit db9a80f418
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 78 additions and 0 deletions

View File

@ -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} (&bsol;u00a7), C0 control code (&bsol;u0000 to &bsol;u001f) or
COMMENT delete (&bsol;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

View File

@ -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;

View File

@ -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;

View File

@ -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 <p>The message will be truncated to at most 256 characters before
COMMENT sending to the server.
COMMENT
COMMENT <p>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

View File

@ -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 <p>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;

View File

@ -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 <p>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 <p>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 <init> (Ljava/lang/String;)V

View File

@ -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}

View File

@ -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

View File

@ -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