ServerboundClientInformationPacket.java

net.minecraft.network.protocol.common.ServerboundClientInformationPacket

信息

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

    TODO

字段/常量

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

      TODO

内部类/嵌套类型

构造器

private ServerboundClientInformationPacket(FriendlyByteBuf input) @ L14

  • 构造器名:ServerboundClientInformationPacket
  • 源码定位:L14
  • 修饰符:private

参数:

  • input: FriendlyByteBuf

说明:

TODO

方法

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

private void write(FriendlyByteBuf output) @ L18

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

参数:

  • output: FriendlyByteBuf

说明:

TODO

public PacketType<ServerboundClientInformationPacket> type() @ L22

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

参数:

说明:

TODO

public void handle(ServerCommonPacketListener listener) @ L27

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

参数:

  • listener: ServerCommonPacketListener

说明:

TODO

代码

public record ServerboundClientInformationPacket(ClientInformation information) implements Packet<ServerCommonPacketListener> {
    public static final StreamCodec<FriendlyByteBuf, ServerboundClientInformationPacket> STREAM_CODEC = Packet.codec(
        ServerboundClientInformationPacket::write, ServerboundClientInformationPacket::new
    );
 
    private ServerboundClientInformationPacket(FriendlyByteBuf input) {
        this(new ClientInformation(input));
    }
 
    private void write(FriendlyByteBuf output) {
        this.information.write(output);
    }
 
    @Override
    public PacketType<ServerboundClientInformationPacket> type() {
        return CommonPacketTypes.SERVERBOUND_CLIENT_INFORMATION;
    }
 
    public void handle(ServerCommonPacketListener listener) {
        listener.handleClientInformation(this);
    }
}

引用的其他类