Class ScenarioAnnounceEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
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
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionScenarioAnnounceEvent(@NotNull ZentrixGame game, @NotNull ScenarioDescriptor descriptor, @NotNull List<String> lines, int index, int total) -
Method Summary
Modifier and TypeMethodDescription@NotNull ScenarioDescriptorThe scenario being announced.static @NotNull org.bukkit.event.HandlerList@NotNull org.bukkit.event.HandlerListGets the handler list for this event.intgetIndex()This announcement's position in the match's sequence, starting at zero.getLines()The mutable lines that will be sent.@NotNull StringThe announced scenario's ID, for listeners that only care which one it is.intgetTotal()How many scenarios this match announces in total.booleanbooleanisFirst()Whether this is the announcement sent the moment the players land.voidsetCancelled(boolean cancelled) Methods inherited from class dev.itsharshxd.zentrix.api.events.ZentrixGameEvent
getArenaName, getGame, getGameId, getGameState, getGameTypeName, getPlayerCount, getRuntimeId, getSourceArenaNameMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
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
The scenario being announced. -
getScenarioId
The announced scenario's ID, for listeners that only care which one it is. -
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:
isCancelledin interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean cancelled) - Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()Description copied from class:ZentrixGameEventGets the handler list for this event.- Overrides:
getHandlersin classZentrixGameEvent- Returns:
- The handler list
-
getHandlerList
@NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList()
-