Package konquest.api

Interface KonquestAPI


public interface KonquestAPI
The Konquest API. This is the primary means of accessing Konquest objects and methods. Most of the methods are helpers. Use the manager classes to interact with specific portions of Konquest.
Author:
Rumsfield
  • Method Details

    • getFriendlyPrimaryColor

      org.bukkit.ChatColor getFriendlyPrimaryColor()
      Gets the friendly primary color, from core.yml.
      Returns:
      The friendly primary color
    • getEnemyPrimaryColor

      org.bukkit.ChatColor getEnemyPrimaryColor()
      Gets the enemy primary color, from core.yml.
      Returns:
      The enemy primary color
    • getArmisticePrimaryColor

      org.bukkit.ChatColor getArmisticePrimaryColor()
      Gets the armistice primary color, from core.yml.
      Returns:
      The armistice primary color
    • getFriendlySecondaryColor

      org.bukkit.ChatColor getFriendlySecondaryColor()
      Gets the friendly secondary color, from core.yml.
      Returns:
      The friendly secondary color
    • getEnemySecondaryColor

      org.bukkit.ChatColor getEnemySecondaryColor()
      Gets the enemy secondary color, from core.yml.
      Returns:
      The enemy secondary color
    • getArmisticeSecondaryColor

      org.bukkit.ChatColor getArmisticeSecondaryColor()
      Gets the armistice secondary color, from core.yml.
      Returns:
      The armistice secondary color
    • getBarbarianColor

      org.bukkit.ChatColor getBarbarianColor()
      Gets the barbarian color, from core.yml.
      Returns:
      The barbarian color
    • getNeutralColor

      org.bukkit.ChatColor getNeutralColor()
      Gets the neutral color, from core.yml.
      Returns:
      The neutral color
    • getScoreboard

      org.bukkit.scoreboard.Scoreboard getScoreboard()
      Gets the primary Konquest scoreboard with teams.
      Returns:
      The primary scoreboard
    • validateNameConstraints

      int validateNameConstraints(String name)
      Checks for name conflicts and constraints against all Konquest names.
      Parameters:
      name - The name of an object (town, ruin, etc)
      Returns:
      Status code
      0 - Success, no issue found
      1 - Error, name is not strictly alpha-numeric
      2 - Error, name has more than 20 characters
      3 - Error, name is an existing player
      4 - Error, name is a kingdom
      5 - Error, name is a town
      6 - Error, name is a ruin
      7 - Error, name is a guild
    • getPlayerManager

      KonquestPlayerManager getPlayerManager()
      Gets the player manager, for all things player related.
      Returns:
      The player manager
    • getKingdomManager

      KonquestKingdomManager getKingdomManager()
      Gets the kingdom manager, for all things kingdom/town related.
      Returns:
      The kingdom manager
    • getCampManager

      KonquestCampManager getCampManager()
      Gets the camp manager, for all things camp related.
      Returns:
      The camp manager
    • getUpgradeManager

      KonquestUpgradeManager getUpgradeManager()
      Gets the upgrade manager, for all things town upgrade related.
      Returns:
      The upgrade manager
    • getShieldManager

      KonquestShieldManager getShieldManager()
      Gets the shield manager, for all things town shield and armor related.
      Returns:
      The shield manager
    • getRuinManager

      KonquestRuinManager getRuinManager()
      Gets the ruin manager, for all things ruin related.
      Returns:
      The ruin manager
    • getPlotManager

      KonquestPlotManager getPlotManager()
      Gets the plot manager, for all things town plot related.
      Returns:
      The ruin manager
    • getGuildManager

      KonquestGuildManager getGuildManager()
      Gets the guild manager, for all things guild related.
      Returns:
      The guild manager
    • isWorldValid

      boolean isWorldValid(org.bukkit.Location loc)
      Checks if a location is in a valid world. Invalid worlds prevent some Konquest commands.
      Parameters:
      loc - A location
      Returns:
      True if the location is in a valid world, else false
    • isWorldValid

      boolean isWorldValid(org.bukkit.World world)
      Checks if a world is valid. Invalid worlds prevent some Konquest commands.
      Parameters:
      world - A world
      Returns:
      True if the world is valid, else false
    • isWorldIgnored

      boolean isWorldIgnored(org.bukkit.Location loc)
      Checks if a location is in an ignored world. Ignored worlds prevent most Konquest commands and features.
      Parameters:
      loc - A location
      Returns:
      True if the location is in an ignored world, else false
    • isWorldIgnored

      boolean isWorldIgnored(org.bukkit.World world)
      Checks if a world is ignored. Ignored worlds prevent most Konquest commands and features.
      Parameters:
      world - A world
      Returns:
      True if the world is ignored, else false
    • getRandomWildLocation

      org.bukkit.Location getRandomWildLocation(org.bukkit.World world)
      Gets a random location in the wild, constrained by radius and offset in Konquest's configuration.
      Parameters:
      world - The world to generate the random location
      Returns:
      A random location in the wild
    • getSafeRandomCenteredLocation

      org.bukkit.Location getSafeRandomCenteredLocation(org.bukkit.Location center, int radius)
      Gets a random safe location in a surrounding chunk to the given center location. A safe location is one that should not kill the player. The resulting location will not be in the same chunk as the center location.
      Parameters:
      center - The location to center the new location around
      radius - The distance in blocks from the center to search for a random location
      Returns:
      The safe random location
    • getDisplayPrimaryColor

      org.bukkit.ChatColor getDisplayPrimaryColor(KonquestOfflinePlayer displayPlayer, KonquestOfflinePlayer contextPlayer)
      Gets the primary display color based on relationships. This color is set in the Konquest configuration. There is a color for each relationship: friendly, enemy, armistice, barbarian
      Parameters:
      displayPlayer - The observing player who should see the color
      contextPlayer - The target player who's relationship to the observer determines the color
      Returns:
      The primary display color
    • getDisplayPrimaryColor

      org.bukkit.ChatColor getDisplayPrimaryColor(KonquestGuild displayGuild, KonquestGuild contextGuild)
      Gets the primary display color based on relationships. This color is set in the Konquest configuration. There is a color for each relationship: friendly, enemy, armistice
      Parameters:
      displayGuild - The observing guild who should see the color
      contextGuild - The target guild who's relationship to the observer determines the color
      Returns:
      The primary display color
    • getDisplayPrimaryColor

      org.bukkit.ChatColor getDisplayPrimaryColor(KonquestOfflinePlayer displayPlayer, KonquestTerritory contextTerritory)
      Gets the primary display color based on relationships. This color is set in the Konquest configuration. There is a color for each relationship: friendly, enemy, armistice
      Parameters:
      displayPlayer - The observing player who should see the color
      contextTerritory - The target town who's relationship to the observer determines the color
      Returns:
      The primary display color
    • getDisplaySecondaryColor

      org.bukkit.ChatColor getDisplaySecondaryColor(KonquestOfflinePlayer displayPlayer, KonquestOfflinePlayer contextPlayer)
      Gets the secondary display color based on relationships. This color is set in the Konquest configuration. There is a color for each relationship: friendly, enemy, armistice, barbarian
      Parameters:
      displayPlayer - The observing player who should see the color
      contextPlayer - The target player who's relationship to the observer determines the color
      Returns:
      The secondary display color
    • getDisplaySecondaryColor

      org.bukkit.ChatColor getDisplaySecondaryColor(KonquestGuild displayGuild, KonquestGuild contextGuild)
      Gets the secondary display color based on relationships. This color is set in the Konquest configuration. There is a color for each relationship: friendly, enemy, armistice
      Parameters:
      displayGuild - The observing guild who should see the color
      contextGuild - The target guild who's relationship to the observer determines the color
      Returns:
      The secondary display color
    • getDisplaySecondaryColor

      org.bukkit.ChatColor getDisplaySecondaryColor(KonquestOfflinePlayer displayPlayer, KonquestTerritory contextTerritory)
      Gets the secondary display color based on relationships. This color is set in the Konquest configuration. There is a color for each relationship: friendly, enemy, armistice
      Parameters:
      displayPlayer - The observing player who should see the color
      contextTerritory - The target town who's relationship to the observer determines the color
      Returns:
      The secondary display color
    • getDisplayKingdomColor

      org.bukkit.ChatColor getDisplayKingdomColor(KonquestKingdom displayKingdom, KonquestKingdom contextKingdom)
      Gets the kingdom display color based on relationships. This color is set in the Konquest configuration. There is a color for each relationship: friendly, enemy, barbarian, neutral
      Parameters:
      displayKingdom - The observing kingdom that should see the color
      contextKingdom - The target kingdom who's relationship to the observer determines the color
      Returns:
      The kingdom display color
    • toPoint

      static Point toPoint(org.bukkit.Location loc)
      Utility method to convert a location to a point representation of the chunk that contains the location. The point's "x" field is the chunk's X coordinate, and the point's "y" field is the chunk's Z coordinate. Note that the point does not preserve the World of the location, so keep track of that separately.
      Parameters:
      loc - The location to convert into a point
      Returns:
      A point representing the chunk containing the location