Class ScenarioVoteStartEvent

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

public final class ScenarioVoteStartEvent extends ZentrixGameEvent implements org.bukkit.event.Cancellable
A match's scenario vote is opening.

Listeners may narrow or widen the eligible pool and change the duration. Cancelling skips the vote entirely, in which case the configured no-vote rule decides what the match runs — the match is never left waiting.

Since:
1.6.0
  • Constructor Details

    • ScenarioVoteStartEvent

      public ScenarioVoteStartEvent(@NotNull @NotNull ZentrixGame game, @NotNull @NotNull Set<String> eligible, int durationSeconds)
  • Method Details

    • getEligible

      @NotNull public @NotNull Set<String> getEligible()
      The mutable pool players will be able to vote for.
    • addEligible

      public void addEligible(@NotNull @NotNull String scenarioId)
    • removeEligible

      public boolean removeEligible(@NotNull @NotNull String scenarioId)
    • getDurationSeconds

      public int getDurationSeconds()
    • setDurationSeconds

      public void setDurationSeconds(int durationSeconds)
      Shortens or extends the vote. Values below one second are clamped up.
    • 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()