类 DominionAPI
This interface provides methods to interact with the Dominion plugin.
Use the getInstance() method to retrieve the singleton instance of the DominionAPI.
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明abstract booleancheckEnvironmentFlag(@NotNull org.bukkit.Location location, @NotNull EnvFlag flag) Checks if the specified environment flag is set at the given location.abstract booleancheckPrivilegeFlag(@NotNull org.bukkit.Location location, @NotNull PriFlag flag, @NotNull org.bukkit.entity.Player player) Checks if a player has a specific privilege flag at the given location.abstract booleancheckPrivilegeFlagSilence(@NotNull org.bukkit.Location location, @NotNull PriFlag flag, @NotNull org.bukkit.entity.Player player) Checks if a player has a specific privilege flag at the given location without triggering messages or events.abstract IntegerRetrieves the total count of dominions.abstract List<DominionDTO>Retrieves all DominionDTO objects.abstract List<DominionDTO>getChildrenDominionOf(DominionDTO parent) Retrieves the child dominions of a given parent dominion.abstract @Nullable DominionDTOgetDominion(Integer id) Retrieves a DominionDTO by its ID.abstract @Nullable DominionDTOgetDominion(String name) Retrieves a DominionDTO by its name.abstract @Nullable DominionDTOgetDominion(org.bukkit.Location location) Retrieves a DominionDTO by its location.abstract @Nullable GroupDTORetrieves a GroupDTO by the member's group ID.abstract @Nullable GroupDTORetrieves a GroupDTO by its ID.static DominionAPIRetrieves the singleton instance of the DominionAPI.abstract @Nullable MemberDTOgetMember(@Nullable DominionDTO dominion, @NotNull UUID player) Retrieves a MemberDTO by the player's UUID.abstract @Nullable MemberDTOgetMember(@Nullable DominionDTO dominion, @NotNull org.bukkit.entity.Player player) Retrieves a MemberDTO by the player's UUID.abstract @Nullable PlayerDTORetrieves a PlayerDTO by the player's UUID.abstract @Nullable PlayerDTORetrieves a PlayerDTO by the player's name.abstract List<DominionDTO>getPlayerAdminDominionDTOs(UUID player) Retrieves the dominions where a player is an admin.abstract @Nullable DominionDTOgetPlayerCurrentDominion(@NotNull org.bukkit.entity.Player player) Retrieves the current dominion of a player.abstract @NotNull StringgetPlayerName(@NotNull UUID uuid) Retrieves the name of a player by their UUID.abstract List<DominionDTO>getPlayerOwnDominionDTOs(UUID player) Retrieves the dominions owned by a player.abstract IntegerRetrieves the total count of groups.abstract IntegerRetrieves the total count of members.abstract voidresetPlayerCurrentDominionId(@NotNull org.bukkit.entity.Player player) Resets the current dominion ID for a player.
-
字段详细资料
-
instance
-
-
构造器详细资料
-
DominionAPI
public DominionAPI()
-
-
方法详细资料
-
getInstance
Retrieves the singleton instance of the DominionAPI. This method checks if the Dominion plugin is enabled and if the version is compatible. If these checks pass, it retrieves the instance of the DominionAPI from the DominionInterface class.- 返回:
- the singleton instance of the DominionAPI
-
getPlayer
Retrieves a PlayerDTO by the player's name.- 参数:
name- the name of the player- 返回:
- the PlayerDTO associated with the given name, or null if not found
-
getPlayer
Retrieves a PlayerDTO by the player's UUID.- 参数:
player- the UUID of the player- 返回:
- the PlayerDTO associated with the given UUID, or null if not found
-
getPlayerName
Retrieves the name of a player by their UUID.- 参数:
uuid- the UUID of the player- 返回:
- the name of the player associated with the given UUID
-
getAllDominions
Retrieves all DominionDTO objects.This method retrieves all dominions from the cache of this server. If multi-servers mode is enabled, it also retrieves dominions from the caches of other servers.
- 返回:
- a list of all DominionDTO objects
-
getChildrenDominionOf
Retrieves the child dominions of a given parent dominion.This method retrieves the child dominions of the specified parent dominion from the cache of this server. If multi-servers mode is enabled, it also retrieves child dominions from the caches of other servers.
- 参数:
parent- the parent DominionDTO whose children are to be retrieved- 返回:
- a list of child DominionDTO objects
-
getDominion
Retrieves a DominionDTO by its ID.This method will first attempt to retrieve the DominionDTO from the cache of this server. If the DominionDTO is not found, it will then attempt to retrieve the DominionDTO from the caches of other servers.
- 参数:
id- the ID of the dominion to retrieve- 返回:
- the DominionDTO associated with the given ID
-
getDominion
Retrieves a DominionDTO by its name.This method will first attempt to retrieve the DominionDTO from the cache of this server. If the DominionDTO is not found, it will then attempt to retrieve the DominionDTO from the caches of other servers.
- 参数:
name- the name of the dominion to retrieve- 返回:
- the DominionDTO associated with the given name
-
getDominion
Retrieves a DominionDTO by its location.This method retrieves the DominionDTO associated with the given location from the cache of this server.
- 参数:
location- the location to retrieve the dominion for- 返回:
- the DominionDTO associated with the given location, or null if not found
-
getPlayerOwnDominionDTOs
Retrieves the dominions owned by a player.This method retrieves the dominions owned by the player from the cache of this server. If multi-servers mode is enabled, it also retrieves the dominions owned by the player from the caches of other servers.
- 参数:
player- the UUID of the player- 返回:
- a list of DominionDTO objects representing the dominions owned by the player
-
getPlayerAdminDominionDTOs
Retrieves the dominions where a player is an admin.This method retrieves the dominions where the player is an admin from the cache of this server. If multi-servers mode is enabled, it also retrieves the dominions where the player is an admin from the caches of other servers.
- 参数:
player- the UUID of the player- 返回:
- a list of DominionDTO objects representing the dominions where the player is an admin
-
getMember
@Nullable public abstract @Nullable MemberDTO getMember(@Nullable @Nullable DominionDTO dominion, @NotNull @NotNull org.bukkit.entity.Player player) Retrieves a MemberDTO by the player's UUID.This method retrieves the MemberDTO associated with the given player from the specified dominion.
- 参数:
dominion- the DominionDTO to retrieve the member fromplayer- the Player object representing the player- 返回:
- the MemberDTO associated with the given player, or null if not found
-
getMember
@Nullable public abstract @Nullable MemberDTO getMember(@Nullable @Nullable DominionDTO dominion, @NotNull @NotNull UUID player) Retrieves a MemberDTO by the player's UUID.This method retrieves the MemberDTO associated with the given player from the specified dominion. If the member is not found in the cache of this server, it will attempt to retrieve the member from the caches of other servers if multi-servers mode is enabled.
- 参数:
dominion- the DominionDTO to retrieve the member fromplayer- the UUID of the player- 返回:
- the MemberDTO associated with the given player, or null if not found
-
getGroup
Retrieves a GroupDTO by the member's group ID.This method retrieves the GroupDTO associated with the group ID of the given member.
- 参数:
member- the MemberDTO whose group ID is to be used for retrieval- 返回:
- the GroupDTO associated with the given member's group ID, or null if not found
-
getGroup
Retrieves a GroupDTO by its ID.This method retrieves the GroupDTO associated with the given ID from the cache of this server. If the GroupDTO is not found, it will then attempt to retrieve the GroupDTO from the caches of other servers if multi-servers mode is enabled.
- 参数:
id- the ID of the group to retrieve- 返回:
- the GroupDTO associated with the given ID, or null if not found
-
getPlayerCurrentDominion
@Nullable public abstract @Nullable DominionDTO getPlayerCurrentDominion(@NotNull @NotNull org.bukkit.entity.Player player) Retrieves the current dominion of a player.This method retrieves the current dominion of the player based on their location. It checks if the player is still in the same dominion and if the dominion has no children. If the player has moved to a different dominion, it triggers the appropriate events and updates the player's current dominion ID.
- 参数:
player- the Player object representing the player- 返回:
- the DominionDTO associated with the player's current location, or null if not found
-
resetPlayerCurrentDominionId
public abstract void resetPlayerCurrentDominionId(@NotNull @NotNull org.bukkit.entity.Player player) Resets the current dominion ID for a player.This method removes the current dominion ID associated with the player from the cache.
- 参数:
player- the Player object representing the player
-
dominionCount
Retrieves the total count of dominions.This method calculates the total number of dominions by summing the count of dominions on this server and, if multi-servers mode is enabled, the counts from other servers.
- 返回:
- the total count of dominions
-
groupCount
Retrieves the total count of groups.This method calculates the total number of groups by summing the count of groups on this server and, if multi-servers mode is enabled, the counts from other servers.
- 返回:
- the total count of groups
-
memberCount
Retrieves the total count of members.This method calculates the total number of members by summing the count of members on this server and, if multi-servers mode is enabled, the counts from other servers.
- 返回:
- the total count of members
-
checkPrivilegeFlag
public abstract boolean checkPrivilegeFlag(@NotNull @NotNull org.bukkit.Location location, @NotNull @NotNull PriFlag flag, @NotNull @NotNull org.bukkit.entity.Player player) Checks if a player has a specific privilege flag at the given location.This method verifies whether the player has permission for the specified privilege flag at the given location, considering the dominion (if any) that covers the location. If the player lacks the required privilege, appropriate messages or events may be triggered.
- 参数:
location- the location to check the privilege flag atflag- the privilege flag to checkplayer- the player whose privileges are being checked- 返回:
- true if the player has the privilege flag at the location, false otherwise
-
checkPrivilegeFlagSilence
public abstract boolean checkPrivilegeFlagSilence(@NotNull @NotNull org.bukkit.Location location, @NotNull @NotNull PriFlag flag, @NotNull @NotNull org.bukkit.entity.Player player) Checks if a player has a specific privilege flag at the given location without triggering messages or events.This method performs the same privilege check as
checkPrivilegeFlag(Location, PriFlag, Player)but operates silently, without sending any messages to the player or triggering related events. This is useful for internal checks where user feedback is not desired.- 参数:
location- the location to check the privilege flag atflag- the privilege flag to checkplayer- the player whose privileges are being checked- 返回:
- true if the player has the privilege flag at the location, false otherwise
-
checkEnvironmentFlag
public abstract boolean checkEnvironmentFlag(@NotNull @NotNull org.bukkit.Location location, @NotNull @NotNull EnvFlag flag) Checks if the specified environment flag is set at the given location.This method determines whether the provided environment flag is enabled at the specified location, considering the dominion (if any) that covers the location.
- 参数:
location- the location to check for the environment flagflag- the environment flag to check- 返回:
- true if the environment flag is set at the location, false otherwise
-