Package com.andrei1058.bedwars.api.arena
Interface IArena
public interface IArena
-
Method Summary
Modifier and TypeMethodDescriptionvoid
abandonGame
(org.bukkit.entity.Player player) This is triggered when a player has abandoned a game.void
addPlacedBlock
(org.bukkit.block.Block block) Add placed block to cache.boolean
addPlayer
(org.bukkit.entity.Player p, boolean skipOwnerCheck) Add a player to the arenavoid
addPlayerBedDestroyed
(org.bukkit.entity.Player p) Deprecated.void
addPlayerDeath
(org.bukkit.entity.Player p) Deprecated.void
addPlayerKill
(org.bukkit.entity.Player p, boolean finalKill, org.bukkit.entity.Player victim) Deprecated.void
addSign
(org.bukkit.Location loc) Add a join sign for the arena.boolean
addSpectator
(org.bukkit.entity.Player p, boolean playerBefore, org.bukkit.Location staffTeleport) Add a player as Spectatorvoid
changeStatus
(GameState status) Change game status starting tasks.void
Check winner.void
This is used to destroy arena data when it restarts.void
disable()
Disable the arena.Get used world name.@Nullable ITeam
getBedsTeam
(org.bukkit.Location location) Get owner team of a bed based on location.Get arena config.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.Get the team where the player has played in current match.Gets the cooldowns for fireballsgetGroup()
Get arena group.int
Get the island radiusList<org.bukkit.entity.Player>
int
Get maximum players allowed in a team.int
Get 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.int
getPlayerBedsDestroyed
(org.bukkit.entity.Player p) Deprecated.int
getPlayerDeaths
(org.bukkit.entity.Player p, boolean finalDeaths) Deprecated.int
getPlayerKills
(org.bukkit.entity.Player p, boolean finalKills) Deprecated.List<org.bukkit.entity.Player>
Get players in arena.getPlayerTeam
(String playerName) Deprecated.int
Get player render distance in blocks.org.bukkit.Location
Get 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.Location
Where spectators will spawn.List<org.bukkit.entity.Player>
Get a list of spectators.@Nullable GameStatsHolder
Session stats.Get arena status.Get a team by namegetTeam
(org.bukkit.entity.Player player) Get the player's team.getTeams()
int
int
org.bukkit.Location
Location where to spawn at join (waiting/ starting).@Nullable ITeam
Provides the winner team.org.bukkit.World
getWorld()
Get the arena worldint
-1 won't handle void kill.void
init
(org.bukkit.World world) Initialize the arena after loading the world.boolean
Check if breaking map is allowed, otherwise only placed blocks are allowed.boolean
boolean
isBlockPlaced
(org.bukkit.block.Block block) boolean
isPlayer
(org.bukkit.entity.Player player) Check if user is playing.boolean
isProtected
(org.bukkit.Location location) Check if the given location is protected.default boolean
isRespawning
(org.bukkit.entity.Player p) Deprecated.boolean
isReSpawning
(UUID player) Check if a player is spectating on this arena.boolean
isReSpawning
(org.bukkit.entity.Player player) Check if a player is in re-spawning screen/ countdown.boolean
isSpectator
(UUID player) Check if a player is spectating on this arena.boolean
isSpectator
(org.bukkit.entity.Player player) Check if a player is spectating on this arena.boolean
isTeamBed
(org.bukkit.Location location) Check if there is a player bed at given location.void
Refresh signs.boolean
reJoin
(org.bukkit.entity.Player p) Rejoin an arenavoid
removePlacedBlock
(org.bukkit.block.Block block) Remove placed block.void
removePlayer
(org.bukkit.entity.Player p, boolean disconnect) Remove a player from the arenavoid
removeSpectator
(org.bukkit.entity.Player p, boolean disconnect) Remove a spectator from the arenavoid
restart()
Restart the arena.void
Show upgrade announcement to players.void
Show upgrade announcement to players.void
sendPreGameCommandItems
(org.bukkit.entity.Player p) This will give the pre-game command Items.void
sendSpectatorCommandItems
(org.bukkit.entity.Player p) This will give the spectator command Items.void
setAllowMapBreak
(boolean allowMapBreak) Toggle map block break rule.void
setAllowSpectate
(boolean allowSpectate) void
void
setNextEvent
(NextEvent nextEvent) Set next event for the arena.void
Set game status without starting stats.void
setTeamAssigner
(ITeamAssigner teamAssigner) void
setWorldName
(String name) Change world name for auto-scaling.boolean
startReSpawnSession
(org.bukkit.entity.Player player, int seconds) Put a player in re-spawning countdown.void
This will attempt to upgrade the next event if it is the case.void
updateSpectatorCollideRule
(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. -
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.
-