Package redempt.redlib.misc
Class UserCache
java.lang.Object
redempt.redlib.misc.UserCache
A cache of offline users by name which can be queried without worrying about web requests
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Initializes the user cache asynchronouslystatic void
Initializes the user cache asynchronouslystatic org.bukkit.OfflinePlayer
getOfflinePlayer
(String name) Gets an OfflinePlayer by name, initializing the cache synchronously if it has not been initialized yetstatic void
init()
Initializes the user cache synchronously
-
Constructor Details
-
UserCache
public UserCache()
-
-
Method Details
-
asyncInit
Initializes the user cache asynchronously- Parameters:
onComplete
- A Runnable to be run when the initialization is complete
-
asyncInit
public static void asyncInit()Initializes the user cache asynchronously -
init
public static void init()Initializes the user cache synchronously -
getOfflinePlayer
Gets an OfflinePlayer by name, initializing the cache synchronously if it has not been initialized yet- Parameters:
name
- The name of the player, case insensitive- Returns:
- The OfflinePlayer, or null
-