Class VictoryCelebrationEvent

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

public final class VictoryCelebrationEvent extends ZentrixGameEvent implements org.bukkit.event.Cancellable
Called when a won match is about to celebrate, with the celebration each winner will play.

getCelebrations() maps every winner still in the match to the ID of the celebration they will play - their own choice or the server's default. Listeners may give a winner another existing celebration through setCelebration(UUID, String) or keep one from celebrating through removeWinner(UUID); winners cannot be added. Cancelling plays no celebration at all. The win announcement and the match's restart are not affected either way.

Main thread; only fired while a listener is registered.

Since:
1.8.0
  • Constructor Details

    • VictoryCelebrationEvent

      public VictoryCelebrationEvent(@NotNull @NotNull ZentrixGame game, @NotNull @NotNull Map<UUID,String> celebrations, @NotNull @NotNull Set<UUID> winningTeam, @NotNull @NotNull Predicate<String> exists)
  • Method Details

    • getCelebrations

      @NotNull public @NotNull Map<UUID,String> getCelebrations()
      The celebration each winner will play, by winner; a read-only view.
    • setCelebration

      public void setCelebration(@NotNull @NotNull UUID winnerId, @NotNull @NotNull String celebrationId)
      Gives a winner another celebration.
      Throws:
      IllegalArgumentException - when the player does not celebrate in this match, or no celebration with that ID exists
    • removeWinner

      public boolean removeWinner(@NotNull @NotNull UUID winnerId)
      Keeps a winner from celebrating.
      Returns:
      whether they would have celebrated
    • getWinningTeam

      @NotNull public @NotNull Set<UUID> getWinningTeam()
      The winning team, including members who fell before the win.
    • 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()