Interface Game<P extends BWPlayer,T extends Team<?,?,?,?,?>,B extends org.screamingsandals.lib.utils.Wrapper,W extends org.screamingsandals.lib.utils.Wrapper,L extends org.screamingsandals.lib.utils.Wrapper,E extends org.screamingsandals.lib.utils.Wrapper,C extends org.screamingsandals.lib.utils.Wrapper,S extends GameStore<?,?,?>,G extends ItemSpawner<?,?,?>>

Type Parameters:
P - BedWars Player
T - BedWars Team
B - Block
W - World
L - Location
E - Entity
C - Component Wrapper
S - Game Store
G - Item Spawner

@NonExtendable public interface Game<P extends BWPlayer,T extends Team<?,?,?,?,?>,B extends org.screamingsandals.lib.utils.Wrapper,W extends org.screamingsandals.lib.utils.Wrapper,L extends org.screamingsandals.lib.utils.Wrapper,E extends org.screamingsandals.lib.utils.Wrapper,C extends org.screamingsandals.lib.utils.Wrapper,S extends GameStore<?,?,?>,G extends ItemSpawner<?,?,?>>
  • Method Details

    • getUuid

      UUID getUuid()
      Returns:
      arena's unique id
    • getName

      String getName()
      Returns:
      Arena name
    • getDisplayName

      @Nullable @Nullable String getDisplayName()
      Returns:
      display name of the arena or null if there's no display name
    • getStatus

      GameStatus getStatus()
      Returns:
      GameStatus of the arena
    • start

      void start()
    • stop

      void stop()
    • isActivated

      default boolean isActivated()
      Returns:
      true if GameStatus is different than DISABLED
    • joinToGame

      void joinToGame(P player)
      Parameters:
      player -
    • leaveFromGame

      void leaveFromGame(P player)
      Parameters:
      player -
    • selectPlayerTeam

      void selectPlayerTeam(P player, T team)
      Parameters:
      player -
      team -
    • selectPlayerRandomTeam

      void selectPlayerRandomTeam(P player)
      Parameters:
      player -
    • getGameWorld

      W getGameWorld()
      Returns:
      defined world of the game
    • getPos1

      L getPos1()
      Returns:
    • getPos2

      L getPos2()
      Returns:
    • getSpectatorSpawn

      L getSpectatorSpawn()
      Returns:
    • getGameTime

      int getGameTime()
      Returns:
      configured time of the game
    • getMinPlayers

      int getMinPlayers()
      Returns:
      configured minimal players to start the game
    • getMaxPlayers

      int getMaxPlayers()
      Returns:
      configured maximal players of the arena
    • countConnectedPlayers

      int countConnectedPlayers()
      Returns:
      players in game
    • getConnectedPlayers

      List<P> getConnectedPlayers()
      Returns:
      list of players in game
    • getGameStores

      List<S> getGameStores()
      Returns:
      list of game stores
    • countGameStores

      int countGameStores()
      Returns:
    • getTeamFromName

      T getTeamFromName(String name)
      Returns:
      Team instance from the name
    • getAvailableTeams

      List<T> getAvailableTeams()
      Returns:
    • countAvailableTeams

      int countAvailableTeams()
      Returns:
    • getActiveTeams

      List<T> getActiveTeams()
      Returns:
    • countActiveTeams

      int countActiveTeams()
      Returns:
    • getTeamOfPlayer

      T getTeamOfPlayer(P player)
      Parameters:
      player -
      Returns:
    • isPlayerInAnyTeam

      boolean isPlayerInAnyTeam(P player)
      Parameters:
      player -
      Returns:
    • isTeamActive

      boolean isTeamActive(T team)
    • isPlayerInTeam

      boolean isPlayerInTeam(P player, T team)
      Parameters:
      player -
      team -
      Returns:
    • isLocationInArena

      boolean isLocationInArena(L location)
      Parameters:
      location -
      Returns:
    • isBlockAddedDuringGame

      boolean isBlockAddedDuringGame(Object location)
      Parameters:
      location -
      Returns:
    • getActiveSpecialItems

      List<SpecialItem<?,?,?>> getActiveSpecialItems()
      Returns:
    • getActiveSpecialItems

      <I extends SpecialItem<?, ?, ?>> List<I> getActiveSpecialItems(Class<I> type)
      Parameters:
      type -
      Returns:
    • getActiveSpecialItemsOfTeam

      List<SpecialItem<?,?,?>> getActiveSpecialItemsOfTeam(T team)
      Parameters:
      team -
      Returns:
    • getActiveSpecialItemsOfTeam

      <I extends SpecialItem<?, ?, ?>> List<I> getActiveSpecialItemsOfTeam(T team, Class<I> type)
      Parameters:
      team -
      type -
      Returns:
    • getFirstActiveSpecialItemOfTeam

      SpecialItem<?,?,?> getFirstActiveSpecialItemOfTeam(T team)
      Parameters:
      team -
      Returns:
    • getFirstActiveSpecialItemOfTeam

      <I extends SpecialItem<?, ?, ?>> I getFirstActiveSpecialItemOfTeam(T team, Class<I> type)
      Parameters:
      team -
      type -
      Returns:
    • getActiveSpecialItemsOfPlayer

      List<SpecialItem<?,?,?>> getActiveSpecialItemsOfPlayer(P player)
      Parameters:
      player -
      Returns:
    • getActiveSpecialItemsOfPlayer

      <I extends SpecialItem<?, ?, ?>> List<I> getActiveSpecialItemsOfPlayer(P player, Class<I> type)
      Parameters:
      player -
      type -
      Returns:
    • getFirstActiveSpecialItemOfPlayer

      SpecialItem<?,?,?> getFirstActiveSpecialItemOfPlayer(P player)
      Parameters:
      player -
      Returns:
    • getFirstActiveSpecialItemOfPlayer

      <I extends SpecialItem<?, ?, ?>> I getFirstActiveSpecialItemOfPlayer(P player, Class<I> type)
      Parameters:
      player -
      type -
      Returns:
    • getActiveDelays

      List<DelayFactory> getActiveDelays()
      Returns:
    • getActiveDelaysOfPlayer

      List<DelayFactory> getActiveDelaysOfPlayer(P player)
      Parameters:
      player -
      Returns:
    • getActiveDelay

      DelayFactory getActiveDelay(P player, Class<? extends SpecialItem<?,?,?>> specialItem)
      Parameters:
      player -
      specialItem -
      Returns:
    • registerDelay

      void registerDelay(DelayFactory delayFactory)
      Parameters:
      delayFactory -
    • unregisterDelay

      void unregisterDelay(DelayFactory delayFactory)
      Parameters:
      delayFactory -
    • isDelayActive

      boolean isDelayActive(P player, Class<? extends SpecialItem<?,?,?>> specialItem)
      Parameters:
      player -
      specialItem -
      Returns:
    • registerSpecialItem

      void registerSpecialItem(SpecialItem<?,?,?> item)
      Parameters:
      item -
    • unregisterSpecialItem

      void unregisterSpecialItem(SpecialItem<?,?,?> item)
      Parameters:
      item -
    • isRegisteredSpecialItem

      boolean isRegisteredSpecialItem(SpecialItem<?,?,?> item)
      Parameters:
      item -
      Returns:
    • getItemSpawners

      List<G> getItemSpawners()
      Returns:
    • getRegion

      Region<B> getRegion()
      Returns:
    • getStatusBar

      StatusBar<?> getStatusBar()
      Returns:
    • getLobbyWorld

      W getLobbyWorld()
      Returns:
    • getLobbySpawn

      L getLobbySpawn()
      Returns:
    • getLobbyCountdown

      int getLobbyCountdown()
      Returns:
    • countTeamChests

      int countTeamChests()
      Returns:
    • countTeamChests

      int countTeamChests(T team)
      Parameters:
      team -
      Returns:
    • getTeamOfChest

      T getTeamOfChest(L location)
      Parameters:
      location -
      Returns:
    • isEntityShop

      boolean isEntityShop(E entity)
      Parameters:
      entity -
      Returns:
    • getBungeeEnabled

      boolean getBungeeEnabled()
      Returns:
    • getArenaTime

      ArenaTime getArenaTime()
      Returns:
    • getArenaWeather

      org.screamingsandals.lib.utils.Wrapper getArenaWeather()
      Returns:
    • getLobbyBossBarColor

      org.screamingsandals.lib.utils.Wrapper getLobbyBossBarColor()
      Returns:
    • getGameBossBarColor

      org.screamingsandals.lib.utils.Wrapper getGameBossBarColor()
      Returns:
    • isProtectionActive

      boolean isProtectionActive(P player)
      Returns:
    • getPostGameWaiting

      int getPostGameWaiting()
    • hasCustomPrefix

      default boolean hasCustomPrefix()
    • getCustomPrefix

      String getCustomPrefix()
    • getGameVariant

      @Nullable @Nullable Variant getGameVariant()
    • getConfigurationContainer

      ConfigurationContainer getConfigurationContainer()
      Returns configuration container for this game
      Returns:
      game's configuration container
      Since:
      0.3.0
    • isInEditMode

      boolean isInEditMode()
      Checks if game is in edit mode
      Returns:
      true if game is in edit mode
      Since:
      0.3.0
    • saveToConfig

      void saveToConfig()
      This methods allows you to save the arena to config (useful when using custom config options)
      Since:
      0.3.0
    • getFile

      File getFile()
      Gets file with this game
      Returns:
      file where game is saved
      Since:
      0.3.0
    • getCustomPrefixComponent

      C getCustomPrefixComponent()
      Returns:
      Since:
      0.3.0
    • getDisplayNameComponent

      C getDisplayNameComponent()
    • getLobbyPos1

      @Nullable L getLobbyPos1()
      Returns:
      Since:
      0.3.0
    • getLobbyPos2

      @Nullable L getLobbyPos2()
      Returns:
      Since:
      0.3.0