ClientboundCustomReportDetailsPacket.java

net.minecraft.network.protocol.common.ClientboundCustomReportDetailsPacket

信息

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

    TODO

字段/常量

  • MAX_DETAIL_KEY_LENGTH

    • 类型: int
    • 修饰符: private static final
    • 源码定位: L12
    • 说明:

      TODO

  • MAX_DETAIL_VALUE_LENGTH

    • 类型: int
    • 修饰符: private static final
    • 源码定位: L13
    • 说明:

      TODO

  • MAX_DETAIL_COUNT

    • 类型: int
    • 修饰符: private static final
    • 源码定位: L14
    • 说明:

      TODO

  • DETAILS_STREAM_CODEC

    • 类型: StreamCodec<ByteBuf,Map<String,String>>
    • 修饰符: private static final
    • 源码定位: L15
    • 说明:

      TODO

  • STREAM_CODEC

    • 类型: StreamCodec<ByteBuf,ClientboundCustomReportDetailsPacket>
    • 修饰符: public static final
    • 源码定位: L18
    • 说明:

      TODO

内部类/嵌套类型

构造器

方法

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

public PacketType<ClientboundCustomReportDetailsPacket> type() @ L22

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

参数:

说明:

TODO

public void handle(ClientCommonPacketListener listener) @ L27

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

参数:

  • listener: ClientCommonPacketListener

说明:

TODO

代码

public record ClientboundCustomReportDetailsPacket(Map<String, String> details) implements Packet<ClientCommonPacketListener> {
    private static final int MAX_DETAIL_KEY_LENGTH = 128;
    private static final int MAX_DETAIL_VALUE_LENGTH = 4096;
    private static final int MAX_DETAIL_COUNT = 32;
    private static final StreamCodec<ByteBuf, Map<String, String>> DETAILS_STREAM_CODEC = ByteBufCodecs.map(
        HashMap::new, ByteBufCodecs.stringUtf8(128), ByteBufCodecs.stringUtf8(4096), 32
    );
    public static final StreamCodec<ByteBuf, ClientboundCustomReportDetailsPacket> STREAM_CODEC = StreamCodec.composite(
        DETAILS_STREAM_CODEC, ClientboundCustomReportDetailsPacket::details, ClientboundCustomReportDetailsPacket::new
    );
 
    @Override
    public PacketType<ClientboundCustomReportDetailsPacket> type() {
        return CommonPacketTypes.CLIENTBOUND_CUSTOM_REPORT_DETAILS;
    }
 
    public void handle(ClientCommonPacketListener listener) {
        listener.handleCustomReportDetails(this);
    }
}

引用的其他类