Class ScoreboardHandler
java.lang.Object
de.marcely.bedwars.api.game.scoreboard.ScoreboardHandler
Manages the creation and termination of a scoreboard and what's getting displayed on the scoreboard
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
display
(Player player, Arena arena, ScoreboardType type) Displays the scoreboard to the player.protected abstract boolean
display0
(Player player, Arena arena, ScoreboardType type) Displays the scoreboard to the player.abstract Collection
<Player> Similar toisActive(Player)
, but returns all players to whom this applies to.abstract Plugin
Returns the plugin that initiated this instancefinal boolean
Hides the scoreboard from a player who's seeing itprotected abstract boolean
Hides the scoreboard from a player who's seeing itvoid
hideAll()
Similar tohide(Player)
, but does that for all active playersvoid
Similar tohide(Player)
, but does that for all players (including spectators) inside an arenaabstract boolean
Returns whether or not the scoreboard is active for a given player.final boolean
Returns if it's the ScoreboardHandler provided by MBedwarsfinal void
update
(ScoreboardUpdateCause cause, Arena arena, Object data) Updates a specific part of the scoreboardprotected abstract void
update0
(ScoreboardUpdateCause cause, Arena arena, Object data) Updates a specific part of the scoreboard
-
Constructor Details
-
ScoreboardHandler
public ScoreboardHandler()
-
-
Method Details
-
getPlugin
Returns the plugin that initiated this instance- Returns:
- The plugin backed by this handler
-
display0
protected abstract boolean display0(Player player, Arena arena, ScoreboardType type) throws Exception Displays the scoreboard to the player.Use
Arena.updateScoreboard()
to automatically do that for all players in an arena.- Parameters:
player
- The target to whom the scoreboard shall be shown toarena
- The arena in which the player is probably in. Will display the infos from that arenatype
- For what purpose the scorebord is getting displayed- Returns:
false
if it failed or the scoreboard is disabled for the arena's current state- Throws:
Exception
- MBedwars will handle occurring errors
-
hide0
Hides the scoreboard from a player who's seeing it- Parameters:
player
- The player from whom it shall be hidden- Returns:
false
if the player is already not seeing it. Otherwisetrue
- Throws:
Exception
- MBedwars will handle occurring errors
-
update0
protected abstract void update0(ScoreboardUpdateCause cause, Arena arena, Object data) throws Exception Updates a specific part of the scoreboard- Parameters:
cause
- What part shall be updatedarena
- The arena involved in the updatedata
- Data that comes with it- Throws:
Exception
- MBedwars will handle occurring errors
-
isActive
Returns whether or not the scoreboard is active for a given player. This does not mean that it's actually visible for him. It only means that the handler is processing the given player. Possibly an other plugin is overwritting the scoreboard or the handler just hasn't staerted yet.- Parameters:
player
- The player for who the scoreboard is possibly active- Returns:
true
when this handler is processing the given player
-
getActivePlayers
Similar toisActive(Player)
, but returns all players to whom this applies to.- Returns:
- All players that get processed by this handler
-
hideAll
Similar tohide(Player)
, but does that for all players (including spectators) inside an arena- Parameters:
arena
- The arena in which the players aren in
-
hideAll
public void hideAll()Similar tohide(Player)
, but does that for all active players -
display
Displays the scoreboard to the player.Use
Arena.updateScoreboard()
to automatically do that for all players in an arena.- Parameters:
player
- The target to whom the scoreboard shall be shown toarena
- The arena in which the player is probably in. Will display the infos from that arenatype
- For what purpose the scorebord is getting displayed- Returns:
false
if it failed or the scoreboard is disabled for the arena's current state
-
hide
Hides the scoreboard from a player who's seeing it- Parameters:
player
- The player from whom it shall be hidden- Returns:
false
if the player is already not seeing it. Otherwisetrue
-
update
Updates a specific part of the scoreboard- Parameters:
cause
- What part shall be updatedarena
- The arena involved in the updatedata
- Data that comes with it
-
isDefault
public final boolean isDefault()Returns if it's the ScoreboardHandler provided by MBedwars- Returns:
true
if it's the ScoreboardHandler provided by MBedwars
-