Class ParticlePacket

java.lang.Object
xyz.xenondevs.particle.ParticlePacket

public final class ParticlePacket extends Object
Represents the nms "PacketPlayOutWorldParticles" packet.
Since:
10.06.2019
Author:
ByteZ
  • Constructor Details

    • ParticlePacket

      public ParticlePacket(ParticleEffect particle, float offsetX, float offsetY, float offsetZ, float speed, int amount, ParticleData particleData)
      Creates a new ParticlePacket that can be sent to one or multiple players.
      Parameters:
      particle - the ParticleEffect 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 - the ParticleData 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 new ParticlePacket that can be sent to one or multiple players.
      Parameters:
      particle - the ParticleEffect 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

      public ParticleEffect getParticle()
      Gets the ParticleEffect 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

      public ParticleData getParticleData()
      Gets the ParticleData that should be used when displaying the particle.
      Returns:
      the ParticleData that will be used.
    • createPacket

      public Object createPacket(org.bukkit.Location location)
      Creates a NMS PacketPlayOutWorldParticles packet with the data in the current ParticlePacket data.
      Parameters:
      location - the Location the particle should be displayed at.
      Returns:
      a PacketPlayOutWorldParticles or null when something goes wrong.