Record Class ExplosionPacket
java.lang.Object
java.lang.Record
net.minestom.server.network.packet.server.play.ExplosionPacket
- All Implemented Interfaces:
SendablePacket
,ServerPacket
,Writeable
public record ExplosionPacket(float x, float y, float z, float radius, byte @NotNull [] records, float playerMotionX, float playerMotionY, float playerMotionZ)
extends Record
implements ServerPacket
-
Constructor Summary
ConstructorsConstructorDescriptionExplosionPacket
(float x, float y, float z, float radius, byte @NotNull [] records, float playerMotionX, float playerMotionY, float playerMotionZ) Creates an instance of aExplosionPacket
record class.ExplosionPacket
(BinaryReader reader) -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.int
getId()
Gets the id of this packet.final int
hashCode()
Returns a hash code value for this object.float
Returns the value of theplayerMotionX
record component.float
Returns the value of theplayerMotionY
record component.float
Returns the value of theplayerMotionZ
record component.float
radius()
Returns the value of theradius
record component.byte @NotNull []
records()
Returns the value of therecords
record component.final String
toString()
Returns a string representation of this record class.void
write
(@NotNull BinaryWriter writer) Writes into aBinaryWriter
.float
x()
Returns the value of thex
record component.float
y()
Returns the value of they
record component.float
z()
Returns the value of thez
record component.
-
Constructor Details
-
ExplosionPacket
-
ExplosionPacket
public ExplosionPacket(float x, float y, float z, float radius, byte @NotNull [] records, float playerMotionX, float playerMotionY, float playerMotionZ) Creates an instance of aExplosionPacket
record class.- Parameters:
x
- the value for thex
record componenty
- the value for they
record componentz
- the value for thez
record componentradius
- the value for theradius
record componentrecords
- the value for therecords
record componentplayerMotionX
- the value for theplayerMotionX
record componentplayerMotionY
- the value for theplayerMotionY
record componentplayerMotionZ
- the value for theplayerMotionZ
record component
-
-
Method Details
-
write
Description copied from interface:Writeable
Writes into aBinaryWriter
. -
getId
public int getId()Description copied from interface:ServerPacket
Gets the id of this packet.Written in the final buffer header so it needs to match the client id.
- Specified by:
getId
in interfaceServerPacket
- Returns:
- the id of this packet
-
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
x
public float x()Returns the value of thex
record component.- Returns:
- the value of the
x
record component
-
y
public float y()Returns the value of they
record component.- Returns:
- the value of the
y
record component
-
z
public float z()Returns the value of thez
record component.- Returns:
- the value of the
z
record component
-
radius
public float radius()Returns the value of theradius
record component.- Returns:
- the value of the
radius
record component
-
records
public byte @NotNull [] records()Returns the value of therecords
record component.- Returns:
- the value of the
records
record component
-
playerMotionX
public float playerMotionX()Returns the value of theplayerMotionX
record component.- Returns:
- the value of the
playerMotionX
record component
-
playerMotionY
public float playerMotionY()Returns the value of theplayerMotionY
record component.- Returns:
- the value of the
playerMotionY
record component
-
playerMotionZ
public float playerMotionZ()Returns the value of theplayerMotionZ
record component.- Returns:
- the value of the
playerMotionZ
record component
-