ServerboundUseItemPacket.java
net.minecraft.network.protocol.game.ServerboundUseItemPacket
信息
- 全限定名:net.minecraft.network.protocol.game.ServerboundUseItemPacket
- 类型:public class
- 包:net.minecraft.network.protocol.game
- 源码路径:src/main/java/net/minecraft/network/protocol/game/ServerboundUseItemPacket.java
- 起始行号:L9
- 实现:Packet
- 职责:
TODO
字段/常量
-
STREAM_CODEC- 类型:
StreamCodec<FriendlyByteBuf,ServerboundUseItemPacket> - 修饰符:
public static final - 源码定位:
L10 - 说明:
TODO
- 类型:
-
hand- 类型:
InteractionHand - 修饰符:
private final - 源码定位:
L13 - 说明:
TODO
- 类型:
-
sequence- 类型:
int - 修饰符:
private final - 源码定位:
L14 - 说明:
TODO
- 类型:
-
yRot- 类型:
float - 修饰符:
private final - 源码定位:
L15 - 说明:
TODO
- 类型:
-
xRot- 类型:
float - 修饰符:
private final - 源码定位:
L16 - 说明:
TODO
- 类型:
内部类/嵌套类型
- 无
构造器
public ServerboundUseItemPacket(InteractionHand hand, int sequence, float yRot, float xRot) @ L18
- 构造器名:ServerboundUseItemPacket
- 源码定位:L18
- 修饰符:public
参数:
- hand: InteractionHand
- sequence: int
- yRot: float
- xRot: float
说明:
TODO
private ServerboundUseItemPacket(FriendlyByteBuf input) @ L25
- 构造器名:ServerboundUseItemPacket
- 源码定位:L25
- 修饰符:private
参数:
- input: FriendlyByteBuf
说明:
TODO
方法
下面的方法块按源码顺序生成。
private void write(FriendlyByteBuf output) @ L32
- 方法名:write
- 源码定位:L32
- 返回类型:void
- 修饰符:private
参数:
- output: FriendlyByteBuf
说明:
TODO
public PacketType<ServerboundUseItemPacket> type() @ L39
- 方法名:type
- 源码定位:L39
- 返回类型:PacketType
- 修饰符:public
参数:
- 无
说明:
TODO
public void handle(ServerGamePacketListener listener) @ L44
- 方法名:handle
- 源码定位:L44
- 返回类型:void
- 修饰符:public
参数:
- listener: ServerGamePacketListener
说明:
TODO
public InteractionHand getHand() @ L48
- 方法名:getHand
- 源码定位:L48
- 返回类型:InteractionHand
- 修饰符:public
参数:
- 无
说明:
TODO
public int getSequence() @ L52
- 方法名:getSequence
- 源码定位:L52
- 返回类型:int
- 修饰符:public
参数:
- 无
说明:
TODO
public float getYRot() @ L56
- 方法名:getYRot
- 源码定位:L56
- 返回类型:float
- 修饰符:public
参数:
- 无
说明:
TODO
public float getXRot() @ L60
- 方法名:getXRot
- 源码定位:L60
- 返回类型:float
- 修饰符:public
参数:
- 无
说明:
TODO
代码
public class ServerboundUseItemPacket implements Packet<ServerGamePacketListener> {
public static final StreamCodec<FriendlyByteBuf, ServerboundUseItemPacket> STREAM_CODEC = Packet.codec(
ServerboundUseItemPacket::write, ServerboundUseItemPacket::new
);
private final InteractionHand hand;
private final int sequence;
private final float yRot;
private final float xRot;
public ServerboundUseItemPacket(InteractionHand hand, int sequence, float yRot, float xRot) {
this.hand = hand;
this.sequence = sequence;
this.yRot = yRot;
this.xRot = xRot;
}
private ServerboundUseItemPacket(FriendlyByteBuf input) {
this.hand = input.readEnum(InteractionHand.class);
this.sequence = input.readVarInt();
this.yRot = input.readFloat();
this.xRot = input.readFloat();
}
private void write(FriendlyByteBuf output) {
output.writeEnum(this.hand);
output.writeVarInt(this.sequence);
output.writeFloat(this.yRot);
output.writeFloat(this.xRot);
}
@Override
public PacketType<ServerboundUseItemPacket> type() {
return GamePacketTypes.SERVERBOUND_USE_ITEM;
}
public void handle(ServerGamePacketListener listener) {
listener.handleUseItem(this);
}
public InteractionHand getHand() {
return this.hand;
}
public int getSequence() {
return this.sequence;
}
public float getYRot() {
return this.yRot;
}
public float getXRot() {
return this.xRot;
}
}引用的其他类
-
- 引用位置:
参数/字段
- 引用位置:
-
- 引用位置:
字段
- 引用位置:
-
- 引用位置:
实现/方法调用 - 关联成员:
Packet.codec()
- 引用位置:
-
- 引用位置:
返回值
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
参数/字段/返回值
- 引用位置: