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 Summary
Modifier and TypeMethodDescriptionorg.bukkit.ChatColorGets the armistice primary color, from core.yml.org.bukkit.ChatColorGets the armistice secondary color, from core.yml.org.bukkit.ChatColorGets the barbarian color, from core.yml.Gets the camp manager, for all things camp related.org.bukkit.ChatColorgetDisplayKingdomColor(KonquestKingdom displayKingdom, KonquestKingdom contextKingdom) Gets the kingdom display color based on relationships.org.bukkit.ChatColorgetDisplayPrimaryColor(KonquestGuild displayGuild, KonquestGuild contextGuild) Gets the primary display color based on relationships.org.bukkit.ChatColorgetDisplayPrimaryColor(KonquestOfflinePlayer displayPlayer, KonquestOfflinePlayer contextPlayer) Gets the primary display color based on relationships.org.bukkit.ChatColorgetDisplayPrimaryColor(KonquestOfflinePlayer displayPlayer, KonquestTerritory contextTerritory) Gets the primary display color based on relationships.org.bukkit.ChatColorgetDisplaySecondaryColor(KonquestGuild displayGuild, KonquestGuild contextGuild) Gets the secondary display color based on relationships.org.bukkit.ChatColorgetDisplaySecondaryColor(KonquestOfflinePlayer displayPlayer, KonquestOfflinePlayer contextPlayer) Gets the secondary display color based on relationships.org.bukkit.ChatColorgetDisplaySecondaryColor(KonquestOfflinePlayer displayPlayer, KonquestTerritory contextTerritory) Gets the secondary display color based on relationships.org.bukkit.ChatColorGets the enemy primary color, from core.yml.org.bukkit.ChatColorGets the enemy secondary color, from core.yml.org.bukkit.ChatColorGets the friendly primary color, from core.yml.org.bukkit.ChatColorGets the friendly secondary color, from core.yml.Gets the guild manager, for all things guild related.Gets the kingdom manager, for all things kingdom/town related.org.bukkit.ChatColorGets the neutral color, from core.yml.Gets the player manager, for all things player related.Gets the plot manager, for all things town plot related.org.bukkit.LocationgetRandomWildLocation(org.bukkit.World world) Gets a random location in the wild, constrained by radius and offset in Konquest's configuration.Gets the ruin manager, for all things ruin related.org.bukkit.LocationgetSafeRandomCenteredLocation(org.bukkit.Location center, int radius) Gets a random safe location in a surrounding chunk to the given center location.org.bukkit.scoreboard.ScoreboardGets the primary Konquest scoreboard with teams.Gets the shield manager, for all things town shield and armor related.Gets the upgrade manager, for all things town upgrade related.booleanisWorldIgnored(org.bukkit.Location loc) Checks if a location is in an ignored world.booleanisWorldIgnored(org.bukkit.World world) Checks if a world is ignored.booleanisWorldValid(org.bukkit.Location loc) Checks if a location is in a valid world.booleanisWorldValid(org.bukkit.World world) Checks if a world is valid.static PointtoPoint(org.bukkit.Location loc) Utility method to convert a location to a point representation of the chunk that contains the location.intChecks for name conflicts and constraints against all Konquest names.
-
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
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 aroundradius- 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 colorcontextPlayer- The target player who's relationship to the observer determines the color- Returns:
- The primary display color
-
getDisplayPrimaryColor
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 colorcontextGuild- 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 colorcontextTerritory- 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 colorcontextPlayer- 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 colorcontextGuild- 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 colorcontextTerritory- 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 colorcontextKingdom- The target kingdom who's relationship to the observer determines the color- Returns:
- The kingdom display color
-
toPoint
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
-