ChallengeHandler

Created by Glare Date: 7/12/2019 Time: 2:50 PM

Constructors

Link copied to clipboard
open fun ChallengeHandler(guilds: Guilds)

Types

Link copied to clipboard
enum Cause
An enumeration representing the cause of a player's death in a game.

Functions

Link copied to clipboard
open fun addChallenge(@NotNull challenge: @NotNull GuildChallenge)
Add a challenge to the list
Link copied to clipboard
open fun announceDeath(@NotNull challenge: @NotNull GuildChallenge, @NotNull guilds: @NotNull Guilds, @NotNull player: @NotNull Player, @NotNull killer: @NotNull Player, @NotNull cause: @NotNull ChallengeHandler.Cause)
Announce when a player dies
Link copied to clipboard
open fun announceWinner(@NotNull challenge: @NotNull GuildChallenge, @NotNull commandManager: @NotNull PaperCommandManager)
Announce the winner to the guild
Link copied to clipboard
open fun checkEnoughJoined(@NotNull challenge: @NotNull GuildChallenge): Boolean
Make sure enough players joined the challenge
Link copied to clipboard
open fun checkEnoughOnline(@NotNull challenger: @NotNull Guild, @NotNull defender: @NotNull Guild, amount: Int): Boolean
Simple method to check if both guilds have enough players online
Link copied to clipboard
open fun checkIfOver(@NotNull challenge: @NotNull GuildChallenge): Boolean
Check if a challenge is over because a team won
Link copied to clipboard
open fun createNewChallenge(@NotNull challenger: @NotNull Guild, @NotNull defender: @NotNull Guild, minPlayer: Int, maxPlayers: Int, @NotNull arena: @NotNull Arena): GuildChallenge
Create a new Guild Challenge
Link copied to clipboard
open fun exitArena(player: Player, challenge: GuildChallenge, guilds: Guilds)
Teleport a player out of the arena
Link copied to clipboard
Get a list of active challenges
Link copied to clipboard
open fun getAllPlayersAlive(@NotNull challenge: @NotNull GuildChallenge): Map<UUID, String>
Get a combined map of all players
Link copied to clipboard
open fun getChallenge(@NotNull uuid: @NotNull UUID): GuildChallenge
Get a challenge by it's uuid
open fun getChallenge(@NotNull guild: @NotNull Guild): GuildChallenge
Get a guild challenge by a guild
open fun getChallenge(@NotNull player: @NotNull Player): GuildChallenge
Get a challenge from a player
Link copied to clipboard
open fun getOnlineDefenders(@NotNull guild: @NotNull Guild): List<Player>
Get a list of the online war people for your guild
Link copied to clipboard
open fun giveRewards(@NotNull settingsManager: @NotNull SettingsManager, @NotNull challenge: @NotNull GuildChallenge)
Give the rewards to the winner
Link copied to clipboard
open fun handleFinish(@NotNull guilds: @NotNull Guilds, @NotNull settingsManager: @NotNull SettingsManager, @NotNull player: @NotNull Player, @NotNull challenge: @NotNull GuildChallenge)
Handle finishing of the arena war
Link copied to clipboard
open fun loadChallenges()
Called when the plugin is first enabled to load all the challenges
Link copied to clipboard
open fun notOnCooldown(@NotNull guild: @NotNull Guild, @NotNull settingsManager: @NotNull SettingsManager): Boolean
Check to see if a Guild can be challenged
Link copied to clipboard
open fun pingOnlineDefenders(@NotNull guild: @NotNull Guild, @NotNull commandManager: @NotNull PaperCommandManager, @NotNull challenger: @NotNull String, acceptTime: Int)
Send a message to all online defenders
Link copied to clipboard
open fun prepareFinalList(@NotNull players: @NotNull List<UUID>, @NotNull challenge: @NotNull GuildChallenge, @NotNull team: @NotNull String)
Prepare the final list for a challenge
Link copied to clipboard
open fun removeChallenge(@NotNull uuid: @NotNull UUID)
Removes a challenge from the list by the uuid
open fun removeChallenge(@NotNull challenge: @NotNull GuildChallenge)
Remove a challenge from the list
Link copied to clipboard
open fun removePlayer(@NotNull player: @NotNull Player)
Remove a player from a challenge
Link copied to clipboard
open fun saveData()
Save the data of challenges
Link copied to clipboard
open fun sendToArena(@NotNull players: @NotNull Map<UUID, String>, @Nullable location: @Nullable Location)
Send players to arena
Link copied to clipboard
open fun teleportRemaining(@NotNull challenge: @NotNull GuildChallenge)
Teleport the remaining players back to their original location

Properties

Link copied to clipboard