Class MemberProvider
Members are players who have been granted specific access permissions to a dominion. Each member can have individual privilege flags that determine what actions they can perform within the dominion. Members can also be part of groups, inheriting additional privileges from their group membership.
These methods are controlled by the Dominion system, including permission,
validation, cache, and event processing. A returned future normally completes
with the updated DTO and completes with null when the operation is
cancelled or fails.
The operator parameter of each method defines who triggers the operation. If the operator is a specific player,
these methods will check permissions accordingly. For no-permission-required operations, you can pass
the console command sender Bukkit.getConsoleSender().
- Since:
- 4.6.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static MemberProviderThe provider instance initialized by Dominion. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract CompletableFuture<MemberDTO>addMember(@NotNull org.bukkit.command.CommandSender operator, @NotNull DominionDTO dominion, @NotNull PlayerDTO player) Adds a new member to the specified dominion.static MemberProviderGets the singleton instance of the MemberProvider.abstract CompletableFuture<MemberDTO>removeMember(@NotNull org.bukkit.command.CommandSender operator, @NotNull DominionDTO dominion, @NotNull MemberDTO member) Removes an existing member from the specified dominion.abstract CompletableFuture<MemberDTO>setMemberFlag(@NotNull org.bukkit.command.CommandSender operator, @NotNull DominionDTO dominion, @NotNull MemberDTO member, @NotNull PriFlag flag, boolean newValue) Sets a privilege flag for a specific member within a dominion.
-
Field Details
-
instance
The provider instance initialized by Dominion.
-
-
Constructor Details
-
MemberProvider
public MemberProvider()
-
-
Method Details
-
getInstance
Gets the singleton instance of the MemberProvider.- Returns:
- the current MemberProvider instance, or null if not initialized
-
setMemberFlag
public abstract CompletableFuture<MemberDTO> setMemberFlag(@NotNull @NotNull org.bukkit.command.CommandSender operator, @NotNull @NotNull DominionDTO dominion, @NotNull @NotNull MemberDTO member, @NotNull @NotNull PriFlag flag, boolean newValue) Sets a privilege flag for a specific member within a dominion. Member flags control what actions this individual member can perform within the dominion, independent of any group memberships.- Parameters:
operator- the command sender performing this operation (for permission checks and logging)dominion- the dominion containing the membermember- the member whose flag will be updatedflag- the specific privilege flag to modifynewValue- the new value for the flag (true to allow, false to deny)- Returns:
- a future that completes with the updated member, or
nullif the operation is cancelled or fails
-
addMember
public abstract CompletableFuture<MemberDTO> addMember(@NotNull @NotNull org.bukkit.command.CommandSender operator, @NotNull @NotNull DominionDTO dominion, @NotNull @NotNull PlayerDTO player) Adds a new member to the specified dominion. The player will be granted basic access to the dominion and can then be assigned specific privileges or added to groups.- Parameters:
operator- the command sender performing this operation (for permission checks and logging)dominion- the dominion where the player will be added as a memberplayer- the player to be added as a member to the dominion- Returns:
- a future that completes with the created member, or
nullif the operation is cancelled or fails
-
removeMember
public abstract CompletableFuture<MemberDTO> removeMember(@NotNull @NotNull org.bukkit.command.CommandSender operator, @NotNull @NotNull DominionDTO dominion, @NotNull @NotNull MemberDTO member) Removes an existing member from the specified dominion. The member will lose all individual privileges and group memberships within this dominion. This action is irreversible.- Parameters:
operator- the command sender performing this operation (for permission checks and logging)dominion- the dominion from which the member will be removedmember- the member to be removed from the dominion- Returns:
- a future that completes with the removed member, or
nullif the operation is cancelled or fails
-