Class PlayerVoteEvent

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

public class PlayerVoteEvent extends MatchboxEvent
Event fired when a player casts a vote during the voting phase.
Since:
0.9.5
  • Constructor Details

    • PlayerVoteEvent

      public PlayerVoteEvent(@NotNull @NotNull String sessionName, @NotNull @NotNull org.bukkit.entity.Player voter, @NotNull @NotNull org.bukkit.entity.Player target)
      Creates a new player vote event.
      Parameters:
      sessionName - the session name
      voter - the player who voted
      target - the player who was voted for
  • 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 where the vote occurred.
      Returns:
      the session name
    • getVoter

      @NotNull public @NotNull org.bukkit.entity.Player getVoter()
      Gets the player who cast the vote.
      Returns:
      the voter
    • getTarget

      @NotNull public @NotNull org.bukkit.entity.Player getTarget()
      Gets the player who was voted for.
      Returns:
      the voted target