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
ConstructorsConstructorDescriptionParticlePacket(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 aParticlePacketrecord class.ParticlePacket(@NotNull NetworkBuffer reader) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]data()Returns the value of thedatarecord component.final booleanIndicates whether some other object is "equal to" this one.intgetId(@NotNull ConnectionState state) Gets the id of this packet.final inthashCode()Returns a hash code value for this object.booleanReturns the value of thelongDistancerecord component.floatoffsetX()Returns the value of theoffsetXrecord component.floatoffsetY()Returns the value of theoffsetYrecord component.floatoffsetZ()Returns the value of theoffsetZrecord component.intReturns the value of theparticleCountrecord component.floatReturns the value of theparticleDatarecord component.intReturns the value of theparticleIdrecord component.final StringtoString()Returns a string representation of this record class.voidwrite(@NotNull NetworkBuffer writer) doublex()Returns the value of thexrecord component.doubley()Returns the value of theyrecord component.doublez()Returns the value of thezrecord 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 aParticlePacketrecord class.- Parameters:
particleId- the value for theparticleIdrecord componentlongDistance- the value for thelongDistancerecord componentx- the value for thexrecord componenty- the value for theyrecord componentz- the value for thezrecord componentoffsetX- the value for theoffsetXrecord componentoffsetY- the value for theoffsetYrecord componentoffsetZ- the value for theoffsetZrecord componentparticleData- the value for theparticleDatarecord componentparticleCount- the value for theparticleCountrecord componentdata- the value for thedatarecord component
-
-
Method Details
-
write
- Specified by:
writein interfaceNetworkBuffer.Writer
-
getId
Description copied from interface:ServerPacketGets the id of this packet.Written in the final buffer header so it needs to match the client id.
- Specified by:
getIdin 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 theparticleIdrecord component.- Returns:
- the value of the
particleIdrecord component
-
longDistance
public boolean longDistance()Returns the value of thelongDistancerecord component.- Returns:
- the value of the
longDistancerecord component
-
x
public double x()Returns the value of thexrecord component.- Returns:
- the value of the
xrecord component
-
y
public double y()Returns the value of theyrecord component.- Returns:
- the value of the
yrecord component
-
z
public double z()Returns the value of thezrecord component.- Returns:
- the value of the
zrecord component
-
offsetX
public float offsetX()Returns the value of theoffsetXrecord component.- Returns:
- the value of the
offsetXrecord component
-
offsetY
public float offsetY()Returns the value of theoffsetYrecord component.- Returns:
- the value of the
offsetYrecord component
-
offsetZ
public float offsetZ()Returns the value of theoffsetZrecord component.- Returns:
- the value of the
offsetZrecord component
-
particleData
public float particleData()Returns the value of theparticleDatarecord component.- Returns:
- the value of the
particleDatarecord component
-
particleCount
public int particleCount()Returns the value of theparticleCountrecord component.- Returns:
- the value of the
particleCountrecord component
-
data
public byte[] data()Returns the value of thedatarecord component.- Returns:
- the value of the
datarecord component
-