Package konquest.api.manager
Interface KonquestGuildManager
public interface KonquestGuildManager
A manager for guilds in Konquest.
- Author:
- Rumsfield
-
Method Summary
Modifier and TypeMethodDescriptionGets a list of all guild names.List<? extends KonquestGuild>Gets all guilds.List<? extends KonquestGuild>getEnemyGuilds(KonquestKingdom kingdom) Gets all guilds which are not in the given kingdom.Gets the guild instance by the given name.List<? extends KonquestGuild>getKingdomGuilds(KonquestKingdom kingdom) Gets all guilds which are in the same kingdom as the given kingdom.getPlayerGuild(org.bukkit.OfflinePlayer player) Gets the guild of the given player.getTownGuild(KonquestTown town) Gets the guild of the given town.booleanisArmistice(KonquestGuild guild1, KonquestGuild guild2) Checks whether the two guilds are in an armistice.booleanisArmistice(KonquestOfflinePlayer player1, KonquestOfflinePlayer player2) Checks whether the two players' guilds are in an armistice.booleanisArmistice(KonquestOfflinePlayer player1, KonquestTown town2) Checks whether the player's guild is in an armistice with the town.booleanChecks whether guild trade discounts are enabled from the Konquest configuration.booleanChecks whether guilds are enabled from the Konquest configuration.booleanChecks if the given name matches a guild.
-
Method Details
-
isEnabled
boolean isEnabled()Checks whether guilds are enabled from the Konquest configuration.- Returns:
- True when guilds are enabled, else false
-
isDiscountEnable
boolean isDiscountEnable()Checks whether guild trade discounts are enabled from the Konquest configuration.- Returns:
- True when guild trade discounts are enabled, else false
-
isGuild
Checks if the given name matches a guild.- Parameters:
name- The guild name- Returns:
- True if the name matches a guild instance
-
getGuild
Gets the guild instance by the given name. Returns null when no guild matches the name.- Parameters:
name- The guild name- Returns:
- The guild instance, or null when name not found
-
getAllGuildNames
Gets a list of all guild names. This is a convenience method.- Returns:
- The list of guild names
-
getAllGuilds
List<? extends KonquestGuild> getAllGuilds()Gets all guilds.- Returns:
- The list of all guilds
-
getEnemyGuilds
Gets all guilds which are not in the given kingdom.- Parameters:
kingdom- The kingdom to search for enemy guilds- Returns:
- The list of enemy guilds
-
getKingdomGuilds
Gets all guilds which are in the same kingdom as the given kingdom.- Parameters:
kingdom- The kingdom to search for friendly guilds- Returns:
- The list of friendly guilds
-
getTownGuild
Gets the guild of the given town. Returns null when the town has no guild. A town's guild is determined by the guild of the town lord.- Parameters:
town- The town to check- Returns:
- The guild instance of the town, or null if the town has no guild
-
getPlayerGuild
Gets the guild of the given player. Returns null when the player has no guild.- Parameters:
player- The player to check- Returns:
- The guild instance of the player, or null if the player has no guild
-
isArmistice
Checks whether the two guilds are in an armistice. Guilds in an armistice cannot attack each other. Only enemy guilds can be in an armistice.- Parameters:
guild1- The first guildguild2- The second guild, must be an enemy of the first- Returns:
- True when both guilds are in an armistice, else false
-
isArmistice
Checks whether the two players' guilds are in an armistice. Guilds in an armistice cannot attack each other. Only enemy guilds can be in an armistice.- Parameters:
player1- The first playerplayer2- The second player, must be an enemy of the first- Returns:
- True when both players' guilds are in an armistice, else false
-
isArmistice
Checks whether the player's guild is in an armistice with the town. A town's guild is determined by the guild of the town lord. Guilds in an armistice cannot attack each other. Only enemy guilds can be in an armistice.- Parameters:
player1- The playertown2- The town, must be an enemy of the player- Returns:
- True when the player's guild and the town's guild are in an armistice, else false
-