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, Optional<Vec3> playerKnockback, ParticleOptions explosionParticle, Holder<SoundEvent> explosionSound)
extends Record
implements Packet<ClientGamePacketListener>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate 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.static final StreamCodec<RegistryFriendlyByteBuf, ClientboundExplodePacket> -
Constructor Summary
ConstructorsConstructorDescriptionClientboundExplodePacket(Vec3 center, Optional<Vec3> playerKnockback, ParticleOptions explosionParticle, Holder<SoundEvent> explosionSound) Creates an instance of aClientboundExplodePacketrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncenter()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 pHandler) 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.final StringtoString()Returns a string representation of this record class.type()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.network.protocol.Packet
isSkippable, isTerminal
-
Field Details
-
center
The field for thecenterrecord component. -
playerKnockback
The field for theplayerKnockbackrecord component. -
explosionParticle
The field for theexplosionParticlerecord component. -
explosionSound
The field for theexplosionSoundrecord component. -
STREAM_CODEC
-
-
Constructor Details
-
ClientboundExplodePacket
public ClientboundExplodePacket(Vec3 center, Optional<Vec3> playerKnockback, ParticleOptions explosionParticle, Holder<SoundEvent> explosionSound) Creates an instance of aClientboundExplodePacketrecord class.- Parameters:
center- the value for thecenterrecord componentplayerKnockback- the value for theplayerKnockbackrecord componentexplosionParticle- the value for theexplosionParticlerecord componentexplosionSound- the value for theexplosionSoundrecord 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
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. All components in this record class are compared withObjects::equals(Object,Object). -
center
Returns the value of thecenterrecord component.- Returns:
- the value of the
centerrecord component
-
playerKnockback
Returns the value of theplayerKnockbackrecord component.- Returns:
- the value of the
playerKnockbackrecord component
-
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
-