ServerboundChatCommandSignedPacket.java

net.minecraft.network.protocol.game.ServerboundChatCommandSignedPacket

信息

  • 全限定名:net.minecraft.network.protocol.game.ServerboundChatCommandSignedPacket
  • 类型:public record
  • 包:net.minecraft.network.protocol.game
  • 源码路径:src/main/java/net/minecraft/network/protocol/game/ServerboundChatCommandSignedPacket.java
  • 起始行号:L11
  • 实现:Packet
  • 职责:

    TODO

字段/常量

  • STREAM_CODEC
    • 类型: StreamCodec<FriendlyByteBuf,ServerboundChatCommandSignedPacket>
    • 修饰符: public static final
    • 源码定位: L14
    • 说明:

      TODO

内部类/嵌套类型

构造器

private ServerboundChatCommandSignedPacket(FriendlyByteBuf input) @ L18

  • 构造器名:ServerboundChatCommandSignedPacket
  • 源码定位:L18
  • 修饰符:private

参数:

  • input: FriendlyByteBuf

说明:

TODO

方法

下面的方法块按源码顺序生成。

private void write(FriendlyByteBuf output) @ L22

  • 方法名:write
  • 源码定位:L22
  • 返回类型:void
  • 修饰符:private

参数:

  • output: FriendlyByteBuf

说明:

TODO

public PacketType<ServerboundChatCommandSignedPacket> type() @ L30

  • 方法名:type
  • 源码定位:L30
  • 返回类型:PacketType
  • 修饰符:public

参数:

说明:

TODO

public void handle(ServerGamePacketListener listener) @ L35

  • 方法名:handle
  • 源码定位:L35
  • 返回类型:void
  • 修饰符:public

参数:

  • listener: ServerGamePacketListener

说明:

TODO

代码

public record ServerboundChatCommandSignedPacket(
    String command, Instant timeStamp, long salt, ArgumentSignatures argumentSignatures, LastSeenMessages.Update lastSeenMessages
) implements Packet<ServerGamePacketListener> {
    public static final StreamCodec<FriendlyByteBuf, ServerboundChatCommandSignedPacket> STREAM_CODEC = Packet.codec(
        ServerboundChatCommandSignedPacket::write, ServerboundChatCommandSignedPacket::new
    );
 
    private ServerboundChatCommandSignedPacket(FriendlyByteBuf input) {
        this(input.readUtf(), input.readInstant(), input.readLong(), new ArgumentSignatures(input), new LastSeenMessages.Update(input));
    }
 
    private void write(FriendlyByteBuf output) {
        output.writeUtf(this.command);
        output.writeInstant(this.timeStamp);
        output.writeLong(this.salt);
        this.argumentSignatures.write(output);
        this.lastSeenMessages.write(output);
    }
 
    @Override
    public PacketType<ServerboundChatCommandSignedPacket> type() {
        return GamePacketTypes.SERVERBOUND_CHAT_COMMAND_SIGNED;
    }
 
    public void handle(ServerGamePacketListener listener) {
        listener.handleSignedChatCommand(this);
    }
}

引用的其他类