Package com.ohacd.matchbox.api.events
Class CureEvent
java.lang.Object
com.ohacd.matchbox.api.MatchboxEvent
com.ohacd.matchbox.api.events.CureEvent
Event fired when a cure action is performed (Medic cures an infected player).
- Since:
- 0.9.5
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispatch(@NotNull MatchboxEventListener listener) Dispatches this event to the appropriate listener method.org.bukkit.entity.PlayergetMedic()Gets the player who performed the cure.Gets the name of the session where the cure occurred.org.bukkit.entity.PlayerGets the player who was cured.booleanGets whether the target had a real infection.Methods inherited from class com.ohacd.matchbox.api.MatchboxEvent
getTimestamp, toString
-
Constructor Details
-
CureEvent
public CureEvent(@NotNull @NotNull String sessionName, @NotNull @NotNull org.bukkit.entity.Player medic, @NotNull @NotNull org.bukkit.entity.Player target, boolean realInfection) Creates a new cure event.- Parameters:
sessionName- the session namemedic- the player performing the curetarget- the player being curedrealInfection- whether the target had a real infection (false if it was delusion)
-
-
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 cure occurred.- Returns:
- the session name
-
getMedic
public org.bukkit.entity.Player getMedic()Gets the player who performed the cure.- Returns:
- the medic
-
getTarget
public org.bukkit.entity.Player getTarget()Gets the player who was cured.- Returns:
- the target
-
isRealInfection
public boolean isRealInfection()Gets whether the target had a real infection.- Returns:
- true if the target was actually infected, false if it was a delusion
-