ServerboundTeleportToEntityPacket.java
net.minecraft.network.protocol.game.ServerboundTeleportToEntityPacket
信息
- 全限定名:net.minecraft.network.protocol.game.ServerboundTeleportToEntityPacket
- 类型:public class
- 包:net.minecraft.network.protocol.game
- 源码路径:src/main/java/net/minecraft/network/protocol/game/ServerboundTeleportToEntityPacket.java
- 起始行号:L12
- 实现:Packet
- 职责:
TODO
字段/常量
-
STREAM_CODEC- 类型:
StreamCodec<FriendlyByteBuf,ServerboundTeleportToEntityPacket> - 修饰符:
public static final - 源码定位:
L13 - 说明:
TODO
- 类型:
-
uuid- 类型:
UUID - 修饰符:
private final - 源码定位:
L16 - 说明:
TODO
- 类型:
内部类/嵌套类型
- 无
构造器
public ServerboundTeleportToEntityPacket(UUID uuid) @ L18
- 构造器名:ServerboundTeleportToEntityPacket
- 源码定位:L18
- 修饰符:public
参数:
- uuid: UUID
说明:
TODO
private ServerboundTeleportToEntityPacket(FriendlyByteBuf input) @ L22
- 构造器名:ServerboundTeleportToEntityPacket
- 源码定位:L22
- 修饰符:private
参数:
- input: FriendlyByteBuf
说明:
TODO
方法
下面的方法块按源码顺序生成。
private void write(FriendlyByteBuf output) @ L26
- 方法名:write
- 源码定位:L26
- 返回类型:void
- 修饰符:private
参数:
- output: FriendlyByteBuf
说明:
TODO
public PacketType<ServerboundTeleportToEntityPacket> type() @ L30
- 方法名:type
- 源码定位:L30
- 返回类型:PacketType
- 修饰符:public
参数:
- 无
说明:
TODO
public void handle(ServerGamePacketListener listener) @ L35
- 方法名:handle
- 源码定位:L35
- 返回类型:void
- 修饰符:public
参数:
- listener: ServerGamePacketListener
说明:
TODO
public Entity getEntity(ServerLevel level) @ L39
- 方法名:getEntity
- 源码定位:L39
- 返回类型:Entity
- 修饰符:public
参数:
- level: ServerLevel
说明:
TODO
代码
public class ServerboundTeleportToEntityPacket implements Packet<ServerGamePacketListener> {
public static final StreamCodec<FriendlyByteBuf, ServerboundTeleportToEntityPacket> STREAM_CODEC = Packet.codec(
ServerboundTeleportToEntityPacket::write, ServerboundTeleportToEntityPacket::new
);
private final UUID uuid;
public ServerboundTeleportToEntityPacket(UUID uuid) {
this.uuid = uuid;
}
private ServerboundTeleportToEntityPacket(FriendlyByteBuf input) {
this.uuid = input.readUUID();
}
private void write(FriendlyByteBuf output) {
output.writeUUID(this.uuid);
}
@Override
public PacketType<ServerboundTeleportToEntityPacket> type() {
return GamePacketTypes.SERVERBOUND_TELEPORT_TO_ENTITY;
}
public void handle(ServerGamePacketListener listener) {
listener.handleTeleportToEntityPacket(this);
}
public @Nullable Entity getEntity(ServerLevel level) {
return level.getEntity(this.uuid);
}
}引用的其他类
-
- 引用位置:
参数/字段
- 引用位置:
-
- 引用位置:
字段
- 引用位置:
-
- 引用位置:
实现/方法调用 - 关联成员:
Packet.codec()
- 引用位置:
-
- 引用位置:
返回值
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
返回值
- 引用位置: