Record Class ClientboundExplodePacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.game.ClientboundExplodePacket
- All Implemented Interfaces:
Packet<ClientGamePacketListener>
public record ClientboundExplodePacket(Vec3 center, float radius, int blockCount, Optional<Vec3> playerKnockback, ParticleOptions explosionParticle, Holder<SoundEvent> explosionSound, WeightedList<ExplosionParticleInfo> blockParticles)
extends Record
implements Packet<ClientGamePacketListener>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe field for theblockCountrecord component.private final WeightedList<ExplosionParticleInfo> The field for theblockParticlesrecord component.private final Vec3The field for thecenterrecord component.private final ParticleOptionsThe field for theexplosionParticlerecord component.private final Holder<SoundEvent> The field for theexplosionSoundrecord component.The field for theplayerKnockbackrecord component.private final floatThe field for theradiusrecord component.static final StreamCodec<RegistryFriendlyByteBuf, ClientboundExplodePacket> -
Constructor Summary
ConstructorsConstructorDescriptionClientboundExplodePacket(Vec3 center, float radius, int blockCount, Optional<Vec3> playerKnockback, ParticleOptions explosionParticle, Holder<SoundEvent> explosionSound, WeightedList<ExplosionParticleInfo> blockParticles) Creates an instance of aClientboundExplodePacketrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theblockCountrecord component.Returns the value of theblockParticlesrecord component.center()Returns the value of thecenterrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexplosionParticlerecord component.Returns the value of theexplosionSoundrecord component.voidhandle(ClientGamePacketListener listener) Passes this Packet on to the NetHandler for processing.final inthashCode()Returns a hash code value for this object.Returns the value of theplayerKnockbackrecord component.floatradius()Returns the value of theradiusrecord component.final StringtoString()Returns a string representation of this record class.type()Methods inherited from interface Packet
isSkippable, isTerminal
-
Field Details
-
center
The field for thecenterrecord component. -
radius
private final float radiusThe field for theradiusrecord component. -
blockCount
private final int blockCountThe field for theblockCountrecord component. -
playerKnockback
-
explosionParticle
The field for theexplosionParticlerecord component. -
explosionSound
The field for theexplosionSoundrecord component. -
blockParticles
The field for theblockParticlesrecord component. -
STREAM_CODEC
-
-
Constructor Details
-
ClientboundExplodePacket
public ClientboundExplodePacket(Vec3 center, float radius, int blockCount, Optional<Vec3> playerKnockback, ParticleOptions explosionParticle, Holder<SoundEvent> explosionSound, WeightedList<ExplosionParticleInfo> blockParticles) Creates an instance of aClientboundExplodePacketrecord class.- Parameters:
center- the value for thecenterrecord componentradius- the value for theradiusrecord componentblockCount- the value for theblockCountrecord componentplayerKnockback- the value for theplayerKnockbackrecord componentexplosionParticle- the value for theexplosionParticlerecord componentexplosionSound- the value for theexplosionSoundrecord componentblockParticles- the value for theblockParticlesrecord component
-
-
Method Details
-
type
- Specified by:
typein interfacePacket<ClientGamePacketListener>
-
handle
Passes this Packet on to the NetHandler for processing.- Specified by:
handlein interfacePacket<ClientGamePacketListener>
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
center
Returns the value of thecenterrecord component.- Returns:
- the value of the
centerrecord component
-
radius
public float radius()Returns the value of theradiusrecord component.- Returns:
- the value of the
radiusrecord component
-
blockCount
public int blockCount()Returns the value of theblockCountrecord component.- Returns:
- the value of the
blockCountrecord component
-
playerKnockback
-
explosionParticle
Returns the value of theexplosionParticlerecord component.- Returns:
- the value of the
explosionParticlerecord component
-
explosionSound
Returns the value of theexplosionSoundrecord component.- Returns:
- the value of the
explosionSoundrecord component
-
blockParticles
Returns the value of theblockParticlesrecord component.- Returns:
- the value of the
blockParticlesrecord component
-