Package xyz.xenondevs.particle
Class ParticlePacket
java.lang.Object
xyz.xenondevs.particle.ParticlePacket
Represents the nms "PacketPlayOutWorldParticles" packet.
- Since:
- 10.06.2019
- Author:
- ByteZ
-
Constructor Summary
ConstructorDescriptionParticlePacket
(ParticleEffect particle, float offsetX, float offsetY, float offsetZ, float speed, int amount) Creates a newParticlePacket
that can be sent to one or multipleplayers
.ParticlePacket
(ParticleEffect particle, float offsetX, float offsetY, float offsetZ, float speed, int amount, ParticleData particleData) Creates a newParticlePacket
that can be sent to one or multipleplayers
. -
Method Summary
Modifier and TypeMethodDescriptioncreatePacket
(org.bukkit.Location location) Creates a NMS PacketPlayOutWorldParticles packet with the data in the currentParticlePacket
data.int
Gets how many particles will be shown by the client.float
Gets the offsetX value of the particle.float
Gets the offsetY value of the particle.float
Gets the offsetZ value of the particle.Gets theParticleEffect
that will be displayed by the client.Gets theParticleData
that should be used when displaying the particle.float
getSpeed()
Gets the speed at which the particle will fly off.
-
Constructor Details
-
ParticlePacket
public ParticlePacket(ParticleEffect particle, float offsetX, float offsetY, float offsetZ, float speed, int amount, ParticleData particleData) Creates a newParticlePacket
that can be sent to one or multipleplayers
.- Parameters:
particle
- theParticleEffect
that should be sent.offsetX
- the offsetX or extra data the particle should have.offsetY
- the offsetY or extra data the particle should have.offsetZ
- the offsetZ or extra data the particle should have.speed
- the multiplier of the velocity.amount
- the amount of particles that should be spawned.particleData
- theParticleData
of the particle- See Also:
-
particle
offsetX
offsetY
offsetZ
speed
amount
particleData
ParticleData
-
ParticlePacket
public ParticlePacket(ParticleEffect particle, float offsetX, float offsetY, float offsetZ, float speed, int amount) Creates a newParticlePacket
that can be sent to one or multipleplayers
.- Parameters:
particle
- theParticleEffect
that should be sent.offsetX
- the offsetX or extra data the particle should have.offsetY
- the offsetY or extra data the particle should have.offsetZ
- the offsetZ or extra data the particle should have.speed
- the multiplier of the velocity.amount
- the amount of particles that should be spawned.- See Also:
-
particle
offsetX
offsetY
offsetZ
speed
amount
-
-
Method Details
-
getParticle
Gets theParticleEffect
that will be displayed by the client.- Returns:
- The
ParticleEffect
which should be displayed by the client.
-
getOffsetX
public float getOffsetX()Gets the offsetX value of the particle.- Returns:
- the offsetX value.
-
getOffsetY
public float getOffsetY()Gets the offsetY value of the particle.- Returns:
- the offsetY value.
-
getOffsetZ
public float getOffsetZ()Gets the offsetZ value of the particle.- Returns:
- the offsetZ value.
-
getSpeed
public float getSpeed()Gets the speed at which the particle will fly off.- Returns:
- the speed of the particle.
-
getAmount
public int getAmount()Gets how many particles will be shown by the client.- Returns:
- the amount of particles to be spawned.
-
getParticleData
Gets theParticleData
that should be used when displaying the particle.- Returns:
- the
ParticleData
that will be used.
-
createPacket
Creates a NMS PacketPlayOutWorldParticles packet with the data in the currentParticlePacket
data.- Parameters:
location
- theLocation
the particle should be displayed at.- Returns:
- a PacketPlayOutWorldParticles or
null
when something goes wrong.
-