Interface PlayerSettings
public interface PlayerSettings
Represents the settings/preferences of a connected player.
These settings are extracted from the player's Connect packet when they join the proxy.
Example Usage
PlayerSettings settings = player.getPlayerSettings();
// Get the player's locale
Locale locale = settings.getLocale();
String message = getLocalizedMessage("welcome", locale);
// Or with Optional
settings.getLocaleCode().ifPresent(code -> {
// Use the raw locale code (e.g., "en-US", "de-DE")
});
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumRepresents the type of Hytale client connecting. -
Method Summary
Modifier and TypeMethodDescriptionGets the client type the player is using.Gets the player's locale/language preference.Gets the raw locale code as sent by the client.
-
Method Details
-
getLocale
Gets the player's locale/language preference.This is parsed from the language field in the Connect packet. If no language was provided or parsing fails, returns the default locale.
- Returns:
- the player's locale, or
Locale.ENGLISHif unknown
-
getLocaleCode
-
getClientType
Gets the client type the player is using.This indicates whether the client is the main game client, an editor, or another client type.
- Returns:
- the client type
-