Package org.battleplugins.arena
Interface BattleArenaApi
- All Known Implementing Classes:
BattleArena
public interface BattleArenaApi
Main API entrypoint for BattleArena.
-
Method Summary
Modifier and TypeMethodDescriptionReturns theArenafrom the given name.findJoinableCompetition(List<Competition<?>> competitions, Collection<org.bukkit.entity.Player> players, PlayerRole role) findJoinableCompetition(List<Competition<?>> competitions, org.bukkit.entity.Player player, PlayerRole role) static BattleArenaApiget()Returns the BattleArena API instance.@Nullable ArenaReturns theArenafrom the given name.Returns all theArenas for the plugin.List<Competition<?>>getCompetitions(Arena arena) Returns all theCompetitions for the givenArena.List<Competition<?>>getCompetitions(Arena arena, String name) Returns all theCompetitions for the givenArenaand specified map name.Returns theEventScheduler, which is responsible for scheduling events.@Nullable CompetitionMapReturns the map from the givenArenaand map name.List<? extends CompetitionMap>Returns all the available maps for the givenArena.Returns the path to the maps directory.booleanReturns whether the plugin is in debug mode.booleanisInArena(org.bukkit.entity.Player player) Returns whether the givenPlayeris in anArena.Optional<? extends CompetitionMap>Returns the map from the givenArenaand map name.<T extends Arena>
voidregisterArena(org.bukkit.plugin.Plugin plugin, String name, Class<T> arenaClass) Registers the givenArena.<T extends Arena>
voidregisterArena(org.bukkit.plugin.Plugin plugin, String name, Class<T> arenaClass, Supplier<T> arenaFactory) Registers the givenArena.voidsetDebugMode(boolean debugMode) Sets whether the plugin is in debug mode.
-
Method Details
-
isInArena
boolean isInArena(org.bukkit.entity.Player player) Returns whether the givenPlayeris in anArena.- Parameters:
player- the player to check- Returns:
- whether the player is in an arena
-
arena
Returns theArenafrom the given name.- Parameters:
name- the name of the arena- Returns:
- the arena from the given name
-
getArena
Returns theArenafrom the given name.- Parameters:
name- the name of the arena- Returns:
- the arena from the given name, or null if not found
-
getArenas
Returns all theArenas for the plugin.- Returns:
- all the arenas for the plugin
-
registerArena
<T extends Arena> void registerArena(org.bukkit.plugin.Plugin plugin, String name, Class<T> arenaClass) Registers the givenArena.- Parameters:
plugin- the plugin registering the arenaname- the name of the arenaarenaClass- the arena type to register
-
registerArena
<T extends Arena> void registerArena(org.bukkit.plugin.Plugin plugin, String name, Class<T> arenaClass, Supplier<T> arenaFactory) Registers the givenArena.- Parameters:
plugin- the plugin registering the arenaname- the name of the arenaarenaClass- the arena type to registerarenaFactory- the factory to create the arena
-
getMaps
Returns all the available maps for the givenArena.- Parameters:
arena- the arena to get the maps for- Returns:
- all the available maps for the given arena
-
map
Returns the map from the givenArenaand map name.- Parameters:
arena- the arena to get the map fromname- the name of the map- Returns:
- the map from the given arena and name
-
getMap
Returns the map from the givenArenaand map name.- Parameters:
arena- the arena to get the map fromname- the name of the map- Returns:
- the map from the given arena and name, or null if not found
-
getCompetitions
Returns all theCompetitions for the givenArena.- Parameters:
arena- the arena to get the competitions for- Returns:
- all the competitions for the given arena
-
getCompetitions
Returns all theCompetitions for the givenArenaand specified map name.- Parameters:
arena- the arena to get the competitions forname- the name of the competition- Returns:
- all the competitions for the given arena and name
-
findJoinableCompetition
CompletableFuture<CompetitionResult> findJoinableCompetition(List<Competition<?>> competitions, org.bukkit.entity.Player player, PlayerRole role) - Parameters:
competitions- the competitions to find fromplayer- the player to find the competition forrole- the role of the player- Returns:
- the competition result
-
findJoinableCompetition
CompletableFuture<CompetitionResult> findJoinableCompetition(List<Competition<?>> competitions, Collection<org.bukkit.entity.Player> players, PlayerRole role) - Parameters:
competitions- the competitions to find fromplayers- the players to find the competition forrole- the role of the player- Returns:
- the competition result
-
getEventScheduler
EventScheduler getEventScheduler()Returns theEventScheduler, which is responsible for scheduling events.- Returns:
- the event scheduler
-
getMapsPath
Path getMapsPath()Returns the path to the maps directory.- Returns:
- the path to the maps directory
-
isDebugMode
boolean isDebugMode()Returns whether the plugin is in debug mode.- Returns:
- whether the plugin is in debug mode
-
setDebugMode
void setDebugMode(boolean debugMode) Sets whether the plugin is in debug mode.- Parameters:
debugMode- whether the plugin is in debug mode
-
get
Returns the BattleArena API instance.- Returns:
- the BattleArena API instance
-