Package cn.lunadeer.dominion.providers
Class PlayerProvider
java.lang.Object
cn.lunadeer.dominion.providers.PlayerProvider
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 Summary
FieldsModifier and TypeFieldDescriptionprotected static PlayerProviderThe provider instance initialized by Dominion. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAvailableGroupTitles(@NotNull UUID player) Gets group titles available to a player.static PlayerProviderGets the initialized provider instance.Gets all player records known to Dominion.abstract CompletableFuture<PlayerDTO>setGroupTitle(@NotNull org.bukkit.entity.Player operator, @Nullable GroupDTO group) Selects or clears the group title displayed for the operator.
-
Field Details
-
instance
The provider instance initialized by Dominion.
-
-
Constructor Details
-
PlayerProvider
public PlayerProvider()
-
-
Method Details
-
getInstance
Gets the initialized provider instance.- Returns:
- the provider, or
nullbefore Dominion initialization
-
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. Passingnullclears the currently selected title.- Parameters:
operator- the player selecting the titlegroup- the title to select, ornullto clear it- Returns:
- a future that completes with the updated player record, or
nullif the title cannot be selected
-