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 PlayerT
- BedWars TeamB
- BlockW
- WorldL
- LocationE
- EntityC
- Component WrapperS
- Game StoreG
- 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 Summary
Modifier and TypeMethodDescriptionint
int
int
int
int
int
countTeamChests
(T team) getActiveDelay
(P player, Class<? extends SpecialItem<?, ?, ?>> specialItem) getActiveDelaysOfPlayer
(P player) List<SpecialItem<?,
?, ?>> <I extends SpecialItem<?,
?, ?>>
List<I>getActiveSpecialItems
(Class<I> type) List<SpecialItem<?,
?, ?>> getActiveSpecialItemsOfPlayer
(P player) <I extends SpecialItem<?,
?, ?>>
List<I>getActiveSpecialItemsOfPlayer
(P player, Class<I> type) List<SpecialItem<?,
?, ?>> getActiveSpecialItemsOfTeam
(T team) <I extends SpecialItem<?,
?, ?>>
List<I>getActiveSpecialItemsOfTeam
(T team, Class<I> type) org.screamingsandals.lib.utils.Wrapper
boolean
Returns configuration container for this game@Nullable String
getFile()
Gets file with this gameSpecialItem<?,
?, ?> getFirstActiveSpecialItemOfPlayer
(P player) <I extends SpecialItem<?,
?, ?>>
IgetFirstActiveSpecialItemOfPlayer
(P player, Class<I> type) SpecialItem<?,
?, ?> <I extends SpecialItem<?,
?, ?>>
IgetFirstActiveSpecialItemOfTeam
(T team, Class<I> type) org.screamingsandals.lib.utils.Wrapper
int
@Nullable Variant
org.screamingsandals.lib.utils.Wrapper
int
int
int
getName()
getPos1()
getPos2()
int
StatusBar<?>
getTeamFromName
(String name) getTeamOfChest
(L location) getTeamOfPlayer
(P player) getUuid()
default boolean
default boolean
boolean
isBlockAddedDuringGame
(Object location) boolean
isDelayActive
(P player, Class<? extends SpecialItem<?, ?, ?>> specialItem) boolean
isEntityShop
(E entity) boolean
Checks if game is in edit modeboolean
isLocationInArena
(L location) boolean
isPlayerInAnyTeam
(P player) boolean
isPlayerInTeam
(P player, T team) boolean
isProtectionActive
(P player) boolean
isRegisteredSpecialItem
(SpecialItem<?, ?, ?> item) boolean
isTeamActive
(T team) void
joinToGame
(P player) void
leaveFromGame
(P player) void
registerDelay
(DelayFactory delayFactory) void
registerSpecialItem
(SpecialItem<?, ?, ?> item) void
This methods allows you to save the arena to config (useful when using custom config options)void
selectPlayerRandomTeam
(P player) void
selectPlayerTeam
(P player, T team) void
start()
void
stop()
void
unregisterDelay
(DelayFactory delayFactory) void
unregisterSpecialItem
(SpecialItem<?, ?, ?> item)
-
Method Details
-
getUuid
UUID getUuid()- Returns:
- arena's unique id
-
getName
String getName()- Returns:
- Arena name
-
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
- Parameters:
player
-
-
leaveFromGame
- Parameters:
player
-
-
selectPlayerTeam
- Parameters:
player
-team
-
-
selectPlayerRandomTeam
- 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
- Returns:
- list of players in game
-
getGameStores
- Returns:
- list of game stores
-
countGameStores
int countGameStores()- Returns:
-
getTeamFromName
- Returns:
- Team instance from the name
-
getAvailableTeams
- Returns:
-
countAvailableTeams
int countAvailableTeams()- Returns:
-
getActiveTeams
- Returns:
-
countActiveTeams
int countActiveTeams()- Returns:
-
getTeamOfPlayer
- Parameters:
player
-- Returns:
-
isPlayerInAnyTeam
- Parameters:
player
-- Returns:
-
isTeamActive
-
isPlayerInTeam
- Parameters:
player
-team
-- Returns:
-
isLocationInArena
- Parameters:
location
-- Returns:
-
isBlockAddedDuringGame
- Parameters:
location
-- Returns:
-
getActiveSpecialItems
List<SpecialItem<?,?, getActiveSpecialItems()?>> - Returns:
-
getActiveSpecialItems
- Parameters:
type
-- Returns:
-
getActiveSpecialItemsOfTeam
- Parameters:
team
-- Returns:
-
getActiveSpecialItemsOfTeam
- Parameters:
team
-type
-- Returns:
-
getFirstActiveSpecialItemOfTeam
- Parameters:
team
-- Returns:
-
getFirstActiveSpecialItemOfTeam
- Parameters:
team
-type
-- Returns:
-
getActiveSpecialItemsOfPlayer
- Parameters:
player
-- Returns:
-
getActiveSpecialItemsOfPlayer
- Parameters:
player
-type
-- Returns:
-
getFirstActiveSpecialItemOfPlayer
- Parameters:
player
-- Returns:
-
getFirstActiveSpecialItemOfPlayer
- Parameters:
player
-type
-- Returns:
-
getActiveDelays
List<DelayFactory> getActiveDelays()- Returns:
-
getActiveDelaysOfPlayer
- Parameters:
player
-- Returns:
-
getActiveDelay
- Parameters:
player
-specialItem
-- Returns:
-
registerDelay
- Parameters:
delayFactory
-
-
unregisterDelay
- Parameters:
delayFactory
-
-
isDelayActive
- Parameters:
player
-specialItem
-- Returns:
-
registerSpecialItem
- Parameters:
item
-
-
unregisterSpecialItem
- Parameters:
item
-
-
isRegisteredSpecialItem
- Parameters:
item
-- Returns:
-
getItemSpawners
- Returns:
-
getRegion
- Returns:
-
getStatusBar
StatusBar<?> getStatusBar()- Returns:
-
getLobbyWorld
W getLobbyWorld()- Returns:
-
getLobbySpawn
L getLobbySpawn()- Returns:
-
getLobbyCountdown
int getLobbyCountdown()- Returns:
-
countTeamChests
int countTeamChests()- Returns:
-
countTeamChests
- Parameters:
team
-- Returns:
-
getTeamOfChest
- Parameters:
location
-- Returns:
-
isEntityShop
- 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
- Returns:
-
getPostGameWaiting
int getPostGameWaiting() -
hasCustomPrefix
default boolean hasCustomPrefix() -
getCustomPrefix
String getCustomPrefix() -
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
- Returns:
- Since:
- 0.3.0
-
getLobbyPos2
- Returns:
- Since:
- 0.3.0
-