Class BaseArena

java.lang.Object
org.bukkit.scheduler.BukkitRunnable
plugily.projects.buildbattle.arena.impl.BaseArena
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
GuessTheBuildArena, SoloArena

public class BaseArena
extends org.bukkit.scheduler.BukkitRunnable
Author:
Plajer

Created at 18.01.2019

  • Field Details

  • Constructor Details

    • BaseArena

      public BaseArena​(String id, Main plugin)
  • Method Details

    • isReady

      public boolean isReady()
      Checks if arena is validated and ready to play
      Returns:
      true = ready, false = not ready either you must validate it or it's wrongly created
    • setReady

      public void setReady​(boolean ready)
    • getPlotManager

      public PlotManager getPlotManager()
    • getArenaType

      public BaseArena.ArenaType getArenaType()
    • setArenaType

      public void setArenaType​(BaseArena.ArenaType arenaType)
    • run

      public void run()
    • start

      public void start()
    • doBarAction

      public void doBarAction​(@NotNull @NotNull BaseArena.BarAction action, org.bukkit.entity.Player p)
      Executes boss bar action for arena
      Parameters:
      action - add or remove a player from boss bar
      p - player
    • updateBossBar

      public void updateBossBar()
    • distributePlots

      public void distributePlots()
    • sendBuildLeftTimeMessage

      public void sendBuildLeftTimeMessage()
    • getScoreboardManager

      public ScoreboardManager getScoreboardManager()
    • isForceStart

      public boolean isForceStart()
    • setForceStart

      public void setForceStart​(boolean forceStart)
    • getID

      @NotNull public @NotNull String getID()
      Get arena ID, ID != map name ID is used to get and manage arenas
      Returns:
      arena ID
    • getLobbyLocation

      @Nullable public @Nullable org.bukkit.Location getLobbyLocation()
      Lobby location of arena
      Returns:
      lobby loc of arena
    • setLobbyLocation

      public void setLobbyLocation​(org.bukkit.Location loc)
    • getMinimumPlayers

      public int getMinimumPlayers()
      Min players that are required to start arena
      Returns:
      min players size
    • setMinimumPlayers

      public void setMinimumPlayers​(int amount)
    • getMapName

      @NotNull public @NotNull String getMapName()
      Get map name, map name != ID Map name is used in signs
      Returns:
      map name String
    • setMapName

      public void setMapName​(String mapname)
    • addPlayer

      public void addPlayer​(org.bukkit.entity.Player player)
    • removePlayer

      public void removePlayer​(org.bukkit.entity.Player player)
    • clearPlayers

      public void clearPlayers()
    • addSpectator

      public void addSpectator​(org.bukkit.entity.Player player)
    • removeSpectator

      public void removeSpectator​(org.bukkit.entity.Player player)
    • getTimer

      public int getTimer()
      Global timer of arena
      Returns:
      timer of arena
    • setTimer

      public void setTimer​(int timer)
    • getMaximumPlayers

      public int getMaximumPlayers()
      Max players size arena can hold
      Returns:
      max players size
    • setMaximumPlayers

      public void setMaximumPlayers​(int amount)
    • getArenaState

      @NotNull public @NotNull ArenaState getArenaState()
      Arena state of arena
      Returns:
      arena state
      See Also:
      ArenaState
    • setArenaState

      public void setArenaState​(@NotNull @NotNull ArenaState arenaState)
      Changes arena state of arena Calls BBGameChangeStateEvent
      Parameters:
      arenaState - arena state to change
      See Also:
      BBGameChangeStateEvent
    • getPlayers

      @NotNull public @NotNull List<org.bukkit.entity.Player> getPlayers()
      Get players in game
      Returns:
      List with players
    • getSpectators

      public List<org.bukkit.entity.Player> getSpectators()
    • getPlugin

      public Main getPlugin()
    • teleportAllToEndLocation

      public void teleportAllToEndLocation()
    • teleportToLobby

      public void teleportToLobby​(org.bukkit.entity.Player player)
    • teleportToEndLocation

      public void teleportToEndLocation​(org.bukkit.entity.Player player)
    • giveRewards

      public void giveRewards()
    • getTheme

      @NotNull public @NotNull String getTheme()
      Get current arena theme
      Returns:
      arena theme String or "Theme" as default
    • setTheme

      public void setTheme​(String theme)
    • getEndLocation

      @Nullable public @Nullable org.bukkit.Location getEndLocation()
      End location of arena
      Returns:
      end loc of arena
    • setEndLocation

      public void setEndLocation​(org.bukkit.Location endLoc)
    • getGameBar

      protected org.bukkit.boss.BossBar getGameBar()
    • getOption

      public int getOption​(ArenaOption option)
    • setOptionValue

      public void setOptionValue​(ArenaOption option, int value)
    • addOptionValue

      public void addOptionValue​(ArenaOption option, int value)