Package com.ohacd.matchbox.api.events
Class PlayerVoteEvent
java.lang.Object
com.ohacd.matchbox.api.MatchboxEvent
com.ohacd.matchbox.api.events.PlayerVoteEvent
Event fired when a player casts a vote during the voting phase.
- Since:
- 0.9.5
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerVoteEvent(@NotNull String sessionName, @NotNull org.bukkit.entity.Player voter, @NotNull org.bukkit.entity.Player target) Creates a new player vote event. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispatch(@NotNull MatchboxEventListener listener) Dispatches this event to the appropriate listener method.@NotNull StringGets the name of the session where the vote occurred.@NotNull org.bukkit.entity.PlayerGets the player who was voted for.@NotNull org.bukkit.entity.PlayergetVoter()Gets the player who cast the vote.Methods inherited from class com.ohacd.matchbox.api.MatchboxEvent
getTimestamp, toString
-
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 namevoter- the player who votedtarget- the player who was voted for
-
-
Method Details
-
dispatch
Description copied from class:MatchboxEventDispatches 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:
dispatchin classMatchboxEvent- Parameters:
listener- the listener to dispatch to
-
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
-