ClientboundExplodePacket.java
net.minecraft.network.protocol.game.ClientboundExplodePacket
信息
- 全限定名:net.minecraft.network.protocol.game.ClientboundExplodePacket
- 类型:public record
- 包:net.minecraft.network.protocol.game
- 源码路径:src/main/java/net/minecraft/network/protocol/game/ClientboundExplodePacket.java
- 起始行号:L17
- 实现:Packet
- 职责:
TODO
字段/常量
STREAM_CODEC- 类型:
StreamCodec<RegistryFriendlyByteBuf,ClientboundExplodePacket> - 修饰符:
public static final - 源码定位:
L26 - 说明:
TODO
- 类型:
内部类/嵌套类型
- 无
构造器
- 无
方法
下面的方法块按源码顺序生成。
public PacketType<ClientboundExplodePacket> type() @ L44
- 方法名:type
- 源码定位:L44
- 返回类型:PacketType
- 修饰符:public
参数:
- 无
说明:
TODO
public void handle(ClientGamePacketListener listener) @ L49
- 方法名:handle
- 源码定位:L49
- 返回类型:void
- 修饰符:public
参数:
- listener: ClientGamePacketListener
说明:
TODO
代码
public record ClientboundExplodePacket(
Vec3 center,
float radius,
int blockCount,
Optional<Vec3> playerKnockback,
ParticleOptions explosionParticle,
Holder<SoundEvent> explosionSound,
WeightedList<ExplosionParticleInfo> blockParticles
) implements Packet<ClientGamePacketListener> {
public static final StreamCodec<RegistryFriendlyByteBuf, ClientboundExplodePacket> STREAM_CODEC = StreamCodec.composite(
Vec3.STREAM_CODEC,
ClientboundExplodePacket::center,
ByteBufCodecs.FLOAT,
ClientboundExplodePacket::radius,
ByteBufCodecs.INT,
ClientboundExplodePacket::blockCount,
Vec3.STREAM_CODEC.apply(ByteBufCodecs::optional),
ClientboundExplodePacket::playerKnockback,
ParticleTypes.STREAM_CODEC,
ClientboundExplodePacket::explosionParticle,
SoundEvent.STREAM_CODEC,
ClientboundExplodePacket::explosionSound,
WeightedList.streamCodec(ExplosionParticleInfo.STREAM_CODEC),
ClientboundExplodePacket::blockParticles,
ClientboundExplodePacket::new
);
@Override
public PacketType<ClientboundExplodePacket> type() {
return GamePacketTypes.CLIENTBOUND_EXPLODE;
}
public void handle(ClientGamePacketListener listener) {
listener.handleExplosion(this);
}
}引用的其他类
-
- 引用位置:
字段
- 引用位置:
-
- 引用位置:
字段/方法调用 - 关联成员:
StreamCodec.composite()
- 引用位置:
-
- 引用位置:
实现
- 引用位置:
-
- 引用位置:
返回值
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
WeightedList.streamCodec()
- 引用位置: