Class SwitchableLeaderboard

java.lang.Object
com.maximde.hologramlib.hologram.custom.SwitchableLeaderboard
All Implemented Interfaces:
HologramManager.Events

@Experimental public class SwitchableLeaderboard extends Object implements HologramManager.Events
An advanced leaderboard system that supports: - Multiple stat modes (e.g., Wins, Kills, Deaths) - Customizable state buttons with any number of states - Independent pagination for each stat mode - Flexible button positioning (above, below, beside the leaderboard) - Multiple state buttons that can be combined
  • Constructor Details

    • SwitchableLeaderboard

      public SwitchableLeaderboard(String baseId)
  • Method Details

    • validateId

      protected void validateId(String id)
    • addStatMode

      Adds a new stat mode to the leaderboard
      Parameters:
      statMode - The stat mode to add
      Returns:
      This SwitchableLeaderboard for chaining
    • addStateButton

      Adds a state button to the leaderboard
      Parameters:
      button - The button to add
      Returns:
      This SwitchableLeaderboard for chaining
    • init

      public void init(org.bukkit.Location location)
      Initializes and spawns the leaderboard at the specified location
    • nextPage

      public void nextPage(org.bukkit.entity.Player player)
      Goes to the next page for the specified player
    • previousPage

      public void previousPage(org.bukkit.entity.Player player)
      Goes to the previous page for the specified player
    • switchStatMode

      public void switchStatMode(org.bukkit.entity.Player player, String statModeId)
      Switches a player to a different stat mode
      Parameters:
      player - The player
      statModeId - The ID of the stat mode to switch to
    • refreshPlayerView

      public void refreshPlayerView(org.bukkit.entity.Player player)
      Refreshes the current view for a player based on their state
    • show

      public void show(org.bukkit.entity.Player player)
      Shows the leaderboard to a specific player
    • hide

      public void hide(org.bukkit.entity.Player player)
      Hides the leaderboard from a specific player
    • rotate

      @Experimental public SwitchableLeaderboard rotate(float x)
      Rotates the entire leaderboard system
    • teleport

      public SwitchableLeaderboard teleport(org.bukkit.Location location)
      Teleports the leaderboard to a new location
    • updateAll

      public void updateAll()
      Updates all pages in all stat modes
    • onJoin

      public void onJoin(org.bukkit.entity.Player player)
      Specified by:
      onJoin in interface HologramManager.Events
    • onQuit

      public void onQuit(org.bukkit.entity.Player player)
      Specified by:
      onQuit in interface HologramManager.Events
    • setArrowOffset

      public SwitchableLeaderboard setArrowOffset(double arrowOffset)
    • setArrowHeight

      public SwitchableLeaderboard setArrowHeight(double arrowHeight)
    • setLeftArrowText

      public SwitchableLeaderboard setLeftArrowText(String leftArrowText)
    • setRightArrowText

      public SwitchableLeaderboard setRightArrowText(String rightArrowText)
    • setInteractionBoxSize

      public SwitchableLeaderboard setInteractionBoxSize(Vector3F interactionBoxSize)
    • setNavigationSound

      public SwitchableLeaderboard setNavigationSound(org.bukkit.Sound sound, float volume, float pitch)
    • setStateChangeSound

      public SwitchableLeaderboard setStateChangeSound(org.bukkit.Sound sound, float volume, float pitch)
    • setArrowBackground

      public SwitchableLeaderboard setArrowBackground(int backgroundColor)
    • setArrowScale

      public SwitchableLeaderboard setArrowScale(Vector3F scale)
    • setArrowScale

      public SwitchableLeaderboard setArrowScale(float x, float y, float z)
    • getCurrentStatMode

      public String getCurrentStatMode(org.bukkit.entity.Player player)
      Gets the current stat mode for a player
    • getCurrentPage

      public int getCurrentPage(org.bukkit.entity.Player player)
      Gets the current page for a player
    • getButtonState

      public int getButtonState(org.bukkit.entity.Player player, String buttonId)
      Gets the current state of a button for a player
    • getAllHolograms

      public List<TextHologram> getAllHolograms()
      Gets all internal holograms (for registration with HologramManager)
    • getAllInteractionBoxes

      public List<InteractionBox> getAllInteractionBoxes()
      Gets all internal interaction boxes