Class UuidLookup
java.lang.Object
com.bencodez.advancedcore.api.player.UuidLookup
-
Method Summary
Modifier and TypeMethodDescriptionvoidcacheMapping(String uuid, String name) Force insert/update mapping in local caches.Retrieve all player names currently cached in memory.getCachedName(String uuid) Convenience: get cached name for uuid (or "").getCachedUUID(String playerName) Convenience: get cached uuid for name (or "").static UuidLookupgetPlayerName(AdvancedCoreUser user, String uuid) Resolve name from UUID string using user stored data + Bukkit if onlinegetPlayerName(AdvancedCoreUser user, String uuid, boolean useCache) Resolve UUID string from a player name.voidinvalidate(String uuidOrName) Remove both directions from local caches (does not remove from DB).
-
Method Details
-
getInstance
-
getAllCachedNames
Retrieve all player names currently cached in memory.This returns a snapshot of the internal uuid→name map values. It does not hit any storage, so it’s safe to call from tab‑complete code.
- Returns:
- list containing all cached player names (may include duplicates)
-
getUUID
Resolve UUID string from a player name. Lookup order: 1) If input is already a UUID -> canonical UUID 2) Offline mode: deterministic UUID from NORMALIZED name 3) Online player (Bukkit) 4) Local cache (name->uuid) 5) Storage (mysql/sqlite) or flatfile scan fallback 6) Bukkit OfflinePlayer fallback (best-effort)- Parameters:
playerName- player name or UUID string- Returns:
- UUID string, or "" if not found / invalid input
-
getPlayerName
Resolve name from UUID string using user stored data + Bukkit if online. - Uses local cache first - If online, returns Bukkit name and updates stored PlayerName - Otherwise returns stored PlayerName (if any)- Returns:
- name, or "" if none
-
getPlayerName
-
cacheMapping
Force insert/update mapping in local caches. -
invalidate
Remove both directions from local caches (does not remove from DB). -
getCachedUUID
Convenience: get cached uuid for name (or ""). -
getCachedName
Convenience: get cached name for uuid (or "").
-