Interface BedWars.ArenaUtil

Enclosing interface:
BedWars

public static interface BedWars.ArenaUtil
The ArenaUtil interface provides utility methods for managing arenas in the bed wars mini-game.
  • Method Details

    • canAutoScale

      boolean canAutoScale(String arenaName)
      Checks if an arena can be auto-scaled.
      Parameters:
      arenaName - the name of the arena
      Returns:
      true if the arena can be auto-scaled, false otherwise
    • addToEnableQueue

      void addToEnableQueue(IArena a)
      Adds a custom arena to the enable queue.
      Parameters:
      a - the arena to add
    • removeFromEnableQueue

      void removeFromEnableQueue(IArena a)
      Removes an arena from the enable queue.
      Parameters:
      a - the arena to remove
    • isPlaying

      boolean isPlaying(org.bukkit.entity.Player p)
      Checks if a player is currently playing in an arena.
      Parameters:
      p - the player
      Returns:
      true if the player is playing, false otherwise
    • isSpectating

      boolean isSpectating(org.bukkit.entity.Player p)
      Checks if a player is currently spectating in an arena.
      Parameters:
      p - the player
      Returns:
      true if the player is spectating, false otherwise
    • loadArena

      void loadArena(String worldName, @Nullable @Nullable org.bukkit.command.CommandSender sender)
      Loads an arena and adds it to the enable queue.
      Parameters:
      worldName - the name of the arena world
      sender - the player or console who triggered the load (can be null)
    • setGamesBeforeRestart

      void setGamesBeforeRestart(int games)
      Sets the number of games before the server restarts. This is only applicable in a BUNGEE server type.
      Parameters:
      games - the number of games before restart
    • getGamesBeforeRestart

      int getGamesBeforeRestart()
      Gets the number of games before the server restarts. This is only applicable in a BUNGEE server type.
      Returns:
      the number of games before restart
    • getArenaByPlayer

      IArena getArenaByPlayer(org.bukkit.entity.Player player)
      Retrieves the arena where the player is located (either as a spectator or a player).
      Parameters:
      player - the player
      Returns:
      the arena where the player is located, or null if not in an arena
    • setArenaByPlayer

      void setArenaByPlayer(org.bukkit.entity.Player p, IArena arena)
      Sets the arena for a player if the player is in the specified arena.
      Parameters:
      p - the player
      arena - the arena
    • removeArenaByPlayer

      void removeArenaByPlayer(org.bukkit.entity.Player p, IArena a)
      Removes the association of an arena with a player.
      Parameters:
      p - the player
      a - the arena
    • getArenaByName

      IArena getArenaByName(String worldName)
      Retrieves an arena by its world name.
      Parameters:
      worldName - the world name of the arena
      Returns:
      the arena with the specified world name, or null if not found
    • getArenaByIdentifier

      IArena getArenaByIdentifier(String identifier)
      Retrieves an arena by its identifier.
      Parameters:
      identifier - the identifier of the arena
      Returns:
      the arena with the specified identifier, or null if not found
    • setArenaByName

      void setArenaByName(IArena arena)
      Sets the arena using its world name.
      Parameters:
      arena - the arena to set
    • removeArenaByName

      void removeArenaByName(String worldName)
      Removes the association of an arena with its world name.
      Parameters:
      worldName - the world name of the arena to remove
    • getArenas

      LinkedList<IArena> getArenas()
      Retrieves a list of all arenas.
      Returns:
      the list of arenas
    • vipJoin

      boolean vipJoin(org.bukkit.entity.Player p)
      Checks if a player has VIP join access.
      Parameters:
      p - the player
      Returns:
      true if the player has VIP join access, false otherwise
    • getPlayers

      int getPlayers(String group)
      Retrieves the number of players in a specific group.
      Parameters:
      group - the group name
      Returns:
      the number of players in the group
    • joinRandomArena

      boolean joinRandomArena(org.bukkit.entity.Player p)
      Adds a player to the most filled arena. Checks if the player is the party owner first.
      Parameters:
      p - the player to add
      Returns:
      true if the player joined an arena, false otherwise
    • joinRandomFromGroup

      boolean joinRandomFromGroup(org.bukkit.entity.Player p, String group)
      Adds a player to the most filled arena from a specific group.
      Parameters:
      p - the player to add
      group - the group name
      Returns:
      true if the player joined an arena, false otherwise
    • getEnableQueue

      LinkedList<IArena> getEnableQueue()
      Retrieves the enable queue of arenas.
      Returns:
      the enable queue
    • sendLobbyCommandItems

      void sendLobbyCommandItems(org.bukkit.entity.Player p)
      Gives the lobby items to the player. This clears the player's inventory before giving the items. (Not used for BUNGEE serverType)
      Parameters:
      p - the player