Interface KonquestShieldManager


public interface KonquestShieldManager
A manager for town shields and armor in Konquest.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    armorAdd(KonquestTown town, int value)
    Adds to a town's armor in blocks, positive or negative.
    boolean
    armorSet(KonquestTown town, int value)
    Sets a town's armor amount in blocks.
    int
    Gets the amount of armor blocks the town currently has.
    int
    Gets the time in seconds at which the town's shields will expire.
    boolean
    Checks whether armors are enabled from the Konquest configuration.
    boolean
    Checks whether shields are enabled from the Konquest configuration.
    boolean
    shieldAdd(KonquestTown town, int value)
    Adds to a town's shields in seconds, positive or negative.
    boolean
    shieldSet(KonquestTown town, int value)
    Sets a town's shields to expire a number of seconds from now.
  • Method Details

    • isShieldsEnabled

      boolean isShieldsEnabled()
      Checks whether shields are enabled from the Konquest configuration.
      Returns:
      True when shields are enabled, else false
    • isArmorsEnabled

      boolean isArmorsEnabled()
      Checks whether armors are enabled from the Konquest configuration.
      Returns:
      True when armors are enabled, else false
    • shieldSet

      boolean shieldSet(KonquestTown town, int value)
      Sets a town's shields to expire a number of seconds from now. When value is less than or equal to 0, the town's shields are deactivated. When the town already has shields deactivated, and value is less than or equal to zero, this method returns false.
      Parameters:
      town - The town to modify shields
      value - Time in seconds from now to end shields
      Returns:
      True when shields were successfully set, else false
    • shieldAdd

      boolean shieldAdd(KonquestTown town, int value)
      Adds to a town's shields in seconds, positive or negative. When the result of the addition is less than or equal to zero, the shields are disabled. When the town already has shields deactivated, and value is negative, this method returns false.
      Parameters:
      town - The town to modify shields
      value - Time in seconds to add to shields
      Returns:
      True when the shields were successfully added, else false
    • armorSet

      boolean armorSet(KonquestTown town, int value)
      Sets a town's armor amount in blocks. When value is less than or equal to 0, the town's armor is deactivated. When the town already has armor deactivated, and value is less than or equal to zero, this method returns false.
      Parameters:
      town - The town to modify armor
      value - Amount of armor
      Returns:
      True when armor was successfully set, else false
    • armorAdd

      boolean armorAdd(KonquestTown town, int value)
      Adds to a town's armor in blocks, positive or negative. When the result of the addition is less than or equal to zero, the armor is disabled. When the town already has armor deactivated, and value is negative, this method returns false.
      Parameters:
      town - The town to modify armor
      value - Amount of armor to add
      Returns:
      True when the armor was successfully added, else false
    • getTownShieldTime

      int getTownShieldTime(KonquestTown town)
      Gets the time in seconds at which the town's shields will expire. The resulting time is the number of seconds since the Unix epoch. The Unix epoch is 00:00:00 UTC on 1 January 1970.
      Parameters:
      town - The town
      Returns:
      The time in seconds when shields expire
    • getTownArmorBlocks

      int getTownArmorBlocks(KonquestTown town)
      Gets the amount of armor blocks the town currently has.
      Parameters:
      town - The town
      Returns:
      The amount of armor blocks