Class FilteredTask

java.lang.Object
xyz.xenondevs.particle.task.ParticleTask
xyz.xenondevs.particle.task.FilteredTask

public final class FilteredTask extends ParticleTask
A ParticleTask implementation using a java Predicate to only send the packets to Players that match the filter.
Author:
ByteZ
See Also:
  • Constructor Details

    • FilteredTask

      public FilteredTask(List<Object> packets, int tickDelay, Predicate<org.bukkit.entity.Player> filter)
      Creates a new FilteredTask
      Parameters:
      packets - List of packets
      tickDelay - The delay of ticks between each execution
      filter - The Predicate to filter the Players
  • Method Details

    • getTargetPlayers

      public Collection<org.bukkit.entity.Player> getTargetPlayers()
      Uses the provided filter to filter all online Players and only returns players that match the given Predicate.
      Specified by:
      getTargetPlayers in class ParticleTask
      Returns:
      a list of Players matching the filter