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 java.lang.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 net.kyori.adventure.text.Component reason)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ResultedEvent.ComponentResult
allowed()
static ResultedEvent.ComponentResult
denied(net.kyori.adventure.text.Component reason)
java.util.Optional<net.kyori.adventure.text.Component>
getReason()
boolean
isAllowed()
Returns whether or not the event is allowed to proceed.java.lang.String
toString()
-
-
-
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
public java.util.Optional<net.kyori.adventure.text.Component> getReason()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
allowed
public static ResultedEvent.ComponentResult allowed()
-
denied
public static ResultedEvent.ComponentResult denied(net.kyori.adventure.text.Component reason)
-
-