public final class UsernameCache
extends java.lang.Object
Modders should use getLastKnownUsername(UUID)
to determine a players
last known username.
For convenience, getMap()
is provided to get an immutable copy of
the caches underlying map.
Modifier and Type | Method and Description |
---|---|
static boolean |
containsUUID(java.util.UUID uuid)
Check if the cache contains the given player's username
|
static java.lang.String |
getLastKnownUsername(java.util.UUID uuid)
Get the player's last known username
May be
null |
static java.util.Map<java.util.UUID,java.lang.String> |
getMap()
Get an immutable copy of the cache's underlying map
|
protected static void |
load()
Load the cache from file
|
protected static boolean |
removeUsername(java.util.UUID uuid)
Remove a player's username from the cache
|
protected static void |
save()
Save the cache to file
|
protected static void |
setUsername(java.util.UUID uuid,
java.lang.String username)
Set a player's current username
|
protected static void setUsername(java.util.UUID uuid, java.lang.String username)
uuid
- the player's UUID
username
- the player's usernameprotected static boolean removeUsername(java.util.UUID uuid)
uuid
- the player's UUID
@Nullable public static java.lang.String getLastKnownUsername(java.util.UUID uuid)
May be null
uuid
- the player's UUID
null
if the
cache doesn't have a record of the last usernamepublic static boolean containsUUID(java.util.UUID uuid)
uuid
- the player's UUID
public static java.util.Map<java.util.UUID,java.lang.String> getMap()
protected static void save()
protected static void load()