Class ParticleUtils

java.lang.Object
xyz.xenondevs.particle.utils.ParticleUtils

public final class ParticleUtils extends Object
Useful utilities for handling large amounts of particles.

Note: While not recommended, these methods can also be used with non particle packets.

Author:
ByteZ
  • Constructor Details

    • ParticleUtils

      public ParticleUtils()
  • Method Details

    • sendBulk

      public static void sendBulk(Collection<Object> packets, org.bukkit.entity.Player player)
      Sends the given Collection of packets to the target player while caching the PlayerConnection in a local variable instead of calling the ConnectionCache for each packet.
      Parameters:
      packets - the packets that should be sent to the player
      player - the target Player that should receive the packets
    • sendBulk

      public static void sendBulk(Collection<Object> packets, Collection<org.bukkit.entity.Player> players)
      Sends the given Collection of packets to the target players while caching the PlayerConnections instead of calling the ConnectionCache for each packet.
      Parameters:
      packets - the packets that should be sent to the players
      players - the target Players that should receive the packets
    • sendBulk

      public static void sendBulk(Collection<Object> packets)
      Sends the given Collection of packets to every player that is currently on the server. Also caches the PlayerConnections instead of calling the ConnectionCache for each packet.
      Parameters:
      packets - the packets that should be sent
    • sendBulkBuilders

      public static void sendBulkBuilders(Collection<ParticleBuilder> builders, org.bukkit.entity.Player player)
      Converts the given Collection of ParticleBuilders to packets and sends them to the target player. Also caches the PlayerConnection in a local variable instead of calling the ConnectionCache for each packet.
      Parameters:
      builders - the ParticleBuilders that should be converted and sent to the player
      player - the target Player that should receive the packets
    • sendBulkBuilders

      public static void sendBulkBuilders(Collection<ParticleBuilder> builders, Collection<org.bukkit.entity.Player> players)
      Converts the given Collection of ParticleBuilders to packets and sends them to the target players. Also caches the PlayerConnections in a local variable instead of calling the ConnectionCache for each packet.
      Parameters:
      builders - the ParticleBuilders that should be converted and sent to the players
      players - the target Players that should receive the packets
    • sendBulkBuilders

      public static void sendBulkBuilders(Collection<ParticleBuilder> builders)
      Converts the given Collection of ParticleBuilders to packets and sends them to all players that are currently on the server. Also caches the PlayerConnections in a local variable instead of calling the ConnectionCache for each packet.
      Parameters:
      builders - the ParticleBuilders that should be converted and sent to the players