PacketTask

class PacketTask(packets: List<Packet<*>>, interval: Long, getViewers: () -> Iterable<Player>)

A task that sends the given packets to all players from getViewers every interval ticks.

Constructors

Link copied to clipboard
constructor(packet: Packet<*>, interval: Long, getViewers: () -> Iterable<Player>)

Creates a new PacketTask that sends the given packet to all players from getViewers.

constructor(packets: List<Packet<*>>, interval: Long, getViewers: () -> Iterable<Player>)

Functions

Link copied to clipboard

Checks whether the task is running.

Link copied to clipboard
fun start()

Starts the task.

Link copied to clipboard
fun stop()

Stops the task.