Class ScenarioAnnounceEvent

java.lang.Object
org.bukkit.event.Event
dev.itsharshxd.zentrix.api.events.ZentrixEvent
dev.itsharshxd.zentrix.api.events.ZentrixGameEvent
dev.itsharshxd.zentrix.api.events.scenario.ScenarioAnnounceEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public final class ScenarioAnnounceEvent extends ZentrixGameEvent implements org.bukkit.event.Cancellable
One scenario's start announcement is about to reach a match.

Zentrix announces every scenario a match runs once its players are in the arena: the first the moment they land, the rest one at a time with the configured delay between them. This event is fired immediately before each of those announcements is sent, so a listener sees them in the same order the players do.

getLines() is mutable and holds the resolved wording — the locale entry for this scenario, the lines the scenario itself declared, or the shared fallback layout, whichever applied. Lines still carry & colour codes and <center> tags at this point; Zentrix formats them afterwards. Clearing the list is the same as cancelling.

Cancelling drops this one announcement. The rest of the match's scenarios are still announced on schedule, and the scenario itself is unaffected either way: this event decides what players are told, never what a match runs.

Since:
1.6.0
  • Constructor Details

    • ScenarioAnnounceEvent

      public ScenarioAnnounceEvent(@NotNull @NotNull ZentrixGame game, @NotNull @NotNull ScenarioDescriptor descriptor, @NotNull @NotNull List<String> lines, int index, int total)
  • Method Details

    • getDescriptor

      @NotNull public @NotNull ScenarioDescriptor getDescriptor()
      The scenario being announced.
    • getScenarioId

      @NotNull public @NotNull String getScenarioId()
      The announced scenario's ID, for listeners that only care which one it is.
    • getLines

      @NotNull public @NotNull List<String> getLines()
      The mutable lines that will be sent.

      Edit, replace or clear them freely; an empty list sends nothing.

    • getIndex

      public int getIndex()
      This announcement's position in the match's sequence, starting at zero.
    • getTotal

      public int getTotal()
      How many scenarios this match announces in total.
    • isFirst

      public boolean isFirst()
      Whether this is the announcement sent the moment the players land.
    • isCancelled

      public boolean isCancelled()
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
    • setCancelled

      public void setCancelled(boolean cancelled)
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Description copied from class: ZentrixGameEvent
      Gets the handler list for this event.
      Overrides:
      getHandlers in class ZentrixGameEvent
      Returns:
      The handler list
    • getHandlerList

      @NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList()