Class PlayerResolver

java.lang.Object
com.enhancedechest.command.admin.PlayerResolver

public final class PlayerResolver extends Object
Resolves a player name to a UUID for admin commands, working for offline players.

Resolution order:

  1. an online player with the exact name (cheap, main-thread safe);
  2. the plugin's own players table (its name index is kept up to date the first time a player opens an ender chest, so it covers anyone who has used the plugin — independent of the server usercache or network availability);
  3. Paper's usercache (getOfflinePlayerIfCached) — memory only, no disk and no network;
  4. a Bukkit offline lookup as a last resort (covers players who have never opened an ender chest, or last did so before this version started indexing names).
The table and offline lookups run on the async storage executor so the calling command thread never blocks — getOfflinePlayer(String) can hit the network in online mode. Completes with null when no player matches.

The last resort is the only place in the plugin that can still touch the playerdata folder, and it is deliberately kept: it is one named lookup, only when an admin actually runs a command against a player the database has never seen, never a scan of the folder and never on the tab-completion path. Everything cheaper is tried first precisely so it almost never runs.