Class SwitchableLeaderboard
java.lang.Object
com.maximde.hologramlib.hologram.custom.SwitchableLeaderboard
- All Implemented Interfaces:
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a single state of a buttonstatic classRepresents a button that cycles through multiple states Can be positioned anywhere relative to the leaderboardstatic classRepresents a stat mode (e.g., "Wins", "Kills", "Deaths") Each stat mode has its own set of pages for pagination -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a state button to the leaderboardaddStatMode(SwitchableLeaderboard.StatMode statMode) Adds a new stat mode to the leaderboardGets all internal holograms (for registration with HologramManager)Gets all internal interaction boxesintgetButtonState(org.bukkit.entity.Player player, String buttonId) Gets the current state of a button for a playerintgetCurrentPage(org.bukkit.entity.Player player) Gets the current page for a playergetCurrentStatMode(org.bukkit.entity.Player player) Gets the current stat mode for a playervoidhide(org.bukkit.entity.Player player) Hides the leaderboard from a specific playervoidinit(org.bukkit.Location location) Initializes and spawns the leaderboard at the specified locationvoidnextPage(org.bukkit.entity.Player player) Goes to the next page for the specified playervoidonJoin(org.bukkit.entity.Player player) voidonQuit(org.bukkit.entity.Player player) voidpreviousPage(org.bukkit.entity.Player player) Goes to the previous page for the specified playervoidrefreshPlayerView(org.bukkit.entity.Player player) Refreshes the current view for a player based on their staterotate(float x) Rotates the entire leaderboard systemsetArrowBackground(int backgroundColor) setArrowHeight(double arrowHeight) setArrowOffset(double arrowOffset) setArrowScale(float x, float y, float z) setArrowScale(Vector3F scale) setInteractionBoxSize(Vector3F interactionBoxSize) setLeftArrowText(String leftArrowText) setNavigationSound(org.bukkit.Sound sound, float volume, float pitch) setRightArrowText(String rightArrowText) setStateChangeSound(org.bukkit.Sound sound, float volume, float pitch) voidshow(org.bukkit.entity.Player player) Shows the leaderboard to a specific playervoidswitchStatMode(org.bukkit.entity.Player player, String statModeId) Switches a player to a different stat modeteleport(org.bukkit.Location location) Teleports the leaderboard to a new locationvoidUpdates all pages in all stat modesprotected voidvalidateId(String id)
-
Constructor Details
-
SwitchableLeaderboard
-
-
Method Details
-
validateId
-
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
Switches a player to a different stat mode- Parameters:
player- The playerstatModeId- 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
Rotates the entire leaderboard system -
teleport
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:
onJoinin interfaceHologramManager.Events
-
onQuit
public void onQuit(org.bukkit.entity.Player player) - Specified by:
onQuitin interfaceHologramManager.Events
-
setArrowOffset
-
setArrowHeight
-
setLeftArrowText
-
setRightArrowText
-
setInteractionBoxSize
-
setStateChangeSound
-
setArrowBackground
-
setArrowScale
-
setArrowScale
-
getCurrentStatMode
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
Gets the current state of a button for a player -
getAllHolograms
Gets all internal holograms (for registration with HologramManager) -
getAllInteractionBoxes
Gets all internal interaction boxes
-