ServerboundPongPacket.java
net.minecraft.network.protocol.common.ServerboundPongPacket
信息
- 全限定名:net.minecraft.network.protocol.common.ServerboundPongPacket
- 类型:public class
- 包:net.minecraft.network.protocol.common
- 源码路径:src/main/java/net/minecraft/network/protocol/common/ServerboundPongPacket.java
- 起始行号:L8
- 实现:Packet
- 职责:
TODO
字段/常量
-
STREAM_CODEC- 类型:
StreamCodec<FriendlyByteBuf,ServerboundPongPacket> - 修饰符:
public static final - 源码定位:
L9 - 说明:
TODO
- 类型:
-
id- 类型:
int - 修饰符:
private final - 源码定位:
L12 - 说明:
TODO
- 类型:
内部类/嵌套类型
- 无
构造器
public ServerboundPongPacket(int id) @ L14
- 构造器名:ServerboundPongPacket
- 源码定位:L14
- 修饰符:public
参数:
- id: int
说明:
TODO
private ServerboundPongPacket(FriendlyByteBuf input) @ L18
- 构造器名:ServerboundPongPacket
- 源码定位:L18
- 修饰符:private
参数:
- input: FriendlyByteBuf
说明:
TODO
方法
下面的方法块按源码顺序生成。
private void write(FriendlyByteBuf output) @ L22
- 方法名:write
- 源码定位:L22
- 返回类型:void
- 修饰符:private
参数:
- output: FriendlyByteBuf
说明:
TODO
public PacketType<ServerboundPongPacket> type() @ L26
- 方法名:type
- 源码定位:L26
- 返回类型:PacketType
- 修饰符:public
参数:
- 无
说明:
TODO
public void handle(ServerCommonPacketListener listener) @ L31
- 方法名:handle
- 源码定位:L31
- 返回类型:void
- 修饰符:public
参数:
- listener: ServerCommonPacketListener
说明:
TODO
public int getId() @ L35
- 方法名:getId
- 源码定位:L35
- 返回类型:int
- 修饰符:public
参数:
- 无
说明:
TODO
代码
public class ServerboundPongPacket implements Packet<ServerCommonPacketListener> {
public static final StreamCodec<FriendlyByteBuf, ServerboundPongPacket> STREAM_CODEC = Packet.codec(
ServerboundPongPacket::write, ServerboundPongPacket::new
);
private final int id;
public ServerboundPongPacket(int id) {
this.id = id;
}
private ServerboundPongPacket(FriendlyByteBuf input) {
this.id = input.readInt();
}
private void write(FriendlyByteBuf output) {
output.writeInt(this.id);
}
@Override
public PacketType<ServerboundPongPacket> type() {
return CommonPacketTypes.SERVERBOUND_PONG;
}
public void handle(ServerCommonPacketListener listener) {
listener.handlePong(this);
}
public int getId() {
return this.id;
}
}引用的其他类
-
- 引用位置:
参数/字段
- 引用位置:
-
- 引用位置:
字段
- 引用位置:
-
- 引用位置:
实现/方法调用 - 关联成员:
Packet.codec()
- 引用位置:
-
- 引用位置:
返回值
- 引用位置:
-
- 引用位置:
参数
- 引用位置: