Class ReflectiveParticleSpawner.ParticlePacket

java.lang.Object
dev.esophose.playerparticles.particles.spawning.ReflectiveParticleSpawner.ParticlePacket
Enclosing class:
ReflectiveParticleSpawner

public static final class ReflectiveParticleSpawner.ParticlePacket
extends java.lang.Object
Represents a particle effect packet with all attributes which is used for sending packets to the players

This class is part of the ParticleEffect Library and follows the same usage conditions

Since:
1.5
  • Constructor Summary

    Constructors 
    Constructor Description
    ParticlePacket​(ParticleEffect effect, double offsetX, double offsetY, double offsetZ, double speed, int amount, boolean longDistance, org.bukkit.Material data)
    Construct a new particle packet
    ParticlePacket​(ParticleEffect effect, ParticleColor color, boolean longDistance)
    Construct a new particle packet of a single colored particle
  • Method Summary

    Modifier and Type Method Description
    void sendTo​(org.bukkit.Location center, double range)
    Sends the packet to all players in a certain range
    void sendTo​(org.bukkit.Location center, java.util.List<org.bukkit.entity.Player> players)
    Sends the packet to all players in the list
    void sendTo​(org.bukkit.Location center, org.bukkit.entity.Player player)
    Sends the packet to a single player and caches it

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ParticlePacket

      public ParticlePacket​(ParticleEffect effect, double offsetX, double offsetY, double offsetZ, double speed, int amount, boolean longDistance, org.bukkit.Material data) throws java.lang.IllegalArgumentException
      Construct a new particle packet
      Parameters:
      effect - Particle effect
      offsetX - Maximum distance particles can fly away from the center on the x-axis
      offsetY - Maximum distance particles can fly away from the center on the y-axis
      offsetZ - Maximum distance particles can fly away from the center on the z-axis
      speed - Display speed of the particles
      amount - Amount of particles
      longDistance - Indicates whether the maximum distance is increased from 256 to 65536
      data - Data of the effect
      Throws:
      java.lang.IllegalArgumentException - If the speed or amount is lower than 0
    • ParticlePacket

      public ParticlePacket​(ParticleEffect effect, ParticleColor color, boolean longDistance)
      Construct a new particle packet of a single colored particle
      Parameters:
      effect - Particle effect
      color - Color of the particle
      longDistance - Indicates whether the maximum distance is increased from 256 to 65536
  • Method Details

    • sendTo

      public void sendTo​(org.bukkit.Location center, org.bukkit.entity.Player player) throws dev.esophose.playerparticles.particles.spawning.ReflectiveParticleSpawner.ParticlePacket.PacketInstantiationException, dev.esophose.playerparticles.particles.spawning.ReflectiveParticleSpawner.ParticlePacket.PacketSendingException
      Sends the packet to a single player and caches it
      Parameters:
      center - Center location of the effect
      player - Receiver of the packet
      Throws:
      dev.esophose.playerparticles.particles.spawning.ReflectiveParticleSpawner.ParticlePacket.PacketInstantiationException - If instantion fails due to an unknown error
      dev.esophose.playerparticles.particles.spawning.ReflectiveParticleSpawner.ParticlePacket.PacketSendingException - If sending fails due to an unknown error
      See Also:
      initializePacket(Location)
    • sendTo

      public void sendTo​(org.bukkit.Location center, java.util.List<org.bukkit.entity.Player> players) throws java.lang.IllegalArgumentException
      Sends the packet to all players in the list
      Parameters:
      center - Center location of the effect
      players - Receivers of the packet
      Throws:
      java.lang.IllegalArgumentException - If the player list is empty
      See Also:
      sendTo(Location center, Player player)
    • sendTo

      public void sendTo​(org.bukkit.Location center, double range) throws java.lang.IllegalArgumentException
      Sends the packet to all players in a certain range
      Parameters:
      center - Center location of the effect
      range - Range in which players will receive the packet (Maximum range for particles is usually 16, but it can differ for some types)
      Throws:
      java.lang.IllegalArgumentException - If the range is lower than 1
      See Also:
      sendTo(Location center, Player player)