Oops... looks like the spiders padded through here
Add products to your cart and remove them from here Lets buypublic interface PlayersManager
Implementations handle caching, persistence, and disposal internally.
Consumers should use only these methods to fetch or interact with PlayerData.
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<? extends PlayerData> |
fetchPlayerDataAsync(org.bukkit.OfflinePlayer player)
Fetches player data asynchronously, caching it if necessary.
|
PlayerData |
getCachedDataNow(org.bukkit.entity.Player player)
Gets cached data for an online player immediately, throwing if not present.
|
PlayerData |
getPlayerIfCached(org.bukkit.OfflinePlayer player,
boolean requestCache)
Gets cached player data immediately if available.
|
boolean |
isDataCached(org.bukkit.OfflinePlayer player)
Checks whether the player's data is currently cached.
|
void |
setPlayerDataLayer(PlayerDataLayer layer)
Sets the player data layer for this manager.
|
CompletableFuture<? extends PlayerData> fetchPlayerDataAsync(org.bukkit.OfflinePlayer player)
If the data is already cached, the future completes immediately with the cached data. Otherwise, the data is loaded from the database asynchronously and cached.
A timeout is enforced: if the load takes too long, the future completes exceptionally.player - the offline playerPlayerData getPlayerIfCached(org.bukkit.OfflinePlayer player, boolean requestCache)
If not cached and requestCache is true, this triggers an
asynchronous fetch in the background, but still returns null immediately.
player - the offline playerrequestCache - whether to start an async fetch if not cachednull if not cachedPlayerData getCachedDataNow(org.bukkit.entity.Player player)
This is a strict access method intended for contexts where player data is guaranteed to be available (e.g., events after login).
player - the online playerIllegalStateException - if the data is not cachedboolean isDataCached(org.bukkit.OfflinePlayer player)
player - the offline playertrue if cached, false otherwisevoid setPlayerDataLayer(PlayerDataLayer layer)
This allows addons to inject custom data layers (e.g., Redis caching layer) between the local cache and database.
layer - the data layer to use, or null to use default direct database layer
Oops... looks like the spiders padded through here
Add products to your cart and remove them from here Lets buy