Package xyz.xenondevs.particle.utils
Class ParticleUtils
java.lang.Object
xyz.xenondevs.particle.utils.ParticleUtils
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidsendBulk(Collection<Object> packets) Sends the givenCollectionof packets to every player that is currently on the server.static voidsendBulk(Collection<Object> packets, Collection<org.bukkit.entity.Player> players) Sends the givenCollectionof packets to the target players while caching the PlayerConnections instead of calling the ConnectionCache for each packet.static voidsendBulk(Collection<Object> packets, org.bukkit.entity.Player player) Sends the givenCollectionof packets to the target player while caching the PlayerConnection in a local variable instead of calling the ConnectionCache for each packet.static voidsendBulkBuilders(Collection<ParticleBuilder> builders) Converts the givenCollectionofParticleBuildersto packets and sends them to all players that are currently on the server.static voidsendBulkBuilders(Collection<ParticleBuilder> builders, Collection<org.bukkit.entity.Player> players) Converts the givenCollectionofParticleBuildersto packets and sends them to the target players.static voidsendBulkBuilders(Collection<ParticleBuilder> builders, org.bukkit.entity.Player player) Converts the givenCollectionofParticleBuildersto packets and sends them to the target player.
-
Constructor Details
-
ParticleUtils
public ParticleUtils()
-
-
Method Details
-
sendBulk
Sends the givenCollectionof 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 playerplayer- the targetPlayerthat should receive the packets
-
sendBulk
public static void sendBulk(Collection<Object> packets, Collection<org.bukkit.entity.Player> players) Sends the givenCollectionof 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 playersplayers- the targetPlayersthat should receive the packets
-
sendBulk
Sends the givenCollectionof 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 givenCollectionofParticleBuildersto 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- theParticleBuildersthat should be converted and sent to the playerplayer- the targetPlayerthat should receive the packets
-
sendBulkBuilders
public static void sendBulkBuilders(Collection<ParticleBuilder> builders, Collection<org.bukkit.entity.Player> players) Converts the givenCollectionofParticleBuildersto 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- theParticleBuildersthat should be converted and sent to the playersplayers- the targetPlayersthat should receive the packets
-
sendBulkBuilders
Converts the givenCollectionofParticleBuildersto 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- theParticleBuildersthat should be converted and sent to the players
-