Interface KonquestTown

All Superinterfaces:
KonquestTerritory
All Known Subinterfaces:
KonquestCapital

public interface KonquestTown extends KonquestTerritory
A town is a collection of land and has residents, plots and a monument.
  • Method Details

    • isLocInsideCenterChunk

      boolean isLocInsideCenterChunk(org.bukkit.Location loc)
      Checks whether the given location is inside of this town's center chunk (the town monument).
      Parameters:
      loc - The location to check
      Returns:
      True when the location is inside the center chunk, else false
    • getMonument

      KonquestMonument getMonument()
      Gets the monument instance of this town.
      Returns:
      The monument
    • isCaptureDisabled

      boolean isCaptureDisabled()
      Checks whether capturing this town is disabled. When a town is captured by an enemy, capturing is disabled temporarily.
      Returns:
      True when capturing is disabled, else false
    • isAttacked

      boolean isAttacked()
      Checks whether this town is under attack. A town is attacked when an enemy breaks any blocks within town land. Towns eventually return to normal after the last enemy block break.
      Returns:
      True when the town is attacked, else false
    • isOpen

      boolean isOpen()
      Checks whether the town is open. Kingdom members can join open towns without needing an invite.
      Returns:
      True when the town is open, else false
    • isEnemyRedstoneAllowed

      boolean isEnemyRedstoneAllowed()
      Checks whether the town option for allowing enemies to use redstone is enabled. When true, enemies will be able to use switches, buttons, doors, etc.
      Returns:
      True when enemies are allowed to use redstone, else false
    • isPlotOnly

      boolean isPlotOnly()
      Checks whether the town option for allowing residents to only build on plots is enabled.
      Returns:
      True when residents may only build on plots they own, else false
    • isLord

      boolean isLord(UUID id)
      Checks whether the given UUID is the town lord.
      Parameters:
      id - The UUID to check
      Returns:
      True when the UUID is the town lord, else false
    • isPlayerLord

      boolean isPlayerLord(org.bukkit.OfflinePlayer player)
      Checks whether the given player is the town lord.
      Parameters:
      player - The player to check
      Returns:
      True when the player is the town lord, else false
    • isPlayerKnight

      boolean isPlayerKnight(org.bukkit.OfflinePlayer player)
      Checks whether the given player is a town knight. The town lord is also considered a town knight.
      Parameters:
      player - The player to check
      Returns:
      True when the player is a town knight or the town lord, else false
    • isPlayerResident

      boolean isPlayerResident(org.bukkit.OfflinePlayer player)
      Checks whether the given player is a town resident. The town lord and town knights are considered residents.
      Parameters:
      player - The player to check
      Returns:
      True when the player is a normal resident, town knight or the town lord, else false
    • isLordValid

      boolean isLordValid()
      Checks whether the town lord is valid. Towns may have no town lord, in which case this method will return false.
      Returns:
      True when there is a valid town lord, else false
    • getPlayerLord

      org.bukkit.OfflinePlayer getPlayerLord()
      Gets the town lord player. Returns null when there is an invalid town lord.
      Returns:
      The town lord player, or null
    • getLord

      UUID getLord()
      Gets the UUID of the town lord. Returns null if there is no town lord.
      Returns:
      The UUID of the town lord, or null
    • getPlayerKnights

      ArrayList<org.bukkit.OfflinePlayer> getPlayerKnights()
      Gets the list of all town knights, including the town lord.
      Returns:
      The list of players
    • getPlayerResidents

      ArrayList<org.bukkit.OfflinePlayer> getPlayerResidents()
      Gets the list of all town residents, including town knights and the town lord.
      Returns:
      The list of players
    • hasUpgrade

      boolean hasUpgrade(KonquestUpgrade upgrade)
      Checks whether this town has the given upgrade. Any upgrade level above 0 will result in this method returning true. An upgrade level of 0 means it is disabled, and this will return false.
      Parameters:
      upgrade - The upgrade to check
      Returns:
      True if this town has the upgrade enabled, else false
    • isUpgradeDisabled

      boolean isUpgradeDisabled(KonquestUpgrade upgrade)
      Checks whether this town has the given upgrade, but it's disabled. A town that has an upgrade, but then lacks the population requirements, will have that upgrade disabled.
      Parameters:
      upgrade - The upgrade to check
      Returns:
      True if the upgrade is disabled, else false
    • isTownWatchProtected

      boolean isTownWatchProtected()
      Checks whether the town is protected by the Town Watch upgrade. A protected town cannot be attacked by enemies.
      Returns:
      True when the town is protected, else false
    • isShielded

      boolean isShielded()
      Checks whether the town has active shields.
      Returns:
      True when the town has active shields, else false
    • isArmored

      boolean isArmored()
      Checks whether the town has active armor.
      Returns:
      True when the town has active armor, else false
    • hasPlot

      boolean hasPlot(org.bukkit.Location loc)
      Checks whether the town has a plot at the given location. Town plots can use multiple chunks and can permit only their members to build in them.
      Parameters:
      loc - The location to check
      Returns:
      True when there is a plot at the location, else false
    • getPlot

      KonquestPlot getPlot(org.bukkit.Location loc)
      Gets the town plot at the given location. Returns null if no plot exists.
      Parameters:
      loc - The location to get the plot
      Returns:
      The town plot, or null when none exists
    • getPlots

      List<? extends KonquestPlot> getPlots()
      Gets all town plots in this town.
      Returns:
      The list of plots
    • getSpecialization

      org.bukkit.entity.Villager.Profession getSpecialization()
      Gets the town villager profession specialization. Villagers inside of this town with the resulting profession may give trade discounts.
      Returns:
      The villager profession