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
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionVictoryCelebrationEvent(@NotNull ZentrixGame game, @NotNull Map<UUID, String> celebrations, @NotNull Set<UUID> winningTeam, @NotNull Predicate<String> exists) -
Method Summary
Modifier and TypeMethodDescriptionThe celebration each winner will play, by winner; a read-only view.static @NotNull org.bukkit.event.HandlerList@NotNull org.bukkit.event.HandlerListGets the handler list for this event.The winning team, including members who fell before the win.booleanbooleanremoveWinner(@NotNull UUID winnerId) Keeps a winner from celebrating.voidsetCancelled(boolean cancelled) voidsetCelebration(@NotNull UUID winnerId, @NotNull String celebrationId) Gives a winner another celebration.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
-
VictoryCelebrationEvent
-
-
Method Details
-
getCelebrations
The celebration each winner will play, by winner; a read-only view. -
setCelebration
Gives a winner another celebration.- Throws:
IllegalArgumentException- when the player does not celebrate in this match, or no celebration with that ID exists
-
removeWinner
Keeps a winner from celebrating.- Returns:
- whether they would have celebrated
-
getWinningTeam
The winning team, including members who fell before the win. -
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()
-