Class PlayerBoards

java.lang.Object
studio.magemonkey.codex.mccore.scoreboard.PlayerBoards

public class PlayerBoards extends Object
Scoreboard data for a player
  • Field Details

    • cycling

      protected boolean cycling
      Whether the player's scoreboard is cycling
  • Constructor Details

    • PlayerBoards

      public PlayerBoards(String playerName)
      Constructor
      Parameters:
      playerName - name of the player
  • Method Details

    • toggle

      public void toggle()
      Toggles visibility of the scoreboard
    • getPlayer

      public org.bukkit.entity.Player getPlayer()
      Returns:
      owning player reference
    • addBoard

      public void addBoard(Board board)
      Adds a scoreboard for the player
      Parameters:
      board - board to add
    • removeBoard

      public void removeBoard(Board board)
      Removes a board from a player
      Parameters:
      board - board to remove
    • removeBoards

      public void removeBoards(String plugin)
      Removes all boards from a plugin
      Parameters:
      plugin - plugin name
    • showBoard

      public boolean showBoard(String name)
      Shows a scoreboard for the player
      Parameters:
      name - name of the scoreboard
      Returns:
      true if successful, false otherwise
    • showNextBoard

      public void showNextBoard()
      Shows the next scoreboard
    • getBoard

      public Board getBoard(String name)
      Retrieves a board manager
      Parameters:
      name - scoreboard name
      Returns:
      board manager
    • getActiveBoard

      @Nullable public Board getActiveBoard()
      Gets the active board for the player
      Returns:
      active board
    • hasActiveBoard

      public boolean hasActiveBoard()
      Checks whether the player has an active scoreboard
      Returns:
      if the player has an active scoreboard
    • startCycling

      public void startCycling()
      Makes the player's scoreboard cycle
    • stopCycling

      public void stopCycling()
      Makes the player's scoreboard stop cycling
    • setHealthLabel

      @Deprecated public void setHealthLabel(String label)
      Deprecated.
      use BoardManager.setTextBelowNames instead
      Sets the health label for this player
      Parameters:
      label - health label
    • getBoards

      public List<Board> getBoards()
      Returns:
      the boards attached to the player
    • getPlayerName

      public String getPlayerName()
      Returns:
      name of the owning player
    • isCycling

      public boolean isCycling()
      Returns:
      true if cycling, false otherwise
    • isEnabled

      public boolean isEnabled()
      Returns:
      true if enabled, false otherwise