Class GameProfileRequestEventImpl
- java.lang.Object
-
- com.velocitypowered.api.event.player.GameProfileRequestEventImpl
-
- All Implemented Interfaces:
Event,GameProfileRequestEvent
public final class GameProfileRequestEventImpl extends Object implements GameProfileRequestEvent
This event is fired after thePreLoginEventImplin 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 GameProfileRequestEventImpl(InboundConnection connection, GameProfile originalProfile, boolean onlineMode)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InboundConnectionconnection()GameProfilegameProfile()Returns the game profile that will be used to initialize the connection with.GameProfileinitialProfile()booleanisOnlineMode()voidsetGameProfile(@Nullable GameProfile gameProfile)Sets the game profile to use for this connection.StringtoString()Stringusername()
-
-
-
Constructor Detail
-
GameProfileRequestEventImpl
public GameProfileRequestEventImpl(InboundConnection connection, GameProfile originalProfile, boolean onlineMode)
Creates a new instance.- Parameters:
connection- the connection connecting to the proxyoriginalProfile- the originalGameProfilefor the useronlineMode- whether or not the user connected in online or offline mode
-
-
Method Detail
-
connection
public InboundConnection connection()
- Specified by:
connectionin interfaceGameProfileRequestEvent
-
username
public String username()
- Specified by:
usernamein interfaceGameProfileRequestEvent
-
initialProfile
public GameProfile initialProfile()
- Specified by:
initialProfilein interfaceGameProfileRequestEvent
-
isOnlineMode
public boolean isOnlineMode()
- Specified by:
isOnlineModein interfaceGameProfileRequestEvent
-
gameProfile
public GameProfile gameProfile()
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.- Specified by:
gameProfilein interfaceGameProfileRequestEvent- Returns:
- the user's
GameProfile
-
setGameProfile
public void setGameProfile(@Nullable GameProfile gameProfile)
Sets the game profile to use for this connection.- Specified by:
setGameProfilein interfaceGameProfileRequestEvent- Parameters:
gameProfile- the profile for this connection,nulluses the original profile
-
-