ClientboundTeleportEntityPacket.java

net.minecraft.network.protocol.game.ClientboundTeleportEntityPacket

信息

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

    TODO

字段/常量

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

      TODO

内部类/嵌套类型

构造器

方法

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

public static ClientboundTeleportEntityPacket teleport(int id, PositionMoveRotation values, Set<Relative> relatives, boolean onGround) @ L26

  • 方法名:teleport
  • 源码定位:L26
  • 返回类型:ClientboundTeleportEntityPacket
  • 修饰符:public static

参数:

  • id: int
  • values: PositionMoveRotation
  • relatives: Set
  • onGround: boolean

说明:

TODO

public PacketType<ClientboundTeleportEntityPacket> type() @ L30

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

参数:

说明:

TODO

public void handle(ClientGamePacketListener listener) @ L35

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

参数:

  • listener: ClientGamePacketListener

说明:

TODO

代码

public record ClientboundTeleportEntityPacket(int id, PositionMoveRotation change, Set<Relative> relatives, boolean onGround)
    implements Packet<ClientGamePacketListener> {
    public static final StreamCodec<FriendlyByteBuf, ClientboundTeleportEntityPacket> STREAM_CODEC = StreamCodec.composite(
        ByteBufCodecs.VAR_INT,
        ClientboundTeleportEntityPacket::id,
        PositionMoveRotation.STREAM_CODEC,
        ClientboundTeleportEntityPacket::change,
        Relative.SET_STREAM_CODEC,
        ClientboundTeleportEntityPacket::relatives,
        ByteBufCodecs.BOOL,
        ClientboundTeleportEntityPacket::onGround,
        ClientboundTeleportEntityPacket::new
    );
 
    public static ClientboundTeleportEntityPacket teleport(int id, PositionMoveRotation values, Set<Relative> relatives, boolean onGround) {
        return new ClientboundTeleportEntityPacket(id, values, relatives, onGround);
    }
 
    @Override
    public PacketType<ClientboundTeleportEntityPacket> type() {
        return GamePacketTypes.CLIENTBOUND_TELEPORT_ENTITY;
    }
 
    public void handle(ClientGamePacketListener listener) {
        listener.handleTeleportEntity(this);
    }
}

引用的其他类