Class RegionImpl

java.lang.Object
sawfowl.regionguard.implementsapi.data.RegionImpl
All Implemented Interfaces:
org.spongepowered.api.data.persistence.DataSerializable, Region

public class RegionImpl extends Object implements Region
  • Constructor Details

    • RegionImpl

      public RegionImpl()
  • Method Details

    • builder

      public Region.Builder builder()
    • getPlainName

      public Optional<String> getPlainName(Locale locale)
      Description copied from interface: Region
      Getting the region name.
      Specified by:
      getPlainName in interface Region
      Parameters:
      locale - - language to be checked
    • getName

      public net.kyori.adventure.text.Component getName(Locale locale)
      Description copied from interface: Region
      Getting the region name as kyori component.
      Specified by:
      getName in interface Region
      Parameters:
      locale - - language to be checked
    • setName

      public Region setName(net.kyori.adventure.text.Component name, Locale locale)
      Description copied from interface: Region
      Set region name.
      Specified by:
      setName in interface Region
    • getNames

      public Map<String,net.kyori.adventure.text.Component> getNames()
      Specified by:
      getNames in interface Region
    • getOwner

      public Optional<org.spongepowered.api.entity.living.player.server.ServerPlayer> getOwner()
      Description copied from interface: Region
      Getting the player-owner of the region, if the owner of the region is a player and he is online.
      Specified by:
      getOwner in interface Region
    • getOwnerUUID

      public UUID getOwnerUUID()
      Description copied from interface: Region
      Getting the UUID of the region owner.
      Specified by:
      getOwnerUUID in interface Region
    • getOwnerName

      public String getOwnerName()
      Description copied from interface: Region
      Getting the name of the region owner.
      Specified by:
      getOwnerName in interface Region
    • setOwner

      public Region setOwner(org.spongepowered.api.entity.living.player.server.ServerPlayer owner)
      Description copied from interface: Region
      Make the player the new owner of the region.
      Specified by:
      setOwner in interface Region
      Parameters:
      owner - - new owner
    • setOwner

      public Region setOwner(org.spongepowered.api.profile.GameProfile owner)
      Description copied from interface: Region
      Make the player the new owner of the region.
      Specified by:
      setOwner in interface Region
      Parameters:
      owner - - new owner
    • setTrustType

      public Region setTrustType(org.spongepowered.api.entity.living.player.server.ServerPlayer player, TrustTypes type)
      Description copied from interface: Region
      Adding a player to a region.
      Specified by:
      setTrustType in interface Region
      Parameters:
      player - - addable player
      type - - assignable trust type
    • setTrustType

      public Region setTrustType(org.spongepowered.api.profile.GameProfile player, TrustTypes type)
      Description copied from interface: Region
      Adding a player to a region.
      Specified by:
      setTrustType in interface Region
      Parameters:
      player - - addable player
      type - - assignable trust type
    • setTrustType

      public Region setTrustType(UUID uuid, TrustTypes type)
      Description copied from interface: Region
      Adding a entity to a region.
      Specified by:
      setTrustType in interface Region
      Parameters:
      uuid - - addable entity
      type - - assignable trust type
    • getOwnerData

      public MemberData getOwnerData()
      Description copied from interface: Region
      Getting the data of the region owner
      Specified by:
      getOwnerData in interface Region
    • getMembers

      public List<MemberData> getMembers()
      Description copied from interface: Region
      Getting a collection of the region's members.
      Specified by:
      getMembers in interface Region
    • getMemberData

      public Optional<MemberData> getMemberData(org.spongepowered.api.entity.living.player.server.ServerPlayer player)
      Description copied from interface: Region
      Getting the data of the region member.
      Specified by:
      getMemberData in interface Region
      Parameters:
      player - - checked player.
    • getMemberData

      public Optional<MemberData> getMemberData(UUID uuid)
      Description copied from interface: Region
      Getting the data of the region member.
      Specified by:
      getMemberData in interface Region
      Parameters:
      uuid - - checked player or entity.
    • getTotalMembers

      public int getTotalMembers()
      Description copied from interface: Region
      Total number of members of the region.
      Specified by:
      getTotalMembers in interface Region
    • isCurrentTrustType

      public boolean isCurrentTrustType(org.spongepowered.api.entity.living.player.server.ServerPlayer player, TrustTypes level)
      Description copied from interface: Region
      Checking the type of trust in the region.
      Specified by:
      isCurrentTrustType in interface Region
      Parameters:
      player - - checked player
      level - - 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

      public boolean isCurrentTrustType(UUID uuid, TrustTypes level)
      Description copied from interface: Region
      Checking the type of trust in the region.
      Specified by:
      isCurrentTrustType in interface Region
      Parameters:
      uuid - - player uuid
      level - - 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

      public TrustTypes getTrustType(org.spongepowered.api.entity.living.player.server.ServerPlayer player)
      Description copied from interface: Region
      Getting a player's type of trust.
      Specified by:
      getTrustType in interface Region
      Parameters:
      player - - checked player
      Returns:
      the type without trust(TrustTypes.WITHOUT_TRUST) if the player is not a member of the region
    • getTrustType

      public TrustTypes getTrustType(UUID uuid)
      Description copied from interface: Region
      Gaining the trust of a player or entity
      Specified by:
      getTrustType in interface Region
      Parameters:
      uuid - - checked entity
      Returns:
      the type without trust(TrustTypes.WITHOUT_TRUST) if the entity is not a member of the region
    • untrust

      public void untrust(org.spongepowered.api.entity.living.player.server.ServerPlayer player)
      Description copied from interface: Region
      Removing a player from a region.
      Specified by:
      untrust in interface Region
    • untrust

      public void untrust(UUID uuid)
      Description copied from interface: Region
      Removing a player or entity from a region.
      Specified by:
      untrust in interface Region
    • isTrusted

      public boolean isTrusted(org.spongepowered.api.entity.living.player.server.ServerPlayer player)
      Description copied from interface: Region
      Checking whether a player is a member of a region.
      Specified by:
      isTrusted in interface Region
      Parameters:
      player - - checked player
    • isTrusted

      public boolean isTrusted(UUID uuid)
      Description copied from interface: Region
      Checking whether a entity is a member of a region.
      Specified by:
      isTrusted in interface Region
      Parameters:
      uuid - - checked entity
    • getUniqueId

      public UUID getUniqueId()
      Description copied from interface: Region
      Getting the UUID of a region.
      Specified by:
      getUniqueId in interface Region
    • getWorld

      public Optional<org.spongepowered.api.world.server.ServerWorld> getWorld()
      Description copied from interface: Region
      Getting the region world if it is loaded.
      Specified by:
      getWorld in interface Region
    • getWorldKey

      public org.spongepowered.api.ResourceKey getWorldKey()
      Description copied from interface: Region
      Getting the world key.
      Specified by:
      getWorldKey in interface Region
    • getCuboid

      public Cuboid getCuboid()
      Description copied from interface: Region
      Getting the region cuboid.
      Specified by:
      getCuboid in interface Region
    • getType

      public RegionTypes getType()
      Description copied from interface: Region
      Getting the region type.
      Specified by:
      getType in interface Region
    • setRegionType

      public boolean setRegionType(RegionTypes type)
      Description copied from interface: Region
      Changing the type of region.
      Depending on the specified type, some parameters may change.
      Specified by:
      setRegionType in interface Region
      Parameters:
      type - - assignable type
    • isGlobal

      public boolean isGlobal()
      Description copied from interface: Region
      Check if the region is global.
      Specified by:
      isGlobal in interface Region
    • isAdmin

      public boolean isAdmin()
      Description copied from interface: Region
      Check whether the region is an admin region.
      Specified by:
      isAdmin in interface Region
    • isArena

      public boolean isArena()
      Description copied from interface: Region
      Check if the region is an arena.
      Specified by:
      isArena in interface Region
    • isBasicClaim

      public boolean isBasicClaim()
      Description copied from interface: Region
      Check if the region is basic.
      Specified by:
      isBasicClaim in interface Region
    • isSubdivision

      public boolean isSubdivision()
      Description copied from interface: Region
      Check if the region is subdivision.
      Specified by:
      isSubdivision in interface Region
    • setCuboid

      public Region setCuboid(org.spongepowered.math.vector.Vector3i first, org.spongepowered.math.vector.Vector3i second, SelectorTypes selectorType)
      Description copied from interface: Region
      Setting new boundaries for the region.
      Specified by:
      setCuboid in interface Region
      Parameters:
      first - - first position
      second - - second position
      selectorType - - type of area selection
    • setCuboid

      public Region setCuboid(Cuboid cuboid)
      Description copied from interface: Region
      Setting new boundaries for the region.
      Specified by:
      setCuboid in interface Region
    • getParrent

      public Optional<Region> getParrent()
      Description copied from interface: Region
      Getting a parent region if it is available.
      Specified by:
      getParrent in interface Region
    • getPrimaryParent

      public Region getPrimaryParent()
      Description copied from interface: Region
      Getting the primary parent region.
      Specified by:
      getPrimaryParent in interface Region
      Returns:
      the primary parent region if it exists, or the current region if the region has no parent
    • setParrent

      public Region setParrent(Region region)
      Description copied from interface: Region
      Specifying the parent region.
      Specified by:
      setParrent in interface Region
    • containsChilds

      public boolean containsChilds()
      Description copied from interface: Region
      Checking if there are child regions in the region.
      Specified by:
      containsChilds in interface Region
    • getChild

      public Region getChild(org.spongepowered.math.vector.Vector3i position)
      Description copied from interface: Region
      Searching for a child region.
      If no region is found, it will return the current region.
      Specified by:
      getChild in interface Region
    • addChild

      public Region addChild(Region region)
      Description copied from interface: Region
      Adding a child region.
      Specified by:
      addChild in interface Region
    • removeChild

      public Region removeChild(Region region)
      Description copied from interface: Region
      Removing a child region.
      Specified by:
      removeChild in interface Region
    • getAllChilds

      public List<Region> getAllChilds()
      Description copied from interface: Region
      Recursive search and making a list of all child regions.
      Specified by:
      getAllChilds in interface Region
    • getChilds

      public List<Region> getChilds()
      Description copied from interface: Region
      Getting a list of child regions.
      Specified by:
      getChilds in interface Region
    • getFlags

      public Map<String,Set<FlagValue>> getFlags()
      Description copied from interface: Region
      Recursively search and list flagValues from the current region to the oldest parent.
      Specified by:
      getFlags in interface Region
    • getCustomFlags

      public Map<String,Set<FlagValue>> getCustomFlags()
      Description copied from interface: Region
      Recursive search and enumeration of flagValues with parameters from the current region to the oldest parent.
      Specified by:
      getCustomFlags in interface Region
    • getFlagValues

      public Set<FlagValue> getFlagValues(Flags flagName)
      Description copied from interface: Region
      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.
      Specified by:
      getFlagValues in interface Region
    • getFlagValues

      public Set<FlagValue> getFlagValues(String flagName)
      Description copied from interface: Region
      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.
      Specified by:
      getFlagValues in interface Region
    • containsFlag

      public boolean containsFlag(Flags flagName)
      Description copied from interface: Region
      Checking if a flag is set in the region.
      Specified by:
      containsFlag in interface Region
    • containsFlag

      public boolean containsFlag(String flagName)
      Description copied from interface: Region
      Checking if a flag is set in the region.
      Specified by:
      containsFlag in interface Region
    • getFlagResult

      public org.spongepowered.api.util.Tristate getFlagResult(Flags flag, String source, String target)
      Description copied from interface: Region
      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.
      Specified by:
      getFlagResult in interface Region
    • getFlagResult

      public org.spongepowered.api.util.Tristate getFlagResult(String flag, String source, String target)
      Description copied from interface: Region
      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.
      Specified by:
      getFlagResult in interface Region
    • getFlagResultWhithoutParrents

      public org.spongepowered.api.util.Tristate getFlagResultWhithoutParrents(Flags flag, String source, String target)
      Description copied from interface: Region
      Getting the value of the flag if there is one.
      Specified by:
      getFlagResultWhithoutParrents in interface Region
    • getFlagResultWhithoutParrents

      public org.spongepowered.api.util.Tristate getFlagResultWhithoutParrents(String flag, String source, String target)
      Description copied from interface: Region
      Getting the value of the flag if there is one.
      Specified by:
      getFlagResultWhithoutParrents in interface Region
    • setFlag

      public Region setFlag(Flags flagName, boolean value)
      Description copied from interface: Region
      Setting the value of the flag.
      Specified by:
      setFlag in interface Region
    • setFlag

      public Region setFlag(String flagName, boolean value)
      Description copied from interface: Region
      Setting the value of the flag.
      Specified by:
      setFlag in interface Region
    • setFlag

      public Region setFlag(Flags flagName, boolean value, String source, String target)
      Description copied from interface: Region
      Setting the value of the flag.
      Specified by:
      setFlag in interface Region
    • setTempFlag

      public Region setTempFlag(Flags flagName, boolean value, String source, String target)
      Description copied from interface: Region
      Setting the value of the flag.
      The flag set via this method will not be saved to disk.
      Specified by:
      setTempFlag in interface Region
    • setTempFlag

      public Region setTempFlag(String flagName, boolean value, String source, String target)
      Description copied from interface: Region
      Setting the value of the flag.
      The flag set via this method will not be saved to disk.
      Specified by:
      setTempFlag in interface Region
    • setFlag

      public Region setFlag(String flagName, boolean value, String source, String target)
      Description copied from interface: Region
      Setting the value of the flag.
      Specified by:
      setFlag in interface Region
    • setFlags

      public RegionImpl setFlags(Map<String,Set<FlagValue>> flags)
      Description copied from interface: Region
      Set the values of a set of flags.
      Specified by:
      setFlags in interface Region
      Parameters:
      flags - - Map with flags and their values.
    • removeFlag

      public Region removeFlag(Flags flagName)
      Description copied from interface: Region
      Removing the flag from the region.
      Specified by:
      removeFlag in interface Region
    • removeFlag

      public Region removeFlag(String flagName)
      Description copied from interface: Region
      Removing the flag from the region.
      Specified by:
      removeFlag in interface Region
    • removeFlag

      public Region removeFlag(Flags flagName, String source, String target)
      Description copied from interface: Region
      Removing the flag from the region.
      Specified by:
      removeFlag in interface Region
    • removeFlag

      public Region removeFlag(String flagName, String source, String target)
      Description copied from interface: Region
      Removing the flag from the region.
      Specified by:
      removeFlag in interface Region
    • removeTempFlag

      public Region removeTempFlag(Flags flagName, String source, String target)
      Description copied from interface: Region
      Removing a temporary flag from a region.
      Specified by:
      removeTempFlag in interface Region
    • removeTempFlag

      public Region removeTempFlag(String flagName, String source, String target)
      Description copied from interface: Region
      Removing a temporary flag from a region.
      Specified by:
      removeTempFlag in interface Region
    • removeFlag

      public Region removeFlag(Flags flagName, FlagValue flagValue)
      Description copied from interface: Region
      Removing the flag from the region.
      Specified by:
      removeFlag in interface Region
    • removeFlag

      public Region removeFlag(String flagName, FlagValue flagValue)
      Description copied from interface: Region
      Removing the flag from the region.
      Specified by:
      removeFlag in interface Region
    • getCreationTime

      public long getCreationTime()
      Description copied from interface: Region
      Get the region creation time in unix format.
      Specified by:
      getCreationTime in interface Region
    • getJoinMessage

      public Optional<net.kyori.adventure.text.Component> getJoinMessage(Locale locale)
      Description copied from interface: Region
      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.
      Specified by:
      getJoinMessage in interface Region
      Parameters:
      locale - - checking locale
    • setJoinMessage

      public Region setJoinMessage(net.kyori.adventure.text.Component message, Locale locale)
      Description copied from interface: Region
      Setting region join message.
      Specified by:
      setJoinMessage in interface Region
      Parameters:
      message - - setting message
      locale - - setting locale
    • getJoinMessages

      public Map<String,net.kyori.adventure.text.Component> getJoinMessages()
      Description copied from interface: Region
      Getting a collection of localized messages reporting entry into a region..
      The key is the localization tag.
      Specified by:
      getJoinMessages in interface Region
    • getExitMessage

      public Optional<net.kyori.adventure.text.Component> getExitMessage(Locale locale)
      Description copied from interface: Region
      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.
      Specified by:
      getExitMessage in interface Region
      Parameters:
      locale - - checking locale
    • setExitMessage

      public Region setExitMessage(net.kyori.adventure.text.Component message, Locale locale)
      Description copied from interface: Region
      Setting region exit message.
      Specified by:
      setExitMessage in interface Region
      Parameters:
      message - - setting message
      locale - - setting locale
    • getExitMessages

      public Map<String,net.kyori.adventure.text.Component> getExitMessages()
      Description copied from interface: Region
      Getting a collection of localized messages reporting region exits.
      The key is the localization tag.
      Specified by:
      getExitMessages in interface Region
    • getAdditionalData

      public <T extends AdditionalData> Optional<T> getAdditionalData(org.spongepowered.plugin.PluginContainer container, String dataName, Class<T> clazz)
      Description copied from interface: Region
      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;
      Specified by:
      getAdditionalData in interface Region
    • setAdditionalData

      public <T extends AdditionalData> Region setAdditionalData(org.spongepowered.plugin.PluginContainer container, String dataName, T additionalData)
      Description copied from interface: Region
      Write additional data created by another plugin.
      Specified by:
      setAdditionalData in interface Region
    • removeAdditionalData

      public Region removeAdditionalData(org.spongepowered.plugin.PluginContainer container, String dataName)
      Description copied from interface: Region
      Deleting additional data created by another plugin.
      Specified by:
      removeAdditionalData in interface Region
    • getAllAdditionalData

      public Map<String,Map<String,com.google.gson.JsonObject>> getAllAdditionalData()
      Description copied from interface: Region
      Getting a copy of the entire collection of the region's supplementary data.
      Specified by:
      getAllAdditionalData in interface Region
    • isIntersectsWith

      public boolean isIntersectsWith(org.spongepowered.api.world.server.ServerWorld serverWorld, org.spongepowered.math.vector.Vector3i vector3i)
      Description copied from interface: Region
      Checking whether the position belongs to the region.
      Specified by:
      isIntersectsWith in interface Region
      Parameters:
      serverWorld - - checkable World
      vector3i - - checkable position
    • isIntersectsWith

      public boolean isIntersectsWith(org.spongepowered.api.ResourceKey worldkey, org.spongepowered.math.vector.Vector3i vector3i)
      Description copied from interface: Region
      Checking whether the position belongs to the region.
      Specified by:
      isIntersectsWith in interface Region
      Parameters:
      worldkey - - checkable World
      vector3i - - checkable position
    • isIntersectsWith

      public boolean isIntersectsWith(org.spongepowered.math.vector.Vector3i vector3i)
      Description copied from interface: Region
      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.
      Specified by:
      isIntersectsWith in interface Region
      Parameters:
      vector3i - - checkable position
    • getLoadedChunks

      public List<org.spongepowered.api.world.chunk.WorldChunk> getLoadedChunks()
      Description copied from interface: Region
      Getting a list of loaded chunks.
      This operation can work overload the server. It is recommended to use in asynchronous mode.
      Specified by:
      getLoadedChunks in interface Region
    • getBlocks

      public List<org.spongepowered.api.block.BlockState> getBlocks()
      Description copied from interface: Region
      Getting a list of blocks in the region.
      This operation can work overload the server. It is recommended to use in asynchronous mode.
      Specified by:
      getBlocks in interface Region
    • getBlockEntities

      public List<org.spongepowered.api.block.entity.BlockEntity> getBlockEntities()
      Description copied from interface: Region
      Getting a list of block entities in the region.
      This operation can work overload the server. It is recommended to use in asynchronous mode.
      Specified by:
      getBlockEntities in interface Region
    • getEntities

      public List<org.spongepowered.api.entity.Entity> getEntities()
      Description copied from interface: Region
      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.
      Specified by:
      getEntities in interface Region
    • getPlayers

      public List<org.spongepowered.api.entity.living.player.server.ServerPlayer> getPlayers()
      Description copied from interface: Region
      Getting a list of players in the region.
      This operation can work overload the server. It is recommended to use in asynchronous mode.
      Specified by:
      getPlayers in interface Region
    • getChunkNumbers

      public List<ChunkNumber> getChunkNumbers()
      Description copied from interface: Region
      Getting a list of the chunk numbers that the region occupies.
      Specified by:
      getChunkNumbers in interface Region
    • getSchematic

      public Optional<org.spongepowered.api.world.schematic.Schematic> getSchematic(String schematicName, String altAuthor)
      Description copied from interface: Region
      Create a Schematic from the region.
      This operation can work overload the server. It is recommended to use in asynchronous mode.
      Specified by:
      getSchematic in interface Region
    • putSchematic

      public boolean putSchematic(org.spongepowered.api.world.schematic.Schematic schematic, int heigt)
      Description copied from interface: Region
      Insert Schematic into the region.

      This operation can work overload the server.
      Specified by:
      putSchematic in interface Region
      heigt - - the height at which the insertion will be made
    • putSchematic

      public boolean putSchematic(org.spongepowered.api.world.schematic.Schematic schematic, org.spongepowered.math.vector.Vector3i vector3i)
      Description copied from interface: Region
      Insert Schematic into the region.

      This operation can work overload the server.
      Specified by:
      putSchematic in interface Region
      vector3i - - central position
    • regen

      public boolean regen(boolean async, int delay)
      Description copied from interface: Region
      Territory regeneration in the region.
      Specified by:
      regen in interface Region
      Parameters:
      async - - regen in async mode
      delay - - delay before regeneration in async mode
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsOwners

      public boolean equalsOwners(Region region)
      Description copied from interface: Region
      Checking for matching region owners.
      Specified by:
      equalsOwners in interface Region
    • copy

      public Region copy()
      Description copied from interface: Region
      Create a copy of the current region.
      Specified by:
      copy in interface Region
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • contentVersion

      public int contentVersion()
      Specified by:
      contentVersion in interface org.spongepowered.api.data.persistence.DataSerializable
    • toContainer

      public org.spongepowered.api.data.persistence.DataContainer toContainer()
      Specified by:
      toContainer in interface org.spongepowered.api.data.persistence.DataSerializable