Class GameEndEvent
java.lang.Object
org.bukkit.event.Event
dev.despical.whackme.api.event.WhackMeEvent
dev.despical.whackme.api.event.game.GameEvent
dev.despical.whackme.api.event.game.GameEndEvent
Called when a Whack Me run reaches its normal ending phase.
Point generation has stopped, but result persistence and player cleanup have
not run yet. The game still contains its user, so temporary run statistics
and getFinalScore() are available to listeners.
@EventHandler
public void onGameEnd(GameEndEvent event) {
analytics.recordScore(event.getGame().getUser().getUUID(),
event.getFinalScore());
}
API note: This event is fired before personal/arena records are updated and
before temporary statistics are reset. It is not fired for force-stopped
games; use GameStopEvent for that lifecycle.-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the score accumulated during the completed run.static org.bukkit.event.HandlerList@NotNull org.bukkit.event.HandlerListMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
GameEndEvent
Creates a normal game end event.- Parameters:
game- game that reached its ending phase
-
-
Method Details
-
getFinalScore
public int getFinalScore()Returns the score accumulated during the completed run.- Returns:
- final local score, or
0if the game no longer has a user
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlersin classorg.bukkit.event.Event
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()
-