Package sawfowl.regionguard.api.data
Interface Region
- All Superinterfaces:
org.spongepowered.api.data.persistence.DataSerializable
- All Known Implementing Classes:
RegionImpl
@ConfigSerializable
public interface Region
extends org.spongepowered.api.data.persistence.DataSerializable
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionAdding a child region.static Region.Builder
builder()
boolean
Checking if there are child regions in the region.boolean
containsFlag
(String flagName) Checking if a flag is set in the region.boolean
containsFlag
(Flags flagName) Checking if a flag is set in the region.copy()
Create a copy of the current region.static Region
createGlobal
(org.spongepowered.api.ResourceKey world) static Region
createGlobal
(org.spongepowered.api.ResourceKey world, Map<String, Set<FlagValue>> flags) static Region
createGlobal
(org.spongepowered.api.world.server.ServerWorld world) static Region
createGlobal
(org.spongepowered.api.world.server.ServerWorld world, Map<String, Set<FlagValue>> flags) boolean
equalsOwners
(Region region) Checking for matching region owners.<T extends AdditionalData>
Optional<T>getAdditionalData
(org.spongepowered.plugin.PluginContainer container, String dataName, Class<T> clazz) Getting additional data that is created by other plugins.
After getting the data, they must be converted to the desired type.
Exemple: YourDataClass yourDataClass = (YourDataClass) additionalData;Getting a copy of the entire collection of the region's supplementary data.Recursive search and making a list of all child regions.List<org.spongepowered.api.block.entity.BlockEntity>
Getting a list of block entities in the region.
This operation can work overload the server.List<org.spongepowered.api.block.BlockState>
Getting a list of blocks in the region.
This operation can work overload the server.getChild
(org.spongepowered.math.vector.Vector3i position) Searching for a child region.
If no region is found, it will return the current region.Getting a list of child regions.Getting a list of the chunk numbers that the region occupies.long
Get the region creation time in unix format.Getting the region cuboid.Recursive search and enumeration of flagValues with parameters from the current region to the oldest parent.List<org.spongepowered.api.entity.Entity>
Getting a list of entities in the region.
This list will not contain players.
This operation can work overload the server.Optional<net.kyori.adventure.text.Component>
getExitMessage
(Locale locale) Getting region exit message.
If the specified localization is not found, the default localization will be checked.
If no default localization is found, the first value found will be returned or an empty optional value if the list is empty.Getting a collection of localized messages reporting region exits.
The key is the localization tag.org.spongepowered.api.util.Tristate
getFlagResult
(String flag, String source, String target) Getting the value of the flag in the region.org.spongepowered.api.util.Tristate
getFlagResult
(Flags flag, String source, String target) Getting the value of the flag in the region.org.spongepowered.api.util.Tristate
getFlagResultWhithoutParrents
(String flag, String source, String target) Getting the value of the flag if there is one.org.spongepowered.api.util.Tristate
getFlagResultWhithoutParrents
(Flags flag, String source, String target) Getting the value of the flag if there is one.getFlags()
Recursively search and list flagValues from the current region to the oldest parent.getFlagValues
(String flagName) Getting the values of the flag in the region.getFlagValues
(Flags flagName) Getting the values of the flag in the region.Optional<net.kyori.adventure.text.Component>
getJoinMessage
(Locale locale) Getting region join message.
If the specified localization is not found, the default localization will be checked.
If no default localization is found, the first value found will be returned or an empty optional value if the list is empty.Getting a collection of localized messages reporting entry into a region..
The key is the localization tag.List<org.spongepowered.api.world.chunk.WorldChunk>
Getting a list of loaded chunks.
This operation can work overload the server.getMemberData
(UUID uuid) Getting the data of the region member.getMemberData
(org.spongepowered.api.entity.living.player.server.ServerPlayer player) Getting the data of the region member.Getting a collection of the region's members.net.kyori.adventure.text.Component
Getting the region name as kyori component.getNames()
Optional<org.spongepowered.api.entity.living.player.server.ServerPlayer>
getOwner()
Getting the player-owner of the region, if the owner of the region is a player and he is online.Getting the data of the region ownerGetting the name of the region owner.Getting the UUID of the region owner.Getting a parent region if it is available.getPlainName
(Locale locale) Getting the region name.List<org.spongepowered.api.entity.living.player.server.ServerPlayer>
Getting a list of players in the region.
This operation can work overload the server.Getting the primary parent region.Optional<org.spongepowered.api.world.schematic.Schematic>
getSchematic
(String schematicName, String altAuthor) Create a Schematic from the region.
This operation can work overload the server.int
Total number of members of the region.getTrustType
(UUID uuid) Gaining the trust of a player or entitygetTrustType
(org.spongepowered.api.entity.living.player.server.ServerPlayer player) Getting a player's type of trust.getType()
Getting the region type.Getting the UUID of a region.Optional<org.spongepowered.api.world.server.ServerWorld>
getWorld()
Getting the region world if it is loaded.org.spongepowered.api.ResourceKey
Getting the world key.boolean
isAdmin()
Check whether the region is an admin region.boolean
isArena()
Check if the region is an arena.boolean
Check if the region is basic.boolean
isCurrentTrustType
(UUID uuid, TrustTypes level) Checking the type of trust in the region.boolean
isCurrentTrustType
(org.spongepowered.api.entity.living.player.server.ServerPlayer player, TrustTypes level) Checking the type of trust in the region.boolean
isGlobal()
Check if the region is global.boolean
isIntersectsWith
(org.spongepowered.api.ResourceKey worldkey, org.spongepowered.math.vector.Vector3i vector3i) Checking whether the position belongs to the region.boolean
isIntersectsWith
(org.spongepowered.api.world.server.ServerWorld serverWorld, org.spongepowered.math.vector.Vector3i vector3i) Checking whether the position belongs to the region.boolean
isIntersectsWith
(org.spongepowered.math.vector.Vector3i vector3i) Checking whether the position belongs to the region.boolean
Check if the region is subdivision.boolean
Checking whether a entity is a member of a region.boolean
isTrusted
(org.spongepowered.api.entity.living.player.server.ServerPlayer player) Checking whether a player is a member of a region.boolean
putSchematic
(org.spongepowered.api.world.schematic.Schematic schematic, int heigt) Insert Schematic into the region.
This operation can work overload the server.boolean
putSchematic
(org.spongepowered.api.world.schematic.Schematic schematic, org.spongepowered.math.vector.Vector3i vector3i) Insert Schematic into the region.
This operation can work overload the server.boolean
regen
(boolean async, int delay) Territory regeneration in the region.removeAdditionalData
(org.spongepowered.plugin.PluginContainer container, String dataName) Deleting additional data created by another plugin.removeChild
(Region region) Removing a child region.removeFlag
(String flagName) Removing the flag from the region.removeFlag
(String flagName, String source, String target) Removing the flag from the region.removeFlag
(String flagName, FlagValue flagValue) Removing the flag from the region.removeFlag
(Flags flagName) Removing the flag from the region.removeFlag
(Flags flagName, String source, String target) Removing the flag from the region.removeFlag
(Flags flagName, FlagValue flagValue) Removing the flag from the region.removeTempFlag
(String flagName, String source, String target) Removing a temporary flag from a region.removeTempFlag
(Flags flagName, String source, String target) Removing a temporary flag from a region.<T extends AdditionalData>
RegionsetAdditionalData
(org.spongepowered.plugin.PluginContainer container, String dataName, T additionalData) Write additional data created by another plugin.setCuboid
(org.spongepowered.math.vector.Vector3i first, org.spongepowered.math.vector.Vector3i second, SelectorTypes selectorType) Setting new boundaries for the region.Setting new boundaries for the region.setExitMessage
(net.kyori.adventure.text.Component message, Locale locale) Setting region exit message.Setting the value of the flag.Setting the value of the flag.Setting the value of the flag.Setting the value of the flag.Set the values of a set of flags.setJoinMessage
(net.kyori.adventure.text.Component message, Locale locale) Setting region join message.Set region name.setOwner
(org.spongepowered.api.entity.living.player.server.ServerPlayer owner) Make the player the new owner of the region.setOwner
(org.spongepowered.api.profile.GameProfile owner) Make the player the new owner of the region.setParrent
(Region region) Specifying the parent region.boolean
setRegionType
(RegionTypes type) Changing the type of region.setTempFlag
(String flagName, boolean value, String source, String target) Setting the value of the flag.
The flag set via this method will not be saved to disk.setTempFlag
(Flags flagName, boolean value, String source, String target) Setting the value of the flag.
The flag set via this method will not be saved to disk.setTrustType
(UUID uuid, TrustTypes type) Adding a entity to a region.setTrustType
(org.spongepowered.api.entity.living.player.server.ServerPlayer player, TrustTypes type) Adding a player to a region.setTrustType
(org.spongepowered.api.profile.GameProfile player, TrustTypes type) Adding a player to a region.void
Removing a player or entity from a region.void
untrust
(org.spongepowered.api.entity.living.player.server.ServerPlayer player) Removing a player from a region.Methods inherited from interface org.spongepowered.api.data.persistence.DataSerializable
contentVersion, toContainer
-
Method Details
-
builder
-
createGlobal
-
createGlobal
-
createGlobal
-
createGlobal
-
getPlainName
Getting the region name.- Parameters:
locale
- - language to be checked
-
getName
Getting the region name as kyori component.- Parameters:
locale
- - language to be checked
-
setName
Set region name. -
getNames
-
getOwner
Optional<org.spongepowered.api.entity.living.player.server.ServerPlayer> getOwner()Getting the player-owner of the region, if the owner of the region is a player and he is online. -
getOwnerUUID
UUID getOwnerUUID()Getting the UUID of the region owner. -
getOwnerName
String getOwnerName()Getting the name of the region owner. -
setOwner
Make the player the new owner of the region.- Parameters:
owner
- - new owner
-
setOwner
Make the player the new owner of the region.- Parameters:
owner
- - new owner
-
setTrustType
Region setTrustType(org.spongepowered.api.entity.living.player.server.ServerPlayer player, TrustTypes type) Adding a player to a region.- Parameters:
player
- - addable playertype
- - assignable trust type
-
setTrustType
Adding a player to a region.- Parameters:
player
- - addable playertype
- - assignable trust type
-
setTrustType
Adding a entity to a region.- Parameters:
uuid
- - addable entitytype
- - assignable trust type
-
getOwnerData
MemberData getOwnerData()Getting the data of the region owner -
getMembers
List<MemberData> getMembers()Getting a collection of the region's members. -
getMemberData
Optional<MemberData> getMemberData(org.spongepowered.api.entity.living.player.server.ServerPlayer player) Getting the data of the region member.- Parameters:
player
- - checked player.
-
getMemberData
Getting the data of the region member.- Parameters:
uuid
- - checked player or entity.
-
getTotalMembers
int getTotalMembers()Total number of members of the region. -
isCurrentTrustType
boolean isCurrentTrustType(org.spongepowered.api.entity.living.player.server.ServerPlayer player, TrustTypes level) Checking the type of trust in the region.- Parameters:
player
- - checked playerlevel
- - checked trust type- Returns:
- true - if the player has the trust type specified in the check
false - if the player or entity does not have the type of trust specified in the check, or region is global, or region is admin
-
isCurrentTrustType
Checking the type of trust in the region.- Parameters:
uuid
- - player uuidlevel
- - checked trust type- Returns:
- true - if the player or entity has the trust type specified in the check
false - if the player or entity does not have the type of trust specified in the check, or region is global, or region is admin
-
getTrustType
Getting a player's type of trust.- Parameters:
player
- - checked player- Returns:
- the type without trust(TrustTypes.WITHOUT_TRUST) if the player is not a member of the region
-
getTrustType
Gaining the trust of a player or entity- Parameters:
uuid
- - checked entity- Returns:
- the type without trust(TrustTypes.WITHOUT_TRUST) if the entity is not a member of the region
-
untrust
void untrust(org.spongepowered.api.entity.living.player.server.ServerPlayer player) Removing a player from a region. -
untrust
Removing a player or entity from a region. -
isTrusted
boolean isTrusted(org.spongepowered.api.entity.living.player.server.ServerPlayer player) Checking whether a player is a member of a region.- Parameters:
player
- - checked player
-
isTrusted
Checking whether a entity is a member of a region.- Parameters:
uuid
- - checked entity
-
getUniqueId
UUID getUniqueId()Getting the UUID of a region. -
getWorld
Optional<org.spongepowered.api.world.server.ServerWorld> getWorld()Getting the region world if it is loaded. -
getWorldKey
org.spongepowered.api.ResourceKey getWorldKey()Getting the world key. -
getCuboid
Cuboid getCuboid()Getting the region cuboid. -
getType
RegionTypes getType()Getting the region type. -
setRegionType
Changing the type of region.
Depending on the specified type, some parameters may change.- Parameters:
type
- - assignable type
-
isGlobal
boolean isGlobal()Check if the region is global. -
isAdmin
boolean isAdmin()Check whether the region is an admin region. -
isArena
boolean isArena()Check if the region is an arena. -
isBasicClaim
boolean isBasicClaim()Check if the region is basic. -
isSubdivision
boolean isSubdivision()Check if the region is subdivision. -
setCuboid
Region setCuboid(org.spongepowered.math.vector.Vector3i first, org.spongepowered.math.vector.Vector3i second, SelectorTypes selectorType) Setting new boundaries for the region.- Parameters:
first
- - first positionsecond
- - second positionselectorType
- - type of area selection
-
setCuboid
Setting new boundaries for the region. -
getParrent
Getting a parent region if it is available. -
getPrimaryParent
Region getPrimaryParent()Getting the primary parent region.- Returns:
- the primary parent region if it exists, or the current region if the region has no parent
-
setParrent
Specifying the parent region. -
containsChilds
boolean containsChilds()Checking if there are child regions in the region. -
getChild
Searching for a child region.
If no region is found, it will return the current region. -
addChild
Adding a child region. -
removeChild
Removing a child region. -
getAllChilds
Recursive search and making a list of all child regions. -
getChilds
Getting a list of child regions. -
getFlags
Recursively search and list flagValues from the current region to the oldest parent. -
getCustomFlags
Recursive search and enumeration of flagValues with parameters from the current region to the oldest parent. -
getFlagValues
Getting the values of the flag in the region.
If there is no flag, an attempt will be made to check it in the parent region. -
getFlagValues
Getting the values of the flag in the region.
If there is no flag, an attempt will be made to check it in the parent region. -
containsFlag
Checking if a flag is set in the region. -
containsFlag
Checking if a flag is set in the region. -
getFlagResult
Getting the value of the flag in the region.
If there is no flag, an attempt will be made to check it in the parent region. -
getFlagResult
Getting the value of the flag in the region.
If there is no flag, an attempt will be made to check it in the parent region. -
getFlagResultWhithoutParrents
org.spongepowered.api.util.Tristate getFlagResultWhithoutParrents(Flags flag, String source, String target) Getting the value of the flag if there is one. -
getFlagResultWhithoutParrents
org.spongepowered.api.util.Tristate getFlagResultWhithoutParrents(String flag, String source, String target) Getting the value of the flag if there is one. -
setFlag
Setting the value of the flag. -
setFlag
Setting the value of the flag. -
setFlag
Setting the value of the flag. -
setFlag
Setting the value of the flag. -
setTempFlag
Setting the value of the flag.
The flag set via this method will not be saved to disk. -
setTempFlag
Setting the value of the flag.
The flag set via this method will not be saved to disk. -
setFlags
Set the values of a set of flags.- Parameters:
flags
- - Map with flags and their values.
-
removeFlag
Removing the flag from the region. -
removeFlag
Removing the flag from the region. -
removeFlag
Removing the flag from the region. -
removeFlag
Removing the flag from the region. -
removeTempFlag
Removing a temporary flag from a region. -
removeTempFlag
Removing a temporary flag from a region. -
removeFlag
Removing the flag from the region. -
removeFlag
Removing the flag from the region. -
getCreationTime
long getCreationTime()Get the region creation time in unix format. -
getJoinMessage
Getting region join message.
If the specified localization is not found, the default localization will be checked.
If no default localization is found, the first value found will be returned or an empty optional value if the list is empty.- Parameters:
locale
- - checking locale
-
setJoinMessage
Setting region join message.- Parameters:
message
- - setting messagelocale
- - setting locale
-
getJoinMessages
Getting a collection of localized messages reporting entry into a region..
The key is the localization tag. -
getExitMessage
Getting region exit message.
If the specified localization is not found, the default localization will be checked.
If no default localization is found, the first value found will be returned or an empty optional value if the list is empty.- Parameters:
locale
- - checking locale
-
setExitMessage
Setting region exit message.- Parameters:
message
- - setting messagelocale
- - setting locale
-
getExitMessages
Getting a collection of localized messages reporting region exits.
The key is the localization tag. -
getAdditionalData
<T extends AdditionalData> Optional<T> getAdditionalData(org.spongepowered.plugin.PluginContainer container, String dataName, Class<T> clazz) Getting additional data that is created by other plugins.
After getting the data, they must be converted to the desired type.
Exemple: YourDataClass yourDataClass = (YourDataClass) additionalData; -
setAdditionalData
<T extends AdditionalData> Region setAdditionalData(org.spongepowered.plugin.PluginContainer container, String dataName, T additionalData) Write additional data created by another plugin. -
removeAdditionalData
Deleting additional data created by another plugin. -
getAllAdditionalData
Getting a copy of the entire collection of the region's supplementary data. -
isIntersectsWith
boolean isIntersectsWith(org.spongepowered.api.world.server.ServerWorld serverWorld, org.spongepowered.math.vector.Vector3i vector3i) Checking whether the position belongs to the region.- Parameters:
serverWorld
- - checkable Worldvector3i
- - checkable position
-
isIntersectsWith
boolean isIntersectsWith(org.spongepowered.api.ResourceKey worldkey, org.spongepowered.math.vector.Vector3i vector3i) Checking whether the position belongs to the region.- Parameters:
worldkey
- - checkable Worldvector3i
- - checkable position
-
isIntersectsWith
boolean isIntersectsWith(org.spongepowered.math.vector.Vector3i vector3i) Checking whether the position belongs to the region. This method should only be applied to child regions, as it does not perform a world matching check.- Parameters:
vector3i
- - checkable position
-
getLoadedChunks
List<org.spongepowered.api.world.chunk.WorldChunk> getLoadedChunks()Getting a list of loaded chunks.
This operation can work overload the server. It is recommended to use in asynchronous mode. -
getBlocks
List<org.spongepowered.api.block.BlockState> getBlocks()Getting a list of blocks in the region.
This operation can work overload the server. It is recommended to use in asynchronous mode. -
getBlockEntities
List<org.spongepowered.api.block.entity.BlockEntity> getBlockEntities()Getting a list of block entities in the region.
This operation can work overload the server. It is recommended to use in asynchronous mode. -
getEntities
List<org.spongepowered.api.entity.Entity> getEntities()Getting a list of entities in the region.
This list will not contain players.
This operation can work overload the server. It is recommended to use in asynchronous mode. -
getPlayers
List<org.spongepowered.api.entity.living.player.server.ServerPlayer> getPlayers()Getting a list of players in the region.
This operation can work overload the server. It is recommended to use in asynchronous mode. -
getChunkNumbers
List<ChunkNumber> getChunkNumbers()Getting a list of the chunk numbers that the region occupies. -
getSchematic
Optional<org.spongepowered.api.world.schematic.Schematic> getSchematic(String schematicName, String altAuthor) Create a Schematic from the region.
This operation can work overload the server. It is recommended to use in asynchronous mode. -
putSchematic
boolean putSchematic(org.spongepowered.api.world.schematic.Schematic schematic, int heigt) Insert Schematic into the region.
This operation can work overload the server.- Parameters:
schematic
-heigt
- - the height at which the insertion will be made
-
putSchematic
boolean putSchematic(org.spongepowered.api.world.schematic.Schematic schematic, org.spongepowered.math.vector.Vector3i vector3i) Insert Schematic into the region.
This operation can work overload the server.- Parameters:
schematic
-vector3i
- - central position
-
regen
boolean regen(boolean async, int delay) Territory regeneration in the region.- Parameters:
async
- - regen in async modedelay
- - delay before regeneration in async mode
-
equalsOwners
Checking for matching region owners. -
copy
Region copy()Create a copy of the current region.
-