Class CureEvent

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

public class CureEvent extends MatchboxEvent
Event fired when a cure action is performed (Medic cures an infected player).
Since:
0.9.5
  • 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 name
      medic - the player performing the cure
      target - the player being cured
      realInfection - whether the target had a real infection (false if it was delusion)
  • 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

      public String 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