Package com.andrei1058.spigot.sidebar
Class WrappedSidebar
java.lang.Object
com.andrei1058.spigot.sidebar.WrappedSidebar
- All Implemented Interfaces:
Sidebar
-
Constructor Summary
ConstructorsConstructorDescriptionWrappedSidebar(@NotNull SidebarLine title, @NotNull Collection<SidebarLine> lines, Collection<PlaceholderProvider> placeholderProvider) Create a new versioned sidebar. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(org.bukkit.entity.Player player) Apply scoreboard to a player.voidaddLine(SidebarLine sidebarLine) Add a new line to the scoreboard.voidaddPlaceholder(PlaceholderProvider placeholderProvider) Add a new placeholder provider for sidebar lines.voidGet placeholder providers list.LinkedList<org.bukkit.entity.Player> voidHide players health previously shown withSidebar.showPlayersHealth(SidebarLine, boolean).intvoidRefresh bellow player-name animations (if making use ofSidebarLineAnimated) and if health is displayed viaSidebar.showPlayersHealth(SidebarLine, boolean).playerTabCreate(@NotNull String identifier, @Nullable org.bukkit.entity.Player player, SidebarLine prefix, SidebarLine suffix, PlayerTab.PushingRule pushingRule, @Nullable Collection<PlaceholderProvider> placeholders) Create a new tab list layout group.voidRefresh tab-list animations (if making use ofSidebarLineAnimated).voidRefresh animated lines.voidRefresh scoreboard placeholders where line is not animated.voidRefresh scoreboard title.voidremove(org.bukkit.entity.Player player) It is very important to call this when a player logs out or before deleting a scoreboard.voidremoveLine(int line) Remove a line from the scoreboard.voidremovePlaceholder(String placeholder) Remove a placeholder.voidRemove tab group form tab list by identifier.voidRemove all tab lists.voidsetLine(SidebarLine sidebarLine, int line) Set a line content.voidsetPlayerHealth(org.bukkit.entity.Player player, int health) Update player health if shown withSidebar.showPlayersHealth(SidebarLine, boolean).voidsetTitle(SidebarLine title) Set scoreboard title.voidshowPlayersHealth(SidebarLine displayName, boolean list) Show players name.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.andrei1058.spigot.sidebar.Sidebar
playerTabCreate
-
Constructor Details
-
WrappedSidebar
public WrappedSidebar(@NotNull @NotNull SidebarLine title, @NotNull @NotNull Collection<SidebarLine> lines, Collection<PlaceholderProvider> placeholderProvider) Create a new versioned sidebar.- Parameters:
title- sidebar title.lines- sidebar content.placeholderProvider- a list of your placeholders.
-
-
Method Details
-
setTitle
Description copied from interface:SidebarSet scoreboard title. It will send the update to players automatically. -
addPlaceholder
Description copied from interface:SidebarAdd a new placeholder provider for sidebar lines.- Specified by:
addPlaceholderin interfaceSidebar- Parameters:
placeholderProvider- placeholder.
-
addLine
Description copied from interface:SidebarAdd a new line to the scoreboard. -
setLine
Description copied from interface:SidebarSet a line content. Ignored if not exists. It will send the update to players automatically. -
add
public void add(org.bukkit.entity.Player player) Description copied from interface:SidebarApply scoreboard to a player. -
refreshPlaceholders
public void refreshPlaceholders()Description copied from interface:SidebarRefresh scoreboard placeholders where line is not animated. Can be used async. Does not refresh instances ofSidebarLineAnimated, useSidebar.refreshAnimatedLines()instead.- Specified by:
refreshPlaceholdersin interfaceSidebar
-
refreshTitle
public void refreshTitle()Description copied from interface:SidebarRefresh scoreboard title. Useful when you have an animated title. Can be used async.- Specified by:
refreshTitlein interfaceSidebar
-
refreshAnimatedLines
public void refreshAnimatedLines()Description copied from interface:SidebarRefresh animated lines. Title excluded. Can be used async.- Specified by:
refreshAnimatedLinesin interfaceSidebar
-
removeLine
public void removeLine(int line) Description copied from interface:SidebarRemove a line from the scoreboard. Ignored if line does not exist. Line 0 is the first from bottom. It will send the update to players automatically.- Specified by:
removeLinein interfaceSidebar- Parameters:
line- position. 0 is bottom.
-
clearLines
public void clearLines()- Specified by:
clearLinesin interfaceSidebar
-
lineCount
public int lineCount() -
removePlaceholder
Description copied from interface:SidebarRemove a placeholder.- Specified by:
removePlaceholderin interfaceSidebar- Parameters:
placeholder- placeholder to be removed.
-
getPlaceholders
Description copied from interface:SidebarGet placeholder providers list.- Specified by:
getPlaceholdersin interfaceSidebar- Returns:
- placeholder providers list.
-
remove
public void remove(org.bukkit.entity.Player player) Description copied from interface:SidebarIt is very important to call this when a player logs out or before deleting a scoreboard. -
setPlayerHealth
public void setPlayerHealth(org.bukkit.entity.Player player, int health) Description copied from interface:SidebarUpdate player health if shown withSidebar.showPlayersHealth(SidebarLine, boolean).- Specified by:
setPlayerHealthin interfaceSidebar- Parameters:
player- subject.health- amount.
-
getHealthObjective
-
getReceivers
-
hidePlayersHealth
public void hidePlayersHealth()Description copied from interface:SidebarHide players health previously shown withSidebar.showPlayersHealth(SidebarLine, boolean).- Specified by:
hidePlayersHealthin interfaceSidebar
-
showPlayersHealth
Description copied from interface:SidebarShow players name.- Specified by:
showPlayersHealthin interfaceSidebar- Parameters:
displayName- text under player name.list- show health scale on tab.
-
playerTabCreate
public PlayerTab playerTabCreate(@NotNull @NotNull String identifier, @Nullable @Nullable org.bukkit.entity.Player player, SidebarLine prefix, SidebarLine suffix, PlayerTab.PushingRule pushingRule, @Nullable @Nullable Collection<PlaceholderProvider> placeholders) Description copied from interface:SidebarCreate a new tab list layout group. Players added to this group will have the same prefix-suffix.- Specified by:
playerTabCreatein interfaceSidebar- Parameters:
identifier- char limit is 16.player- initial member. PAPI subject.prefix- prefix text or animation.suffix- suffix text or animation.pushingRule- how to manage pushing.placeholders- placeholders.- Returns:
- tab group instance.
-
removeTab
Description copied from interface:SidebarRemove tab group form tab list by identifier. -
removeTabs
public void removeTabs()Description copied from interface:SidebarRemove all tab lists.- Specified by:
removeTabsin interfaceSidebar
-
playerTabRefreshAnimation
public void playerTabRefreshAnimation()Description copied from interface:SidebarRefresh tab-list animations (if making use ofSidebarLineAnimated).- Specified by:
playerTabRefreshAnimationin interfaceSidebar
-
playerHealthRefreshAnimation
public void playerHealthRefreshAnimation()Description copied from interface:SidebarRefresh bellow player-name animations (if making use ofSidebarLineAnimated) and if health is displayed viaSidebar.showPlayersHealth(SidebarLine, boolean).- Specified by:
playerHealthRefreshAnimationin interfaceSidebar
-
getSidebarObjective
-