Class LocalPlayerPreLoginEvent
java.lang.Object
eu.cloudnetservice.driver.event.Event
eu.cloudnetservice.modules.bridge.node.event.LocalPlayerPreLoginEvent
public final class LocalPlayerPreLoginEvent
extends eu.cloudnetservice.driver.event.Event
Called before the login of a player is processed and therefore allows determining the outcome of the login process.
Note: This event is ONLY called on the node the proxy is running on.
- Since:
- 4.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classRepresents the outcome of the login event. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final NetworkPlayerProxyInfoprivate LocalPlayerPreLoginEvent.Result -
Constructor Summary
ConstructorsConstructorDescriptionLocalPlayerPreLoginEvent(@NonNull NetworkPlayerProxyInfo playerInfo) Constructs a new player pre login event with the given player proxy info. -
Method Summary
Modifier and TypeMethodDescriptionGets the player proxy info for the player requesting a login.result()Gets the result of the login process.voidSets the result of the login process.
-
Field Details
-
playerInfo
-
result
-
-
Constructor Details
-
LocalPlayerPreLoginEvent
Constructs a new player pre login event with the given player proxy info.- Parameters:
playerInfo- the player info of the player connecting.- Throws:
NullPointerException- if the player proxy info is null.
-
-
Method Details
-
playerInfo
Gets the player proxy info for the player requesting a login.- Returns:
- the player proxy info.
-
result
Gets the result of the login process. IfLocalPlayerPreLoginEvent.Result.permitLogin()is true the player is allowed to log in and denied otherwise.- Returns:
- the result of the login process.
-
result
Sets the result of the login process. To deny a login useLocalPlayerPreLoginEvent.Result.denied(Component)andLocalPlayerPreLoginEvent.Result.allowed()to allow the login.- Parameters:
result- the result to set for the login.- Throws:
NullPointerException- if the result is null.
-