Package com.andrei1058.bedwars.api.arena
Interface IArena
public interface IArena
-
Method Summary
Modifier and TypeMethodDescriptionvoidabandonGame(org.bukkit.entity.Player player) This is triggered when a player has abandoned a game.voidaddPlacedBlock(org.bukkit.block.Block block) Add placed block to cache.booleanaddPlayer(org.bukkit.entity.Player p, boolean skipOwnerCheck) Add a player to the arenavoidaddPlayerBedDestroyed(org.bukkit.entity.Player p) Deprecated.voidaddPlayerDeath(org.bukkit.entity.Player p) Deprecated.voidaddPlayerKill(org.bukkit.entity.Player p, boolean finalKill, org.bukkit.entity.Player victim) Deprecated.voidaddSign(org.bukkit.Location loc) Add a join sign for the arena.booleanaddSpectator(org.bukkit.entity.Player p, boolean playerBefore, org.bukkit.Location staffTeleport) Add a player as SpectatorvoidchangeStatus(GameState status) Change game status starting tasks.voidCheck winner.voidThis is used to destroy arena data when it restarts.voiddisable()Disable the arena.Get used world name.@Nullable ITeamgetBedsTeam(org.bukkit.Location location) Get owner team of a bed based on location.Get arena config.intGet the current diamond generator tier for this arena.getDisplayGroup(Language language) Get arena display group for given language.getDisplayGroup(org.bukkit.entity.Player player) Get arena display group for given player.Get the arena name as a message that can be used on signs etc.getDisplayStatus(Language lang) Get the display status for an arena.intGet the current emerald generator tier for this arena.Get the team where the player has played in current match.Gets the cooldowns for fireballsgetGroup()Get arena group.intGet the island radiusList<org.bukkit.entity.Player> intGet maximum players allowed in a team.intGet maximum allowed players amount.Get next event.Get the list of next events to come.Get Ore Generators.LinkedList<org.bukkit.util.Vector> List of placed blocks.intgetPlayerBedsDestroyed(org.bukkit.entity.Player p) Deprecated.intgetPlayerDeaths(org.bukkit.entity.Player p, boolean finalDeaths) Deprecated.intgetPlayerKills(org.bukkit.entity.Player p, boolean finalKills) Deprecated.List<org.bukkit.entity.Player> Get players in arena.getPlayerTeam(String playerName) Deprecated.intGet player render distance in blocks.org.bukkit.LocationGet re-spawning screen location.ConcurrentHashMap<org.bukkit.entity.Player, Integer> Get list of players in respawn screen.ConcurrentHashMap<org.bukkit.entity.Player, Integer> Get invisibility for armorList<org.bukkit.block.Block> getSigns()Get the join signs for this arenaorg.bukkit.LocationWhere spectators will spawn.List<org.bukkit.entity.Player> Get a list of spectators.@Nullable GameStatsHolderSession stats.Get arena status.Get a team by namegetTeam(org.bukkit.entity.Player player) Get the player's team.getTeams()intintorg.bukkit.LocationLocation where to spawn at join (waiting/ starting).@Nullable ITeamProvides the winner team.org.bukkit.WorldgetWorld()Get the arena worldinty limit for players to be able to build.int-1 won't handle void kill.voidinit(org.bukkit.World world) Initialize the arena after loading the world.booleanCheck if breaking map is allowed, otherwise only placed blocks are allowed.booleanbooleanisBlockPlaced(org.bukkit.block.Block block) booleanisPlayer(org.bukkit.entity.Player player) Check if user is playing.booleanisProtected(org.bukkit.Location location) Check if the given location is protected.default booleanisRespawning(org.bukkit.entity.Player p) Deprecated.booleanisReSpawning(UUID player) Check if a player is spectating on this arena.booleanisReSpawning(org.bukkit.entity.Player player) Check if a player is in re-spawning screen/ countdown.booleanisSpectator(UUID player) Check if a player is spectating on this arena.booleanisSpectator(org.bukkit.entity.Player player) Check if a player is spectating on this arena.booleanisTeamBed(org.bukkit.Location location) Check if there is a player bed at given location.voidRefresh signs.booleanreJoin(org.bukkit.entity.Player p) Rejoin an arenavoidremovePlacedBlock(org.bukkit.block.Block block) Remove placed block.voidremovePlayer(org.bukkit.entity.Player p, boolean disconnect) Remove a player from the arenavoidremoveSpectator(org.bukkit.entity.Player p, boolean disconnect) Remove a spectator from the arenavoidrestart()Restart the arena.voidShow upgrade announcement to players.voidShow upgrade announcement to players.voidsendPreGameCommandItems(org.bukkit.entity.Player p) This will give the pre-game command Items.voidsendSpectatorCommandItems(org.bukkit.entity.Player p) This will give the spectator command Items.voidsetAllowMapBreak(boolean allowMapBreak) Toggle map block break rule.voidsetAllowSpectate(boolean allowSpectate) voidvoidsetNextEvent(NextEvent nextEvent) Set next event for the arena.voidSet game status without starting stats.voidsetTeamAssigner(ITeamAssigner teamAssigner) voidsetWorldName(String name) Change world name for auto-scaling.booleanstartReSpawnSession(org.bukkit.entity.Player player, int seconds) Put a player in re-spawning countdown.voidThis will attempt to upgrade the next event if it is the case.voidupdateSpectatorCollideRule(org.bukkit.entity.Player p, boolean collide) Disable spectator collisions.
-
Method Details
-
isSpectator
boolean isSpectator(org.bukkit.entity.Player player) Check if a player is spectating on this arena. -
isSpectator
Check if a player is spectating on this arena. -
isReSpawning
Check if a player is spectating on this arena. -
getArenaName
String getArenaName()Get used world name. -
init
void init(org.bukkit.World world) Initialize the arena after loading the world. This needs to be called in order to allow players to join. -
getConfig
ConfigManager getConfig()Get arena config. -
isPlayer
boolean isPlayer(org.bukkit.entity.Player player) Check if user is playing. -
getSpectators
List<org.bukkit.entity.Player> getSpectators()Get a list of spectators. -
getTeam
Get the player's team. This will work if the player is alive only.Use
getExTeam(UUID)to get the team where the player has played in current match. -
getExTeam
Get the team where the player has played in current match. To be used if the player was eliminated. -
getDisplayName
String getDisplayName()Get the arena name as a message that can be used on signs etc.- Returns:
- A string with - and _ replaced by a space.
-
setWorldName
Change world name for auto-scaling.- Parameters:
name- new name.
-
getStatus
GameState getStatus()Get arena status. -
getPlayers
List<org.bukkit.entity.Player> getPlayers()Get players in arena. -
getMaxPlayers
int getMaxPlayers()Get maximum allowed players amount. -
getGroup
String getGroup()Get arena group. -
getMaxInTeam
int getMaxInTeam()Get maximum players allowed in a team. -
getRespawnSessions
ConcurrentHashMap<org.bukkit.entity.Player,Integer> getRespawnSessions()Get list of players in respawn screen. Player is the actual player in re-spawn screen. Integer is the remaining time. -
updateSpectatorCollideRule
void updateSpectatorCollideRule(org.bukkit.entity.Player p, boolean collide) Disable spectator collisions.- Parameters:
p- - spectator. Use false when the spectator got removed from the arena.
-
updateNextEvent
void updateNextEvent()This will attempt to upgrade the next event if it is the case. -
addPlayer
boolean addPlayer(org.bukkit.entity.Player p, boolean skipOwnerCheck) Add a player to the arena- Parameters:
p- - Player to add.skipOwnerCheck- - True if you want to skip the party checking for this player. This- Returns:
- true if was added.
-
addSpectator
boolean addSpectator(org.bukkit.entity.Player p, boolean playerBefore, org.bukkit.Location staffTeleport) Add a player as Spectator- Parameters:
p- Player to be addedplayerBefore- True if the player has played in this arena before and he died so now should be a spectator.
-
removePlayer
void removePlayer(org.bukkit.entity.Player p, boolean disconnect) Remove a player from the arena- Parameters:
p- Player to be removeddisconnect- True if the player was disconnected
-
removeSpectator
void removeSpectator(org.bukkit.entity.Player p, boolean disconnect) Remove a spectator from the arena- Parameters:
p- Player to be removeddisconnect- True if the player was disconnected
-
reJoin
boolean reJoin(org.bukkit.entity.Player p) Rejoin an arena- Returns:
- true if can rejoin
-
disable
void disable()Disable the arena. This will automatically kick/ remove the people from the arena. -
restart
void restart()Restart the arena. -
getWorld
org.bukkit.World getWorld()Get the arena world -
getDisplayStatus
Get the display status for an arena. A message that can be used on signs etc. -
getDisplayGroup
Get arena display group for given player.- Returns:
- translated group.
-
getDisplayGroup
Get arena display group for given language.- Returns:
- translated group.
-
getTeams
-
addPlacedBlock
void addPlacedBlock(org.bukkit.block.Block block) Add placed block to cache. So players will be able to remove blocks placed by players only. -
getFireballCooldowns
Gets the cooldowns for fireballs- Returns:
- The cooldowns for fireballs
-
removePlacedBlock
void removePlacedBlock(org.bukkit.block.Block block) Remove placed block. -
isBlockPlaced
boolean isBlockPlaced(org.bukkit.block.Block block) -
getPlayerKills
Deprecated.Get a player kills count.- Parameters:
p- Target playerfinalKills- True if you want to get the Final Kills. False for regular kills.
-
getStatsHolder
Session stats.- Returns:
- stats container for this game.
-
getPlayerBedsDestroyed
Deprecated.Get the player beds destroyed count- Parameters:
p- Target player
-
getSigns
List<org.bukkit.block.Block> getSigns()Get the join signs for this arena- Returns:
- signs.
-
getIslandRadius
int getIslandRadius()Get the island radius -
setGroup
-
setStatus
Set game status without starting stats. -
changeStatus
Change game status starting tasks. -
isRespawning
Deprecated.Check if target player is in re-spawning screen. -
addSign
void addSign(org.bukkit.Location loc) Add a join sign for the arena. -
refreshSigns
void refreshSigns()Refresh signs. -
addPlayerKill
@Deprecated void addPlayerKill(org.bukkit.entity.Player p, boolean finalKill, org.bukkit.entity.Player victim) Deprecated.Add a kill point to the game stats. -
addPlayerBedDestroyed
Deprecated.Add a destroyed bed point to the player temp stats. -
getPlayerTeam
Deprecated.Get arena by player name. Used to get the team for a player that has left the arena. Make sure the player is in this arena first. -
checkWinner
void checkWinner()Check winner. Will check if the game has a winner in certain conditions. Manage your win conditions. Call the arena restart and the needed stuff. -
addPlayerDeath
Deprecated.Add a kill to the player temp stats. -
setNextEvent
Set next event for the arena. -
getNextEvent
NextEvent getNextEvent()Get next event. -
sendPreGameCommandItems
void sendPreGameCommandItems(org.bukkit.entity.Player p) This will give the pre-game command Items. This will clear the inventory first. -
sendSpectatorCommandItems
void sendSpectatorCommandItems(org.bukkit.entity.Player p) This will give the spectator command Items. This will clear the inventory first. -
getTeam
Get a team by name -
getStartingTask
StartingTask getStartingTask() -
getPlayingTask
PlayingTask getPlayingTask() -
getRestartingTask
RestartingTask getRestartingTask() -
getOreGenerators
List<IGenerator> getOreGenerators()Get Ore Generators. -
getNextEvents
Get the list of next events to come. Not ordered. -
getPlayerDeaths
Deprecated.Get player deaths. -
sendDiamondsUpgradeMessages
void sendDiamondsUpgradeMessages()Show upgrade announcement to players. Change diamondTier value first. -
sendEmeraldsUpgradeMessages
void sendEmeraldsUpgradeMessages()Show upgrade announcement to players. Change emeraldTier value first. -
getPlaced
LinkedList<org.bukkit.util.Vector> getPlaced()List of placed blocks. -
destroyData
void destroyData()This is used to destroy arena data when it restarts. -
getUpgradeDiamondsCount
int getUpgradeDiamondsCount() -
getUpgradeEmeraldsCount
int getUpgradeEmeraldsCount() -
getRegionsList
-
getShowTime
ConcurrentHashMap<org.bukkit.entity.Player,Integer> getShowTime()Get invisibility for armor -
setAllowSpectate
void setAllowSpectate(boolean allowSpectate) -
isAllowSpectate
boolean isAllowSpectate() -
getWorldName
String getWorldName() -
getRenderDistance
int getRenderDistance()Get player render distance in blocks. -
startReSpawnSession
boolean startReSpawnSession(org.bukkit.entity.Player player, int seconds) Put a player in re-spawning countdown.- Parameters:
player- target player.seconds- countdown in seconds. 0 for instant re-spawn.- Returns:
- false if the player is not actually in game or if is in another re-spawn session.
-
isReSpawning
boolean isReSpawning(org.bukkit.entity.Player player) Check if a player is in re-spawning screen/ countdown. -
getReSpawnLocation
org.bukkit.Location getReSpawnLocation()Get re-spawning screen location. -
getSpectatorLocation
org.bukkit.Location getSpectatorLocation()Where spectators will spawn. -
getWaitingLocation
org.bukkit.Location getWaitingLocation()Location where to spawn at join (waiting/ starting). -
isProtected
boolean isProtected(org.bukkit.Location location) Check if the given location is protected. Border checks, regions, island spawn protection, npc protections, generator protections. -
abandonGame
void abandonGame(org.bukkit.entity.Player player) This is triggered when a player has abandoned a game. This should remove its assist from existing team and re-join session. This does not replaceremovePlayer(Player, boolean). -
getYKillHeight
int getYKillHeight()-1 won't handle void kill. Instant kill when player y is under this number. -
getYHeightLimit
int getYHeightLimit()y limit for players to be able to build. -
getStartTime
Instant getStartTime() -
getTeamAssigner
ITeamAssigner getTeamAssigner() -
setTeamAssigner
-
getLeavingPlayers
List<org.bukkit.entity.Player> getLeavingPlayers() -
isAllowMapBreak
boolean isAllowMapBreak()Check if breaking map is allowed, otherwise only placed blocks are allowed. Some blocks like have a special protections, like blocks under shopkeepers, bed, ecc. -
setAllowMapBreak
void setAllowMapBreak(boolean allowMapBreak) Toggle map block break rule. -
isTeamBed
boolean isTeamBed(org.bukkit.Location location) Check if there is a player bed at given location. -
getBedsTeam
Get owner team of a bed based on location. -
getWinner
Provides the winner team. This is populated on restarting phase. -
getDiamondTier
int getDiamondTier()Get the current diamond generator tier for this arena.- Returns:
- the diamond generator tier (e.g., 1, 2, 3, 4, ...)
-
getEmeraldTier
int getEmeraldTier()Get the current emerald generator tier for this arena.- Returns:
- the emerald generator tier (e.g., 1, 2, 3, 4, ...)
-