ServerboundChatCommandPacket.java
net.minecraft.network.protocol.game.ServerboundChatCommandPacket
信息
- 全限定名:net.minecraft.network.protocol.game.ServerboundChatCommandPacket
- 类型:public record
- 包:net.minecraft.network.protocol.game
- 源码路径:src/main/java/net/minecraft/network/protocol/game/ServerboundChatCommandPacket.java
- 起始行号:L8
- 实现:Packet
- 职责:
TODO
字段/常量
STREAM_CODEC- 类型:
StreamCodec<FriendlyByteBuf,ServerboundChatCommandPacket> - 修饰符:
public static final - 源码定位:
L9 - 说明:
TODO
- 类型:
内部类/嵌套类型
- 无
构造器
private ServerboundChatCommandPacket(FriendlyByteBuf input) @ L13
- 构造器名:ServerboundChatCommandPacket
- 源码定位:L13
- 修饰符:private
参数:
- input: FriendlyByteBuf
说明:
TODO
方法
下面的方法块按源码顺序生成。
private void write(FriendlyByteBuf output) @ L17
- 方法名:write
- 源码定位:L17
- 返回类型:void
- 修饰符:private
参数:
- output: FriendlyByteBuf
说明:
TODO
public PacketType<ServerboundChatCommandPacket> type() @ L21
- 方法名:type
- 源码定位:L21
- 返回类型:PacketType
- 修饰符:public
参数:
- 无
说明:
TODO
public void handle(ServerGamePacketListener listener) @ L26
- 方法名:handle
- 源码定位:L26
- 返回类型:void
- 修饰符:public
参数:
- listener: ServerGamePacketListener
说明:
TODO
代码
public record ServerboundChatCommandPacket(String command) implements Packet<ServerGamePacketListener> {
public static final StreamCodec<FriendlyByteBuf, ServerboundChatCommandPacket> STREAM_CODEC = Packet.codec(
ServerboundChatCommandPacket::write, ServerboundChatCommandPacket::new
);
private ServerboundChatCommandPacket(FriendlyByteBuf input) {
this(input.readUtf());
}
private void write(FriendlyByteBuf output) {
output.writeUtf(this.command);
}
@Override
public PacketType<ServerboundChatCommandPacket> type() {
return GamePacketTypes.SERVERBOUND_CHAT_COMMAND;
}
public void handle(ServerGamePacketListener listener) {
listener.handleChatCommand(this);
}
}引用的其他类
-
- 引用位置:
参数/字段
- 引用位置:
-
- 引用位置:
字段
- 引用位置:
-
- 引用位置:
实现/方法调用 - 关联成员:
Packet.codec()
- 引用位置:
-
- 引用位置:
返回值
- 引用位置:
-
- 引用位置:
参数
- 引用位置: