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
ModifierConstructorDescriptionprotected
DelegateEvent
(org.bukkit.event.Event originalEvent, Cause cause) Create a new instance -
Method Summary
Modifier and TypeMethodDescriptiongetCause()
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
isSilent()
Get whether this should be a silent check.setAllowed
(boolean allowed) Set the event toEvent.Result.ALLOW
ifallowed
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
-
Constructor Details
-
DelegateEvent
Create a new instance- Parameters:
originalEvent
- the original eventcause
- 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
Return the cause.- Returns:
- the cause
-
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 interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean cancel) - Specified by:
setCancelled
in interfaceorg.bukkit.event.Cancellable
-
getResult
public org.bukkit.event.Event.Result getResult()- Specified by:
getResult
in interfaceHandleable
-
setResult
public void setResult(org.bukkit.event.Event.Result result) - Specified by:
setResult
in interfaceHandleable
-
isSilent
public boolean isSilent()Get whether this should be a silent check.- Returns:
- true if a silent check
-
setSilent
Set whether this should be a silent check.- Parameters:
silent
- true if silent- Returns:
- the same event
-
setAllowed
Set the event toEvent.Result.ALLOW
ifallowed
is true.- Parameters:
allowed
- true to set the result- Returns:
- the same event
-