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
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
sendBulk
(Collection<Object> packets) Sends the givenCollection
of packets to every player that is currently on the server.static void
sendBulk
(Collection<Object> packets, Collection<org.bukkit.entity.Player> players) Sends the givenCollection
of packets to the target players while caching the PlayerConnections instead of calling the ConnectionCache for each packet.static void
sendBulk
(Collection<Object> packets, org.bukkit.entity.Player player) Sends the givenCollection
of packets to the target player while caching the PlayerConnection in a local variable instead of calling the ConnectionCache for each packet.static void
sendBulkBuilders
(Collection<ParticleBuilder> builders) Converts the givenCollection
ofParticleBuilders
to packets and sends them to all players that are currently on the server.static void
sendBulkBuilders
(Collection<ParticleBuilder> builders, Collection<org.bukkit.entity.Player> players) Converts the givenCollection
ofParticleBuilders
to packets and sends them to the target players.static void
sendBulkBuilders
(Collection<ParticleBuilder> builders, org.bukkit.entity.Player player) Converts the givenCollection
ofParticleBuilders
to packets and sends them to the target player.
-
Constructor Details
-
ParticleUtils
public ParticleUtils()
-
-
Method Details
-
sendBulk
Sends the givenCollection
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 playerplayer
- the targetPlayer
that should receive the packets
-
sendBulk
public static void sendBulk(Collection<Object> packets, Collection<org.bukkit.entity.Player> players) Sends the givenCollection
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 playersplayers
- the targetPlayers
that should receive the packets
-
sendBulk
Sends the givenCollection
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 givenCollection
ofParticleBuilders
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
- theParticleBuilders
that should be converted and sent to the playerplayer
- the targetPlayer
that should receive the packets
-
sendBulkBuilders
public static void sendBulkBuilders(Collection<ParticleBuilder> builders, Collection<org.bukkit.entity.Player> players) Converts the givenCollection
ofParticleBuilders
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
- theParticleBuilders
that should be converted and sent to the playersplayers
- the targetPlayers
that should receive the packets
-
sendBulkBuilders
Converts the givenCollection
ofParticleBuilders
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
- theParticleBuilders
that should be converted and sent to the players
-