Class PlayerProvider

java.lang.Object
cn.lunadeer.dominion.providers.PlayerProvider

public abstract class PlayerProvider extends Object
API operations for player data and group-title selection.

Read operations return snapshots. The title mutation is asynchronous and completes with the updated player record, or null when validation or permission checks fail.

  • Field Details

    • instance

      protected static PlayerProvider instance
      The provider instance initialized by Dominion.
  • Constructor Details

    • PlayerProvider

      public PlayerProvider()
  • Method Details

    • getInstance

      public static PlayerProvider getInstance()
      Gets the initialized provider instance.
      Returns:
      the provider, or null before Dominion initialization
    • getKnownPlayers

      @NotNull public abstract @NotNull List<PlayerDTO> getKnownPlayers()
      Gets all player records known to Dominion.
      Returns:
      known players, sorted by last known name
    • getAvailableGroupTitles

      @NotNull public abstract @NotNull List<GroupDTO> getAvailableGroupTitles(@NotNull @NotNull UUID player)
      Gets group titles available to a player.

      This includes titles granted through memberships and titles from the player's own dominions.

      Parameters:
      player - the player's UUID
      Returns:
      available group titles, sorted by plain group name
    • setGroupTitle

      public abstract CompletableFuture<PlayerDTO> setGroupTitle(@NotNull @NotNull org.bukkit.entity.Player operator, @Nullable @Nullable GroupDTO group)
      Selects or clears the group title displayed for the operator. Passing null clears the currently selected title.
      Parameters:
      operator - the player selecting the title
      group - the title to select, or null to clear it
      Returns:
      a future that completes with the updated player record, or null if the title cannot be selected