Class PreLoginEvent.PreLoginComponentResult
- java.lang.Object
-
- com.velocitypowered.api.event.connection.PreLoginEvent.PreLoginComponentResult
-
- All Implemented Interfaces:
ResultedEvent.Result
- Enclosing class:
- PreLoginEvent
public static final class PreLoginEvent.PreLoginComponentResult extends Object implements ResultedEvent.Result
Represents an "allowed/allowed with forced online\offline mode/denied" result with a reason allowed for denial.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static PreLoginEvent.PreLoginComponentResult
allowed()
Returns a result indicating the connection will be allowed through the proxy.static PreLoginEvent.PreLoginComponentResult
denied(Component reason)
Denies the login with the specified reason.static PreLoginEvent.PreLoginComponentResult
denied(net.kyori.text.Component reason)
Deprecated.static PreLoginEvent.PreLoginComponentResult
forceOfflineMode()
Returns a result indicating the connection will be allowed through the proxy, but the connection will be forced to use offline mode even when the proxy is running in online mode.static PreLoginEvent.PreLoginComponentResult
forceOnlineMode()
Returns a result indicating the connection will be allowed through the proxy, but the connection will be forced to use online mode provided that the proxy is in offline mode.Optional<net.kyori.text.Component>
getReason()
Deprecated.Optional<Component>
getReasonComponent()
boolean
isAllowed()
Returns whether or not the event is allowed to proceed.boolean
isForceOfflineMode()
boolean
isOnlineModeAllowed()
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
@Deprecated public Optional<net.kyori.text.Component> getReason()
Deprecated.
-
isOnlineModeAllowed
public boolean isOnlineModeAllowed()
-
isForceOfflineMode
public boolean isForceOfflineMode()
-
allowed
public static PreLoginEvent.PreLoginComponentResult allowed()
Returns a result indicating the connection will be allowed through the proxy.- Returns:
- the allowed result
-
forceOnlineMode
public static PreLoginEvent.PreLoginComponentResult forceOnlineMode()
Returns a result indicating the connection will be allowed through the proxy, but the connection will be forced to use online mode provided that the proxy is in offline mode. This acts similarly toallowed()
on an online-mode proxy.- Returns:
- the result
-
forceOfflineMode
public static PreLoginEvent.PreLoginComponentResult forceOfflineMode()
Returns a result indicating the connection will be allowed through the proxy, but the connection will be forced to use offline mode even when the proxy is running in online mode.- Returns:
- the result
-
denied
@Deprecated public static PreLoginEvent.PreLoginComponentResult denied(net.kyori.text.Component reason)
Deprecated.Denies the login with the specified reason.- Parameters:
reason
- the reason for disallowing the connection- Returns:
- a new result
-
denied
public static PreLoginEvent.PreLoginComponentResult denied(Component reason)
Denies the login with the specified reason.- Parameters:
reason
- the reason for disallowing the connection- Returns:
- a new result
-
-