Interface KonquestTerritoryManager


public interface KonquestTerritoryManager
A manager for land and general territories in Konquest.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    claimChunk(org.bukkit.Location loc, boolean force)
    Claims the chunk at the given location for the nearest adjacent territory.
    getChunkTerritory(org.bukkit.Location loc)
    Gets the territory at the given location.
    int
    getDistanceToClosestTerritory(org.bukkit.Location loc)
    Finds the distance in chunks (16 blocks) from the given location to the nearest territory.
    boolean
    isChunkClaimed(org.bukkit.Location loc)
    Checks whether the chunk at the given location is claimed by a territory.
    int
    unclaimChunk(org.bukkit.Location loc, boolean force)
    Unclaims the chunk at the given location from its associated territory.
  • Method Details

    • claimChunk

      int claimChunk(org.bukkit.Location loc, boolean force)
      Claims the chunk at the given location for the nearest adjacent territory. Adds the chunk to the chunk map of the territory. The territory is chosen by finding the closest territory center location to the given location.
      Parameters:
      loc - The location to claim
      force - Ignore checks
      Returns:
      Status code
      0 - success
      1 - error, no adjacent territory
      2 - error, exceeds max distance
      3 - error, already claimed
      4 - error, cancelled by event
      5 - error, blocked by property flag
    • unclaimChunk

      int unclaimChunk(org.bukkit.Location loc, boolean force)
      Unclaims the chunk at the given location from its associated territory. Removes the chunk from the chunk map of the territory.
      Parameters:
      loc - The location to unclaim
      force - Ignore checks
      Returns:
      Status code
      0 - success
      1 - error, no territory at location
      2 - error, location in center chunk
      3 - error, internal territory chunk not found
      4 - error, cancelled by event
      5 - error, blocked by property flag
    • isChunkClaimed

      boolean isChunkClaimed(org.bukkit.Location loc)
      Checks whether the chunk at the given location is claimed by a territory.
      Parameters:
      loc - The location to check
      Returns:
      True when the location is inside of claimed territory, else false
    • getChunkTerritory

      KonquestTerritory getChunkTerritory(org.bukkit.Location loc)
      Gets the territory at the given location. If no territory exists, returns null.
      Parameters:
      loc - The location to request the territory
      Returns:
      The territory at the given location, or null if no territory exists
    • getDistanceToClosestTerritory

      int getDistanceToClosestTerritory(org.bukkit.Location loc)
      Finds the distance in chunks (16 blocks) from the given location to the nearest territory. Checks kingdom capitals, towns, and ruins. Does not include camps.
      Parameters:
      loc - The location to search
      Returns:
      The distance in chunks to the nearest territory, or Integer.MAX_VALUE if not found