Interface BedwarsAPI


public interface BedwarsAPI
  • Method Details

    • getGames

      List<Game> getGames()
      Returns:
      List of available games
    • isGameWithNameExists

      boolean isGameWithNameExists(String name)
      Parameters:
      name - Name of game
      Returns:
      true if game is exists
    • getGameByName

      Game getGameByName(String name)
      Parameters:
      name - Name of game
      Returns:
      Game or null if game is not exists
    • getGameOfPlayer

      Game getGameOfPlayer(org.bukkit.entity.Player player)
      Parameters:
      player - Player
      Returns:
      Player's Game or null if player isn't in game
    • getGameWithHighestPlayers

      Game getGameWithHighestPlayers()
      Returns:
      Free game that has highest players in it
    • getGameWithLowestPlayers

      Game getGameWithLowestPlayers()
      Returns:
      Free game that has lowest players in it
    • isPlayerPlayingAnyGame

      boolean isPlayerPlayingAnyGame(org.bukkit.entity.Player player)
      Parameters:
      player - Player
      Returns:
      true if player is in any game
    • getItemSpawnerTypes

      List<ItemSpawnerType> getItemSpawnerTypes()
      Returns:
      List of existing spawner types
    • isItemSpawnerTypeRegistered

      boolean isItemSpawnerTypeRegistered(String name)
      Parameters:
      name - Name of item spawner type
      Returns:
      boolean Is spawner type registered
    • getItemSpawnerTypeByName

      ItemSpawnerType getItemSpawnerTypeByName(String name)
      Parameters:
      name - Name of item spawner type
      Returns:
      ItemSpawnerType by name or null if type isn't exists
    • isEntityInGame

      boolean isEntityInGame(org.bukkit.entity.Entity entity)
      Parameters:
      entity - Entity
      Returns:
      true if entity is in game
    • getGameOfEntity

      Game getGameOfEntity(org.bukkit.entity.Entity entity)
      Parameters:
      entity - Entity
      Returns:
      Game of entity or null
    • getFirstWaitingGame

      Game getFirstWaitingGame()
      Returns:
      Game in waiting state or null
    • getFirstRunningGame

      Game getFirstRunningGame()
      Returns:
      Game in running state or null
    • registerEntityToGame

      void registerEntityToGame(org.bukkit.entity.Entity entity, Game game)
      Parameters:
      entity - Entity
      game - Game
    • unregisterEntityFromGame

      void unregisterEntityFromGame(org.bukkit.entity.Entity entity)
      Parameters:
      entity - Entity
    • getPluginVersion

      String getPluginVersion()
      Returns:
      String of Bedwars Version
    • getColorChanger

      ColorChanger getColorChanger()
      Returns:
      Color changer for coloring ItemStacks
    • getHubServerName

      String getHubServerName()
      Returns:
      hub server name from config
    • getStatisticsManager

      PlayerStatisticsManager getStatisticsManager()
      Returns:
      PlayerStatisticsManager if statistics are enabled; otherwise null
    • openDefaultStore

      default void openDefaultStore(org.bukkit.entity.Player player)
      Opens the default store using the built-in shop system. It does not fire any event.

      The player should be in a game, otherwise the behaviour of this method is undefined. This method does not verify whether the player is playing BedWars.

      Unless you have a specific reason, you should use tryOpenDefaultStore(Player).

      Parameters:
      player - the player
      Since:
      0.2.38
      See Also:
    • openCustomStore

      default void openCustomStore(org.bukkit.entity.Player player, @Nullable @Nullable String fileName)
      Opens a custom store using the built-in shop system. It does not fire any event.

      The player should be in a game, otherwise the behaviour of this method is undefined. This method does not verify whether the player is playing BedWars.

      Unless you have a specific reason, you should use tryOpenCustomStore(Player, String).

      Parameters:
      fileName - the file name
      player - the player
      Since:
      0.2.38
      See Also:
    • openCustomStore

      void openCustomStore(org.bukkit.entity.Player player, @Nullable @Nullable String fileName, boolean useParent)
      Opens a custom store using the built-in shop system. It does not fire any event.

      The player should be in a game, otherwise the behaviour of this method is undefined. This method does not verify whether the player is playing BedWars.

      Unless you have a specific reason, you should use tryOpenCustomStore(Player, String, boolean).

      Parameters:
      fileName - the file name
      player - the player
      useParent - whether should the parent be used
      Since:
      0.2.38
      See Also:
    • tryOpenStore

      @Nullable BedwarsOpenShopEvent.Result tryOpenStore(org.bukkit.entity.Player player, GameStore gameStore)
      Tries opening a store using the provided GameStore instance.

      It fires the BedwarsOpenShopEvent, giving plugins the ability to cancel the request or replace the shop system.

      The player must be in a game, otherwise this method simply returns null.

      Parameters:
      player - the player
      gameStore - the game store
      Returns:
      result of the fired event or null on failure
      Since:
      0.2.39
    • tryOpenDefaultStore

      default @Nullable BedwarsOpenShopEvent.Result tryOpenDefaultStore(org.bukkit.entity.Player player)
      Tries opening a default store.

      It fires the BedwarsOpenShopEvent, giving plugins the ability to cancel the request or replace the shop system.

      The player must be in a game, otherwise this method simply returns null.

      Parameters:
      player - the player
      Returns:
      result of the fired event or null on failure
      Since:
      0.2.39
    • tryOpenCustomStore

      default @Nullable BedwarsOpenShopEvent.Result tryOpenCustomStore(org.bukkit.entity.Player player, String fileName)
      Tries opening a custom store.

      It fires the BedwarsOpenShopEvent, giving plugins the ability to cancel the request or replace the shop system.

      The player must be in a game, otherwise this method simply returns null.

      Parameters:
      player - the player
      fileName - the file name
      Returns:
      result of the fired event or null on failure
      Since:
      0.2.39
    • tryOpenCustomStore

      @Nullable BedwarsOpenShopEvent.Result tryOpenCustomStore(org.bukkit.entity.Player player, String fileName, boolean useParent)
      Tries opening a custom store.

      It fires the BedwarsOpenShopEvent, giving plugins the ability to cancel the request or replace the shop system.

      The player must be in a game, otherwise this method simply returns null.

      Parameters:
      player - the player
      fileName - the file name
      useParent - whether should the parent be used
      Returns:
      result of the fired event or null on failure
      Since:
      0.2.39
    • getInstance

      static BedwarsAPI getInstance()
      Returns:
      Bedwars instance