Package com.enhancedechest.command.admin
Class PlayerResolver
java.lang.Object
com.enhancedechest.command.admin.PlayerResolver
Resolves a player name to a UUID for admin commands, working for offline players.
Resolution order:
- an online player with the exact name (cheap, main-thread safe);
- the plugin's own
playerstable (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); - Paper's usercache (
getOfflinePlayerIfCached) — memory only, no disk and no network; - 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).
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.
-
Method Summary
Modifier and TypeMethodDescriptionstatic CompletableFuture<UUID> resolveAsync(StorageGateway gateway, DbExecutor db, String name)
-
Method Details
-
resolveAsync
public static CompletableFuture<UUID> resolveAsync(StorageGateway gateway, DbExecutor db, String name)
-