GuildHandler

open class GuildHandler(source)

Constructors

Link copied to clipboard
open fun GuildHandler(guildsPlugin: Guilds, settingsManager: SettingsManager)

Functions

Link copied to clipboard
open fun addAlly(guild: Guild, targetGuild: Guild)
Adds an ally to both guilds
Link copied to clipboard
open fun addGuild(@NotNull guild: @NotNull Guild)
Adds the specified [guild] to the list of guilds.
Link copied to clipboard
open fun addGuildPerms(permission: Permission, player: OfflinePlayer)
Add guild perms to a specific player
Link copied to clipboard
open fun addGuildPermsToAll(permission: Permission, guild: Guild)
Add all guild permissions to all players in the guild
Link copied to clipboard
open fun addPendingAlly(guild: Guild, targetGuild: Guild)
Adds a pending ally
Link copied to clipboard
open fun addPerms(permission: Permission, offlinePlayer: OfflinePlayer, nodes: List<String>)
Adds a set of permissions to a player
Link copied to clipboard
open fun addRolePerm(permission: Permission, player: OfflinePlayer)
Adds a role perm to a player
Link copied to clipboard
open fun blacklistCheck(name: String, settingsManager: SettingsManager): Boolean
Check if a word is in the blacklist or not
Link copied to clipboard
open fun chatLogout()
Clear both lists
open fun chatLogout(player: Player)
Removes a player from the list of spies and the chat map when they log out of the server.
Link copied to clipboard
open fun checkGuildNames(name: String): Boolean
Check if a guild name already exists
Link copied to clipboard
open fun checkIfFull(guild: Guild): Boolean
Simple method to check if a guild is full or not
Link copied to clipboard
open fun checkInvites(manager: PaperCommandManager, player: Player)
Checks if a player has any pending guild invites and sends them a message with the list of guilds they have been invited to.
Link copied to clipboard
open fun createNewVault(settingsManager: SettingsManager): Inventory
Method to create new vault
Link copied to clipboard
open fun getFormattedPlaceholder(player: Player): String
Get the formatted placeholder that uses brackets
Link copied to clipboard
@Nullable
open fun getGuild(@NotNull name: @NotNull String): @Nullable Guild
Retrieves a [guild] by its name.
@Nullable
open fun getGuild(@NotNull uuid: @NotNull UUID): @Nullable Guild
Returns the guild object corresponding to the given UUID.
@Nullable
open fun getGuild(@NotNull p: @NotNull OfflinePlayer): @Nullable Guild
Retrieve the guild of an offline player.
Link copied to clipboard
@Nullable
open fun getGuildByCode(@NotNull code: @NotNull String): @Nullable Guild
Retrieves the guild that has a matching invite code.
Link copied to clipboard
@Nullable
open fun getGuildByPlayerId(@NotNull uuid: @NotNull UUID): @Nullable Guild
Get the guild that a player belongs to by their UUID.
Link copied to clipboard
@Nullable
open fun getGuildMember(@NotNull uuid: @NotNull UUID): @Nullable GuildMember
Get an instance of the guild member object via their uuid
Link copied to clipboard
Returns a string list of the name of all guilds on the server
Link copied to clipboard
@Nullable
open fun getGuildRole(level: Int): @Nullable GuildRole
Retrieve a guild role by level
Link copied to clipboard
open fun getGuildsSize(): Int
Returns the amount of guilds existing
Link copied to clipboard
@Nullable
open fun getGuildTier(level: Int): @Nullable GuildTier
Retrieve a GuildTier object by level.
Link copied to clipboard
open fun getGuildVault(guild: Guild, vault: Int): Inventory
Get the inventory of a specified guild vault.
Link copied to clipboard
open fun getInvitedGuilds(player: OfflinePlayer): List<String>
Returns a list of the names of all the guilds that an offline player has been invited to.
Link copied to clipboard
open fun getJoinableGuild(player: Player): List<String>
Get a total list of all joinable guilds to a player
Link copied to clipboard
Retrieves the lowest role in the guild hierarchy.
Link copied to clipboard
Returns the lowest guild tier.
Link copied to clipboard
open fun getMaxTierLevel(): Int
Returns the max tier level
Link copied to clipboard
open fun getNameById(@NotNull uuid: @NotNull UUID): String
Get a guild's name by it's IDd
Link copied to clipboard
open fun getOnlineInviters(guild: Guild): List<Player>
Get a list of the online members that can invite people
Link copied to clipboard
Get a list of all public guilds on the server
Link copied to clipboard
open fun getUpgradeTicket(settingsManager: SettingsManager, amount: Int): ItemStack
Create a guild upgrade ticket
Link copied to clipboard
open fun handleAllyChat(guild: Guild, player: Player, message: String)
Handles sending a chat message to all allies of a guild
Link copied to clipboard
open fun handleCodeList(commandManager: PaperCommandManager, player: Player, codes: List<GuildCode>)
Handle sending code list message to prevent DRY
Link copied to clipboard
open fun handleGuildChat(guild: Guild, player: Player, message: String)
Handles sending guild chat messages to the proper locations
Link copied to clipboard
open fun handleInvite(manager: PaperCommandManager, player: Player, guild: Guild, code: GuildCode)
Handle inviting player when redeeming a code
Link copied to clipboard
open fun hasPapi(): Boolean
Link copied to clipboard
open fun hasVaultUnlocked(vault: Int, guild: Guild): Boolean
Check if a guild has a specific vault unlocked
Link copied to clipboard
open fun isAlly(guild: Guild, target: Guild): Boolean
Simple method to check if two guilds are allies
open fun isAlly(player: Player, target: Player): Boolean
Check if two players are allies.
Link copied to clipboard
open fun isMaxTier(guild: Guild): Boolean
Checks if a guild has reached the maximum tier level.
Link copied to clipboard
open fun isMigrating(): Boolean
Link copied to clipboard
open fun isSameGuild(@NotNull g1: @NotNull Guild, @NotNull g2: @NotNull Guild): Boolean
Compare two guilds to see if they are the same.
open fun isSameGuild(@NotNull player: @NotNull Player, @NotNull target: @NotNull Player): Boolean
Check if two players are in the same guild or not.
Link copied to clipboard
open fun matchTicket(settingsManager: SettingsManager): ItemStack
Check the guild ticket itemstack
Link copied to clipboard
open fun memberCheck(guild: Guild): Boolean
Checks whether a guild satisfies the member requirement to upgrade to the next tier.
Link copied to clipboard
open fun nameCheck(name: String, settingsManager: SettingsManager): Boolean
Check if the input name for a guild is valid.
Link copied to clipboard
open fun notifyAllies(guild: Guild, commandManager: PaperCommandManager)
Notify all allies of a guild that's being deleted.
Link copied to clipboard
open fun pingOnlineInviters(guild: Guild, commandManager: PaperCommandManager, player: Player)
Simple method to inform all online inviters that someone wants to join
Link copied to clipboard
open fun prefixCheck(name: String, settingsManager: SettingsManager): Boolean
Checks if a prefix is valid or not based on guild settings.
Link copied to clipboard
open fun removeAlliesOnDelete(guild: Guild)
Remove a guild from all other guilds allies or pending allies when deleted
Link copied to clipboard
open fun removeAlly(@NotNull guild: @NotNull Guild, @NotNull targetGuild: @NotNull Guild)
Removes an ally of a guild.
Link copied to clipboard
open fun removeFromChat(uuid: UUID)
Remove a player from the chat list
Link copied to clipboard
open fun removeGuild(@NotNull guild: @NotNull Guild)
Removes a [guild] from the list and deletes it from the database.
Link copied to clipboard
open fun removeGuildPerms(permission: Permission, player: OfflinePlayer)
Remove guild perms from a specific player
Link copied to clipboard
open fun removeGuildPermsFromAll(permission: Permission, guild: Guild)
Remove all guild permissions from all players in the guild
Link copied to clipboard
open fun removePendingAlly(guild: Guild, targetGuild: Guild)
Removes a pending ally
Link copied to clipboard
open fun removePerms(permission: Permission, offlinePlayer: OfflinePlayer, nodes: List<String>)
Removes a set of permissions from a player
Link copied to clipboard
open fun removeRolePerm(permission: Permission, player: OfflinePlayer)
Removes a role perm from a player
Link copied to clipboard
open fun removeRolePermsFromAll(permission: Permission, guild: Guild)
Remove the role permission from all members when the guild is disbanded
Link copied to clipboard
open fun removeSpy(manager: PaperCommandManager, player: Player)
Removes a player from the list of spies.
Link copied to clipboard
open fun saveData()
Saves the data of all guilds to the database.
Link copied to clipboard
open fun setMigrating(migrating: Boolean)
Link copied to clipboard
open fun setPapi(papi: Boolean)
Link copied to clipboard
open fun toggleSpy(manager: PaperCommandManager, player: Player)
Toggles the spy mode of a player, which allows them to spy on guild chats.
Link copied to clipboard
open fun upgradeTier(guild: Guild)
Upgrades the tier of a guild.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val opened: List<Player>
Link copied to clipboard
open var papi: Boolean
Link copied to clipboard
Link copied to clipboard
val spies: List<Player>
Link copied to clipboard
Link copied to clipboard
val vaults: Map<Guild, List<Inventory>>