Record Class ExplosionPacket

java.lang.Object
java.lang.Record
net.minestom.server.network.packet.server.play.ExplosionPacket
All Implemented Interfaces:
NetworkBuffer.Writer, SendablePacket, ServerPacket, ServerPacket.Play

public record ExplosionPacket(double x, double y, double z, float radius, byte @NotNull [] records, float playerMotionX, float playerMotionY, float playerMotionZ, @NotNull ExplosionPacket.BlockInteraction blockInteraction, int smallParticleId, byte @NotNull [] smallParticleData, int largeParticleId, byte @NotNull [] largeParticleData, @NotNull SoundEvent sound) extends Record implements ServerPacket.Play
  • Field Details

    • DEFAULT_SOUND

      public static final SoundEvent DEFAULT_SOUND
  • Constructor Details

    • ExplosionPacket

      public ExplosionPacket(@NotNull @NotNull NetworkBuffer reader)
    • ExplosionPacket

      public ExplosionPacket(double x, double y, double z, float radius, byte @NotNull [] records, float playerMotionX, float playerMotionY, float playerMotionZ)
    • ExplosionPacket

      public ExplosionPacket(double x, double y, double z, float radius, byte @NotNull [] records, float playerMotionX, float playerMotionY, float playerMotionZ, @NotNull @NotNull ExplosionPacket.BlockInteraction blockInteraction, int smallParticleId, byte @NotNull [] smallParticleData, int largeParticleId, byte @NotNull [] largeParticleData, @NotNull @NotNull SoundEvent sound)
      Creates an instance of a ExplosionPacket record class.
      Parameters:
      x - the value for the x record component
      y - the value for the y record component
      z - the value for the z record component
      radius - the value for the radius record component
      records - the value for the records record component
      playerMotionX - the value for the playerMotionX record component
      playerMotionY - the value for the playerMotionY record component
      playerMotionZ - the value for the playerMotionZ record component
      blockInteraction - the value for the blockInteraction record component
      smallParticleId - the value for the smallParticleId record component
      smallParticleData - the value for the smallParticleData record component
      largeParticleId - the value for the largeParticleId record component
      largeParticleData - the value for the largeParticleData record component
      sound - the value for the sound record component
  • Method Details

    • write

      public void write(@NotNull @NotNull NetworkBuffer writer)
      Specified by:
      write in interface NetworkBuffer.Writer
    • playId

      public int playId()
      Specified by:
      playId in interface ServerPacket.Play
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • x

      public double x()
      Returns the value of the x record component.
      Returns:
      the value of the x record component
    • y

      public double y()
      Returns the value of the y record component.
      Returns:
      the value of the y record component
    • z

      public double z()
      Returns the value of the z record component.
      Returns:
      the value of the z record component
    • radius

      public float radius()
      Returns the value of the radius record component.
      Returns:
      the value of the radius record component
    • records

      public byte @NotNull [] records()
      Returns the value of the records record component.
      Returns:
      the value of the records record component
    • playerMotionX

      public float playerMotionX()
      Returns the value of the playerMotionX record component.
      Returns:
      the value of the playerMotionX record component
    • playerMotionY

      public float playerMotionY()
      Returns the value of the playerMotionY record component.
      Returns:
      the value of the playerMotionY record component
    • playerMotionZ

      public float playerMotionZ()
      Returns the value of the playerMotionZ record component.
      Returns:
      the value of the playerMotionZ record component
    • blockInteraction

      @NotNull public @NotNull ExplosionPacket.BlockInteraction blockInteraction()
      Returns the value of the blockInteraction record component.
      Returns:
      the value of the blockInteraction record component
    • smallParticleId

      public int smallParticleId()
      Returns the value of the smallParticleId record component.
      Returns:
      the value of the smallParticleId record component
    • smallParticleData

      public byte @NotNull [] smallParticleData()
      Returns the value of the smallParticleData record component.
      Returns:
      the value of the smallParticleData record component
    • largeParticleId

      public int largeParticleId()
      Returns the value of the largeParticleId record component.
      Returns:
      the value of the largeParticleId record component
    • largeParticleData

      public byte @NotNull [] largeParticleData()
      Returns the value of the largeParticleData record component.
      Returns:
      the value of the largeParticleData record component
    • sound

      @NotNull public @NotNull SoundEvent sound()
      Returns the value of the sound record component.
      Returns:
      the value of the sound record component