Class PlayerUUIDs
java.lang.Object
com.cryptomorin.xseries.profiles.PlayerUUIDs
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull UUIDgetOfflineUUID(@NotNull String username) static @Nullable UUIDgetRealUUIDOfPlayer(@NotNull String username) static @Nullable UUIDgetRealUUIDOfPlayer(@NotNull String username, @NotNull UUID uuid) static booleanstatic StringtoUndashedUUID(UUID id) static booleanWhether player identity on this server is based on real, Mojang-authenticated UUIDs.static UUIDUUIDFromDashlessString(String dashlessUUIDString)
-
Field Details
-
IDENTITY_UUID
Used as the default UUID for GameProfiles. Also used as a null-indicating value. -
OFFLINE_TO_ONLINE
-
ONLINE_TO_OFFLINE
-
USERNAME_TO_ONLINE
-
PROXY_ONLINE_MODE_PROPERTY
System property that overridesusesRealUUIDs()when set totrueorfalse. Useful for setups that the automatic detection cannot figure out (e.g. Spigot behind an offline-mode BungeeCord before any player has joined).- See Also:
-
-
Constructor Details
-
PlayerUUIDs
public PlayerUUIDs()
-
-
Method Details
-
UUIDFromDashlessString
-
toUndashedUUID
-
getOfflineUUID
-
isOnlineMode
public static boolean isOnlineMode() -
usesRealUUIDs
public static boolean usesRealUUIDs()Whether player identity on this server is based on real, Mojang-authenticated UUIDs.This is what code should use instead of
isOnlineMode()when deciding which UUID belongs in the server's own records (e.g. theusercache.jsonuser cache).Bukkit.getOnlineMode()isfalseon every proxied backend, but backends behind an online-mode BungeeCord/Velocity proxy still receive and store real UUIDs. Treating those servers as offline corrupts their user cache with computed offline UUIDs, which breaks name-based lookups (whitelist, bans, other plugins) for the affected players.Detection order:
- The "xseries.profiles.proxyOnlineMode" system property, if set.
Bukkit.getOnlineMode()beingtrue.- Paper's
proxiesconfig (isProxyOnlineMode()), which covers both Velocity and BungeeCord forwarding, on any Paper-based server. - On Spigot behind BungeeCord (
settings.bungeecord), the UUID of a currently online player: proxies compute offline UUIDs with the same formula as vanilla, so a player whose UUID doesn't matchgetOfflineUUID(String)proves the proxy runs in online mode. With no player online the result is assumed offline but not cached, so it's re-evaluated on the next call.
-
getRealUUIDOfPlayer
-
getRealUUIDOfPlayer
-