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
ConstructorsConstructorDescriptionParticlePacket(ParticleEffect particle, float offsetX, float offsetY, float offsetZ, float speed, int amount) Creates a newParticlePacketthat can be sent to one or multipleplayers.ParticlePacket(ParticleEffect particle, float offsetX, float offsetY, float offsetZ, float speed, int amount, ParticleData particleData) Creates a newParticlePacketthat 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 currentParticlePacketdata.intGets how many particles will be shown by the client.floatGets the offsetX value of the particle.floatGets the offsetY value of the particle.floatGets the offsetZ value of the particle.Gets theParticleEffectthat will be displayed by the client.Gets theParticleDatathat should be used when displaying the particle.floatgetSpeed()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 newParticlePacketthat can be sent to one or multipleplayers.- Parameters:
particle- theParticleEffectthat 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- theParticleDataof the particle- See Also:
-
particleoffsetXoffsetYoffsetZspeedamountparticleDataParticleData
-
ParticlePacket
public ParticlePacket(ParticleEffect particle, float offsetX, float offsetY, float offsetZ, float speed, int amount) Creates a newParticlePacketthat can be sent to one or multipleplayers.- Parameters:
particle- theParticleEffectthat 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:
-
particleoffsetXoffsetYoffsetZspeedamount
-
-
Method Details
-
getParticle
Gets theParticleEffectthat will be displayed by the client.- Returns:
- The
ParticleEffectwhich 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 theParticleDatathat should be used when displaying the particle.- Returns:
- the
ParticleDatathat will be used.
-
createPacket
Creates a NMS PacketPlayOutWorldParticles packet with the data in the currentParticlePacketdata.- Parameters:
location- theLocationthe particle should be displayed at.- Returns:
- a PacketPlayOutWorldParticles or
nullwhen something goes wrong.
-