Interface BedwarsAPI
-
Method Summary
Modifier and TypeMethodDescriptiongetGameByName
(String name) getGameOfEntity
(org.bukkit.entity.Entity entity) getGameOfPlayer
(org.bukkit.entity.Player player) getGames()
static BedwarsAPI
boolean
isEntityInGame
(org.bukkit.entity.Entity entity) boolean
isGameWithNameExists
(String name) boolean
boolean
isPlayerPlayingAnyGame
(org.bukkit.entity.Player player) default void
openCustomStore
(org.bukkit.entity.Player player, @Nullable String fileName) Opens a custom store using the built-in shop system.void
openCustomStore
(org.bukkit.entity.Player player, @Nullable String fileName, boolean useParent) Opens a custom store using the built-in shop system.default void
openDefaultStore
(org.bukkit.entity.Player player) Opens the default store using the built-in shop system.void
registerEntityToGame
(org.bukkit.entity.Entity entity, Game game) default @Nullable BedwarsOpenShopEvent.Result
tryOpenCustomStore
(org.bukkit.entity.Player player, String fileName) Tries opening a custom store.@Nullable BedwarsOpenShopEvent.Result
tryOpenCustomStore
(org.bukkit.entity.Player player, String fileName, boolean useParent) Tries opening a custom store.default @Nullable BedwarsOpenShopEvent.Result
tryOpenDefaultStore
(org.bukkit.entity.Player player) Tries opening a default store.@Nullable BedwarsOpenShopEvent.Result
tryOpenStore
(org.bukkit.entity.Player player, GameStore gameStore) Tries opening a store using the provided GameStore instance.void
unregisterEntityFromGame
(org.bukkit.entity.Entity entity)
-
Method Details
-
getGames
- Returns:
- List of available games
-
isGameWithNameExists
- Parameters:
name
- Name of game- Returns:
- true if game is exists
-
getGameByName
- Parameters:
name
- Name of game- Returns:
- Game or null if game is not exists
-
getGameOfPlayer
- 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
- Parameters:
name
- Name of item spawner type- Returns:
- boolean Is spawner type registered
-
getItemSpawnerTypeByName
- 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
- 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
- Parameters:
entity
- Entitygame
- 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
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 nameplayer
- 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 nameplayer
- the playeruseParent
- 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 playergameStore
- the game store- Returns:
- result of the fired event or null on failure
- Since:
- 0.2.39
-
tryOpenDefaultStore
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 playerfileName
- 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 playerfileName
- the file nameuseParent
- whether should the parent be used- Returns:
- result of the fired event or null on failure
- Since:
- 0.2.39
-
getInstance
- Returns:
- Bedwars instance
-