Class GameProfileRequestEvent
- java.lang.Object
-
- com.velocitypowered.api.event.player.GameProfileRequestEvent
-
public final class GameProfileRequestEvent extends java.lang.Object
This event is fired after thePreLoginEvent
in order to set up the game profile for the user. This can be used to configure a custom profile for a user, i.e. skin replacement.
-
-
Constructor Summary
Constructors Constructor Description GameProfileRequestEvent(InboundConnection connection, GameProfile originalProfile, boolean onlineMode)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InboundConnection
getConnection()
GameProfile
getGameProfile()
Returns the game profile that will be used to initialize the connection with.GameProfile
getOriginalProfile()
java.lang.String
getUsername()
boolean
isOnlineMode()
void
setGameProfile(@Nullable GameProfile gameProfile)
Sets the game profile to use for this connection.java.lang.String
toString()
-
-
-
Constructor Detail
-
GameProfileRequestEvent
public GameProfileRequestEvent(InboundConnection connection, GameProfile originalProfile, boolean onlineMode)
Creates a new instance.- Parameters:
connection
- the connection connecting to the proxyoriginalProfile
- the originalGameProfile
for the useronlineMode
- whether or not the user connected in online or offline mode
-
-
Method Detail
-
getConnection
public InboundConnection getConnection()
-
getUsername
public java.lang.String getUsername()
-
getOriginalProfile
public GameProfile getOriginalProfile()
-
isOnlineMode
public boolean isOnlineMode()
-
getGameProfile
public GameProfile getGameProfile()
Returns the game profile that will be used to initialize the connection with. Should no profile be currently specified, the one generated by the proxy (for offline mode) or retrieved from the Mojang session servers (for online mode) will be returned instead.- Returns:
- the user's
GameProfile
-
setGameProfile
public void setGameProfile(@Nullable GameProfile gameProfile)
Sets the game profile to use for this connection.- Parameters:
gameProfile
- the profile for this connection,null
uses the original profile
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-