Record Class ParticlePacket
java.lang.Object
java.lang.Record
net.minestom.server.network.packet.server.play.ParticlePacket
- All Implemented Interfaces:
NetworkBuffer.Writer
,SendablePacket
,ServerPacket
public record ParticlePacket(int particleId, boolean longDistance, double x, double y, double z, float offsetX, float offsetY, float offsetZ, float particleData, int particleCount, byte[] data)
extends Record
implements ServerPacket
-
Constructor Summary
ConstructorDescriptionParticlePacket
(int particleId, boolean longDistance, double x, double y, double z, float offsetX, float offsetY, float offsetZ, float particleData, int particleCount, byte[] data) Creates an instance of aParticlePacket
record class.ParticlePacket
(@NotNull NetworkBuffer reader) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
data()
Returns the value of thedata
record component.final 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.boolean
Returns the value of thelongDistance
record component.float
offsetX()
Returns the value of theoffsetX
record component.float
offsetY()
Returns the value of theoffsetY
record component.float
offsetZ()
Returns the value of theoffsetZ
record component.int
Returns the value of theparticleCount
record component.float
Returns the value of theparticleData
record component.int
Returns the value of theparticleId
record component.final String
toString()
Returns a string representation of this record class.void
write
(@NotNull NetworkBuffer writer) double
x()
Returns the value of thex
record component.double
y()
Returns the value of they
record component.double
z()
Returns the value of thez
record component.
-
Constructor Details
-
ParticlePacket
-
ParticlePacket
public ParticlePacket(int particleId, boolean longDistance, double x, double y, double z, float offsetX, float offsetY, float offsetZ, float particleData, int particleCount, byte[] data) Creates an instance of aParticlePacket
record class.- Parameters:
particleId
- the value for theparticleId
record componentlongDistance
- the value for thelongDistance
record componentx
- the value for thex
record componenty
- the value for they
record componentz
- the value for thez
record componentoffsetX
- the value for theoffsetX
record componentoffsetY
- the value for theoffsetY
record componentoffsetZ
- the value for theoffsetZ
record componentparticleData
- the value for theparticleData
record componentparticleCount
- the value for theparticleCount
record componentdata
- the value for thedata
record component
-
-
Method Details
-
write
- Specified by:
write
in interfaceNetworkBuffer.Writer
-
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 '=='. -
particleId
public int particleId()Returns the value of theparticleId
record component.- Returns:
- the value of the
particleId
record component
-
longDistance
public boolean longDistance()Returns the value of thelongDistance
record component.- Returns:
- the value of the
longDistance
record component
-
x
public double x()Returns the value of thex
record component.- Returns:
- the value of the
x
record component
-
y
public double y()Returns the value of they
record component.- Returns:
- the value of the
y
record component
-
z
public double z()Returns the value of thez
record component.- Returns:
- the value of the
z
record component
-
offsetX
public float offsetX()Returns the value of theoffsetX
record component.- Returns:
- the value of the
offsetX
record component
-
offsetY
public float offsetY()Returns the value of theoffsetY
record component.- Returns:
- the value of the
offsetY
record component
-
offsetZ
public float offsetZ()Returns the value of theoffsetZ
record component.- Returns:
- the value of the
offsetZ
record component
-
particleData
public float particleData()Returns the value of theparticleData
record component.- Returns:
- the value of the
particleData
record component
-
particleCount
public int particleCount()Returns the value of theparticleCount
record component.- Returns:
- the value of the
particleCount
record component
-
data
public byte[] data()Returns the value of thedata
record component.- Returns:
- the value of the
data
record component
-