Class ActionBarTickerService

java.lang.Object
dev.deepcore.challenge.session.ActionBarTickerService

public final class ActionBarTickerService extends Object
Runs and manages a repeating action-bar broadcast task.
  • Constructor Details

    • ActionBarTickerService

      public ActionBarTickerService(org.bukkit.plugin.Plugin plugin)
      Creates an action-bar ticker service.
      Parameters:
      plugin - plugin used to schedule ticker tasks
  • Method Details

    • start

      public void start(BooleanSupplier shouldTick, Runnable tickWork, Supplier<net.kyori.adventure.text.Component> messageSupplier, Supplier<List<org.bukkit.entity.Player>> recipientsSupplier)
      Starts the ticker task that executes work and pushes action-bar updates.
      Parameters:
      shouldTick - predicate checked before each tick execution
      tickWork - work action to execute before broadcasting action bar
      messageSupplier - supplier for the action-bar message
      recipientsSupplier - supplier for players receiving action-bar updates
    • stop

      public void stop()
      Stops the active action-bar ticker task if one is running.
    • clearActionBar

      public void clearActionBar(Iterable<? extends org.bukkit.entity.Player> players)
      Clears the action bar for all provided players.
      Parameters:
      players - players whose action bars should be cleared