Class DelegateEvent

java.lang.Object
org.bukkit.event.Event
com.sk89q.worldguard.bukkit.event.DelegateEvent
All Implemented Interfaces:
Handleable, org.bukkit.event.Cancellable
Direct Known Subclasses:
BreakBlockEvent, DamageEntityEvent, DestroyEntityEvent, PlaceBlockEvent, SpawnEntityEvent, UseBlockEvent, UseEntityEvent, UseItemEvent

public abstract class DelegateEvent extends org.bukkit.event.Event implements org.bukkit.event.Cancellable, Handleable
This event is an internal event. We do not recommend handling or throwing this event or its subclasses as the interface is highly subject to change.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.bukkit.event.Event

    org.bukkit.event.Event.Result
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    DelegateEvent(org.bukkit.event.Event originalEvent, Cause cause)
    Create a new instance
  • Method Summary

    Modifier and Type
    Method
    Description
    Return the cause.
    org.bukkit.event.Event
    Get the original event.
    List<com.sk89q.worldguard.protection.flags.StateFlag>
    Get a list of relevant flags to consider for this event.
    org.bukkit.event.Event.Result
     
    boolean
     
    boolean
    Get whether this should be a silent check.
    setAllowed(boolean allowed)
    Set the event to Event.Result.ALLOW if allowed is true.
    void
    setCancelled(boolean cancel)
     
    void
    setResult(org.bukkit.event.Event.Result result)
     
    setSilent(boolean silent)
    Set whether this should be a silent check.

    Methods inherited from class org.bukkit.event.Event

    callEvent, getEventName, getHandlers, isAsynchronous

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DelegateEvent

      protected DelegateEvent(@Nullable org.bukkit.event.Event originalEvent, Cause cause)
      Create a new instance
      Parameters:
      originalEvent - the original event
      cause - the cause
  • Method Details

    • getOriginalEvent

      @Nullable public org.bukkit.event.Event getOriginalEvent()
      Get the original event.
      Returns:
      the original event, which may be null if unavailable
    • getCause

      public Cause getCause()
      Return the cause.
      Returns:
      the cause
    • getRelevantFlags

      public List<com.sk89q.worldguard.protection.flags.StateFlag> getRelevantFlags()
      Get a list of relevant flags to consider for this event.
      Returns:
      A list of relevant flags
    • isCancelled

      public boolean isCancelled()
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
    • setCancelled

      public void setCancelled(boolean cancel)
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
    • getResult

      public org.bukkit.event.Event.Result getResult()
      Specified by:
      getResult in interface Handleable
    • setResult

      public void setResult(org.bukkit.event.Event.Result result)
      Specified by:
      setResult in interface Handleable
    • isSilent

      public boolean isSilent()
      Get whether this should be a silent check.
      Returns:
      true if a silent check
    • setSilent

      public DelegateEvent setSilent(boolean silent)
      Set whether this should be a silent check.
      Parameters:
      silent - true if silent
      Returns:
      the same event
    • setAllowed

      public DelegateEvent setAllowed(boolean allowed)
      Set the event to Event.Result.ALLOW if allowed is true.
      Parameters:
      allowed - true to set the result
      Returns:
      the same event