Interface BattleArenaApi

All Known Implementing Classes:
BattleArena

public interface BattleArenaApi
Main API entrypoint for BattleArena.
  • Method Details

    • isInArena

      boolean isInArena(org.bukkit.entity.Player player)
      Returns whether the given Player is in an Arena.
      Parameters:
      player - the player to check
      Returns:
      whether the player is in an arena
    • arena

      Optional<Arena> arena(String name)
      Returns the Arena from the given name.
      Parameters:
      name - the name of the arena
      Returns:
      the arena from the given name
    • getArena

      @Nullable @Nullable Arena getArena(String name)
      Returns the Arena from the given name.
      Parameters:
      name - the name of the arena
      Returns:
      the arena from the given name, or null if not found
    • getArenas

      List<Arena> getArenas()
      Returns all the Arenas 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 given Arena.
      Parameters:
      plugin - the plugin registering the arena
      name - the name of the arena
      arenaClass - 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 given Arena.
      Parameters:
      plugin - the plugin registering the arena
      name - the name of the arena
      arenaClass - the arena type to register
      arenaFactory - the factory to create the arena
    • getMaps

      List<? extends CompetitionMap> getMaps(Arena arena)
      Returns all the available maps for the given Arena.
      Parameters:
      arena - the arena to get the maps for
      Returns:
      all the available maps for the given arena
    • map

      Optional<? extends CompetitionMap> map(Arena arena, String name)
      Returns the map from the given Arena and map name.
      Parameters:
      arena - the arena to get the map from
      name - the name of the map
      Returns:
      the map from the given arena and name
    • getMap

      @Nullable @Nullable CompetitionMap getMap(Arena arena, String name)
      Returns the map from the given Arena and map name.
      Parameters:
      arena - the arena to get the map from
      name - the name of the map
      Returns:
      the map from the given arena and name, or null if not found
    • getCompetitions

      List<Competition<?>> getCompetitions(Arena arena)
      Returns all the Competitions for the given Arena.
      Parameters:
      arena - the arena to get the competitions for
      Returns:
      all the competitions for the given arena
    • getCompetitions

      List<Competition<?>> getCompetitions(Arena arena, String name)
      Returns all the Competitions for the given Arena and specified map name.
      Parameters:
      arena - the arena to get the competitions for
      name - 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)
      Finds a joinable Competition for the given Player and PlayerRole.
      Parameters:
      competitions - the competitions to find from
      player - the player to find the competition for
      role - the role of the player
      Returns:
      the competition result
    • findJoinableCompetition

      CompletableFuture<CompetitionResult> findJoinableCompetition(List<Competition<?>> competitions, Collection<org.bukkit.entity.Player> players, PlayerRole role)
      Finds a joinable Competition for the given Players and PlayerRole.
      Parameters:
      competitions - the competitions to find from
      players - the players to find the competition for
      role - the role of the player
      Returns:
      the competition result
    • getEventScheduler

      EventScheduler getEventScheduler()
      Returns the EventScheduler, 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

      static BattleArenaApi get()
      Returns the BattleArena API instance.
      Returns:
      the BattleArena API instance