Class ScenarioSelectionLockEvent

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.ScenarioSelectionLockEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public final class ScenarioSelectionLockEvent extends ZentrixGameEvent implements org.bukkit.event.Cancellable
A match is about to lock its scenarios in.

This is the last moment the set can be changed. Listeners may add or remove IDs through getScenarioIds(); Zentrix validates whatever is left, so a change that breaks a dependency or introduces a conflict is corrected rather than honoured blindly.

Cancelling makes the match run no scenarios at all. It never stops the match itself.

Since:
1.6.0
  • Constructor Details

    • ScenarioSelectionLockEvent

      public ScenarioSelectionLockEvent(@NotNull @NotNull ZentrixGame game, @NotNull @NotNull ScenarioSelection proposed)
  • Method Details

    • getProposed

      @NotNull public @NotNull ScenarioSelection getProposed()
      The selection Zentrix arrived at, before any listener changed it.
    • getScenarioIds

      @NotNull public @NotNull List<String> getScenarioIds()
      The mutable set that will be locked in, subject to validation.
    • add

      public void add(@NotNull @NotNull String scenarioId)
      Adds a scenario to the set.
    • remove

      public boolean remove(@NotNull @NotNull String scenarioId)
      Removes a scenario from the set.
    • 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()