Package com.velocitypowered.api.event
Class ResultedEvent.ComponentResult
- java.lang.Object
-
- com.velocitypowered.api.event.ResultedEvent.ComponentResult
-
- All Implemented Interfaces:
ResultedEvent.Result
- Enclosing interface:
- ResultedEvent<R extends ResultedEvent.Result>
public static final class ResultedEvent.ComponentResult extends Object implements ResultedEvent.Result
Represents an "allowed/denied" result with a reason allowed for denial.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedComponentResult(boolean status, @Nullable Component reason)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ResultedEvent.ComponentResultallowed()static ResultedEvent.ComponentResultdenied(Component reason)Optional<Component>getReasonComponent()booleanisAllowed()Returns whether or not the event is allowed to proceed.StringtoString()
-
-
-
Constructor Detail
-
ComponentResult
protected ComponentResult(boolean status, @Nullable Component reason)
-
-
Method Detail
-
isAllowed
public boolean isAllowed()
Description copied from interface:ResultedEvent.ResultReturns whether or not the event is allowed to proceed. Plugins may choose to skip denied events, and the proxy will respect the result of this method.- Specified by:
isAllowedin interfaceResultedEvent.Result- Returns:
- whether or not the event is allowed to proceed
-
allowed
public static ResultedEvent.ComponentResult allowed()
-
denied
public static ResultedEvent.ComponentResult denied(Component reason)
-
-