Class UuidLookup

java.lang.Object
com.bencodez.advancedcore.api.player.UuidLookup

public class UuidLookup extends Object
  • Method Details

    • getInstance

      public static UuidLookup getInstance()
    • getAllCachedNames

      public List<String> 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

      public String getUUID(String playerName)
      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

      public String getPlayerName(AdvancedCoreUser user, String uuid)
      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

      public String getPlayerName(AdvancedCoreUser user, String uuid, boolean useCache)
    • cacheMapping

      public void cacheMapping(String uuid, String name)
      Force insert/update mapping in local caches.
    • invalidate

      public void invalidate(String uuidOrName)
      Remove both directions from local caches (does not remove from DB).
    • getCachedUUID

      public String getCachedUUID(String playerName)
      Convenience: get cached uuid for name (or "").
    • getCachedName

      public String getCachedName(String uuid)
      Convenience: get cached name for uuid (or "").