ClientboundDisguisedChatPacket.java

net.minecraft.network.protocol.game.ClientboundDisguisedChatPacket

信息

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

    TODO

字段/常量

  • STREAM_CODEC
    • 类型: StreamCodec<RegistryFriendlyByteBuf,ClientboundDisguisedChatPacket>
    • 修饰符: public static final
    • 源码定位: L12
    • 说明:

      TODO

内部类/嵌套类型

构造器

方法

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

public PacketType<ClientboundDisguisedChatPacket> type() @ L20

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

参数:

说明:

TODO

public void handle(ClientGamePacketListener listener) @ L25

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

参数:

  • listener: ClientGamePacketListener

说明:

TODO

public boolean isSkippable() @ L29

  • 方法名:isSkippable
  • 源码定位:L29
  • 返回类型:boolean
  • 修饰符:public

参数:

说明:

TODO

代码

public record ClientboundDisguisedChatPacket(Component message, ChatType.Bound chatType) implements Packet<ClientGamePacketListener> {
    public static final StreamCodec<RegistryFriendlyByteBuf, ClientboundDisguisedChatPacket> STREAM_CODEC = StreamCodec.composite(
        ComponentSerialization.TRUSTED_STREAM_CODEC,
        ClientboundDisguisedChatPacket::message,
        ChatType.Bound.STREAM_CODEC,
        ClientboundDisguisedChatPacket::chatType,
        ClientboundDisguisedChatPacket::new
    );
 
    @Override
    public PacketType<ClientboundDisguisedChatPacket> type() {
        return GamePacketTypes.CLIENTBOUND_DISGUISED_CHAT;
    }
 
    public void handle(ClientGamePacketListener listener) {
        listener.handleDisguisedChat(this);
    }
 
    @Override
    public boolean isSkippable() {
        return true;
    }
}

引用的其他类