Interface OfflinePlayers


public interface OfflinePlayers
  • Method Details

    • of

      @Contract(pure=true) OfflinePlayer of(UUID uuid)
      Gets the handle for an identity, whether or not the server has ever observed it.
      Parameters:
      uuid - the player identity
      Returns:
      the handle, whose OfflinePlayer.hasPlayedBefore() reports whether anything is known about it
      Since:
      0.1.0
    • of

      @Contract(pure=true) OfflinePlayer of(Player player)
      Gets the handle for a connected player.
      Parameters:
      player - the connected player
      Returns:
      the handle for that player's identity
      Since:
      0.1.0
    • cached

      @Contract(pure=true) Optional<OfflinePlayer> cached(String name)
      Looks up an identity by name without contacting storage or the network.
      Parameters:
      name - the player name
      Returns:
      the handle, or empty if the name is not currently known
      Since:
      0.1.0
    • cached

      @Contract(pure=true) Optional<OfflinePlayer> cached(UUID uuid)
      Looks up an identity without contacting storage or the network.

      Unlike of(UUID), this reports whether the identity is known.

      Parameters:
      uuid - the player identity
      Returns:
      the handle, or empty if the identity is not currently known
      Since:
      0.1.0
    • lookup

      Resolves an identity by name, consulting the profile source when the name is not already known.
      Parameters:
      name - the player name
      Returns:
      a future completing with the handle, or with an empty result if no such player exists
      Since:
      0.1.0
    • lookup

      Resolves several identities by name.
      Parameters:
      names - the player names; duplicates and case differences are collapsed
      Returns:
      a future completing with the resolved handles, keyed by the requested name; names that do not resolve are absent from the result
      Since:
      0.1.0
    • refresh

      Produces an updated handle for an identity, consulting the profile source when the locally held record has expired.
      Parameters:
      uuid - the player identity
      Returns:
      a future completing with an updated handle, carrying the previously known name if the lookup does not succeed
      Since:
      0.1.0
    • online

      Optional<? extends Player> online(UUID uuid)
      Gets the connected player behind an identity.
      Parameters:
      uuid - the player identity
      Returns:
      the connected player, or empty if that identity is not connected
      Since:
      0.1.0
    • isOperator

      boolean isOperator(UUID uuid)
      Checks whether an identity holds operator status.
      Parameters:
      uuid - the player identity
      Returns:
      true if that identity is an operator
      Since:
      0.1.0
    • setOperator

      void setOperator(UUID uuid, boolean operator)
      Sets the operator status of an identity, whether or not it is connected.
      Parameters:
      uuid - the player identity
      operator - the new operator status
      Since:
      0.1.0
    • snapshot

      Reads the saved state of an identity, or its current state when it is connected.
      Parameters:
      uuid - the player identity
      Returns:
      a future completing with the state, or with an empty result if nothing has ever been saved for that identity
      Since:
      0.1.0
    • known

      @Contract(pure=true) Collection<OfflinePlayer> known()
      Gets every identity currently held in the cache.
      Returns:
      an immutable snapshot of the known identities
      Since:
      0.1.0