Class PlayerLeaveEvent

java.lang.Object
com.ohacd.matchbox.api.MatchboxEvent
com.ohacd.matchbox.api.events.PlayerLeaveEvent

public class PlayerLeaveEvent extends MatchboxEvent
Event fired when a player leaves a game session.
Since:
0.9.5
  • Constructor Details

    • PlayerLeaveEvent

      public PlayerLeaveEvent(@NotNull @NotNull String sessionName, @NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull PlayerLeaveEvent.LeaveReason reason)
      Creates a new player leave event.
      Parameters:
      sessionName - the session name
      player - the player who left
      reason - the reason for leaving
  • Method Details

    • dispatch

      public void dispatch(@NotNull @NotNull MatchboxEventListener listener)
      Description copied from class: MatchboxEvent
      Dispatches this event to the appropriate listener method.

      This method uses the visitor pattern to call the correct handler method based on the concrete event type. Implementing classes should call super.dispatch(listener) as the first line.

      Specified by:
      dispatch in class MatchboxEvent
      Parameters:
      listener - the listener to dispatch to
    • getSessionName

      @NotNull public @NotNull String getSessionName()
      Gets the name of the session the player left.
      Returns:
      the session name
    • getPlayer

      @NotNull public @NotNull org.bukkit.entity.Player getPlayer()
      Gets the player who left the session.
      Returns:
      the player
    • getReason

      @NotNull public @NotNull PlayerLeaveEvent.LeaveReason getReason()
      Gets the reason why the player left.
      Returns:
      the leave reason