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 protected
ComponentResult(boolean status, @Nullable Component reason)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ResultedEvent.ComponentResult
allowed()
static ResultedEvent.ComponentResult
denied(Component reason)
static ResultedEvent.ComponentResult
denied(net.kyori.text.Component reason)
Deprecated.Optional<net.kyori.text.Component>
getReason()
Deprecated.Optional<Component>
getReasonComponent()
boolean
isAllowed()
Returns whether or not the event is allowed to proceed.String
toString()
-
-
-
Constructor Detail
-
ComponentResult
protected ComponentResult(boolean status, @Nullable Component reason)
-
-
Method Detail
-
isAllowed
public boolean isAllowed()
Description copied from interface:ResultedEvent.Result
Returns 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:
isAllowed
in interfaceResultedEvent.Result
- Returns:
- whether or not the event is allowed to proceed
-
getReason
@Deprecated public Optional<net.kyori.text.Component> getReason()
Deprecated.
-
allowed
public static ResultedEvent.ComponentResult allowed()
-
denied
public static ResultedEvent.ComponentResult denied(Component reason)
-
denied
@Deprecated public static ResultedEvent.ComponentResult denied(net.kyori.text.Component reason)
Deprecated.
-
-