Interface IProtectionModule
public interface IProtectionModule
-
Method Summary
Modifier and TypeMethodDescriptionIFlagState
<?> getGlobalFlag
(@NotNull CommonFlags flag, @NotNull String world) Get the global flagIFlagState
<?> getGlobalFlag
(@NotNull String flag, @NotNull String world) Get the global flag@NotNull String
Get the name of the corresponding plugin@Nullable ProtectionRangeInfo
getProtectionRangeInfo
(@NotNull org.bukkit.Location location) Get the protection range info of the locationdefault @Nullable ProtectionRangeInfo
getProtectionRangeInfo
(@NotNull org.bukkit.entity.Player player) Get the protection range info of the player's locationList
<? extends ProtectionRangeInfo> getProtectionRangeInfos
(@NotNull org.bukkit.OfflinePlayer player) Get all protection range info that the player ownsboolean
isInProtectionRange
(@NotNull org.bukkit.Location location) Check if the location is in the protection rangedefault boolean
isInProtectionRange
(@NotNull org.bukkit.entity.Player player) Check if the player is in the protection rangeboolean
Whether the module supports global flagsvoid
setGlobalFlag
(@NotNull String world, @NotNull CommonFlags flag, Object value) Set the global flagvoid
setGlobalFlag
(@NotNull String world, @NotNull String flag, Object value) Set the global flag
-
Method Details
-
getPluginName
Get the name of the corresponding plugin- Returns:
- the name of the corresponding plugin
-
isInProtectionRange
default boolean isInProtectionRange(@NotNull @NotNull org.bukkit.entity.Player player) Check if the player is in the protection range- Parameters:
player
- the player- Returns:
- true if the player is in the protection range
-
getProtectionRangeInfo
@Nullable default @Nullable ProtectionRangeInfo getProtectionRangeInfo(@NotNull @NotNull org.bukkit.entity.Player player) Get the protection range info of the player's location- Parameters:
player
- the player- Returns:
- the protection range info
-
getProtectionRangeInfos
List<? extends ProtectionRangeInfo> getProtectionRangeInfos(@NotNull @NotNull org.bukkit.OfflinePlayer player) Get all protection range info that the player owns- Parameters:
player
- the player- Returns:
- the protection range info
-
isInProtectionRange
boolean isInProtectionRange(@NotNull @NotNull org.bukkit.Location location) Check if the location is in the protection range- Parameters:
location
- the location- Returns:
- true if the location is in the protection range
-
getProtectionRangeInfo
@Nullable @Nullable ProtectionRangeInfo getProtectionRangeInfo(@NotNull @NotNull org.bukkit.Location location) Get the protection range info of the location- Parameters:
location
- the location- Returns:
- the protection range info (if the location is not in the protection range, return null)
-
isSupportGlobalFlags
boolean isSupportGlobalFlags()Whether the module supports global flags- Returns:
- true if the module supports global flags
-
getGlobalFlag
Get the global flag- Parameters:
flag
- the flagworld
- the world- Returns:
- the global flag
- Throws:
UnsupportedOperationException
- if the module does not support global flags
-
getGlobalFlag
Get the global flag- Parameters:
flag
- the flagworld
- the world- Returns:
- the global flag
- Throws:
UnsupportedOperationException
- if the module does not support global flags
-
setGlobalFlag
Set the global flag- Parameters:
flag
- the flag- Throws:
UnsupportedOperationException
- if the module does not support global flags
-
setGlobalFlag
void setGlobalFlag(@NotNull @NotNull String world, @NotNull @NotNull CommonFlags flag, Object value) Set the global flag- Parameters:
world
- the worldflag
- the flag- Throws:
UnsupportedOperationException
- if the module does not support global flags
-