Interface ScoreboardLibrary
- All Known Implementing Classes:
NoopScoreboardLibrary
@NonExtendable
public interface ScoreboardLibrary
Entrypoint of the library. To create an instance of this interface, use
loadScoreboardLibrary(org.bukkit.plugin.Plugin).
For unit testing, take a look at NoopScoreboardLibrary.
Note: this class is thread-safe, meaning you can safely use it from multiple threads at a time.-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this scoreboard library instance.booleanclosed()@NotNull ObjectiveManagerCreates a newObjectiveManager.default @NotNull SidebarCreates a newSidebar;default @NotNull SidebarcreateSidebar(@org.jetbrains.annotations.Range(from=1L, to=2147483647L) int maxLines) Creates a newSidebar.@NotNull SidebarcreateSidebar(@org.jetbrains.annotations.Range(from=1L, to=2147483647L) int maxLines, @Nullable Locale locale) Creates a newSidebar.@NotNull TeamManagerCreates a newTeamManager.static @NotNull ScoreboardLibraryloadScoreboardLibrary(@NotNull org.bukkit.plugin.Plugin plugin) Creates an instance ofScoreboardLibrary.
-
Method Details
-
loadScoreboardLibrary
@NotNull static @NotNull ScoreboardLibrary loadScoreboardLibrary(@NotNull @NotNull org.bukkit.plugin.Plugin plugin) throws NoPacketAdapterAvailableException Creates an instance ofScoreboardLibrary.- Parameters:
plugin- your plugin instance- Throws:
NoPacketAdapterAvailableException- if there is no packet adapter available for the current server version
-
createSidebar
Creates a newSidebar;- Returns:
- newly created sidebar
-
createSidebar
@NotNull default @NotNull Sidebar createSidebar(@org.jetbrains.annotations.Range(from=1L, to=2147483647L) int maxLines) Creates a newSidebar.- Parameters:
maxLines- max amount of lines the sidebar will have. Note that vanilla clients can only display at most 15- Returns:
- newly created sidebar
-
createSidebar
@NotNull @NotNull Sidebar createSidebar(@org.jetbrains.annotations.Range(from=1L, to=2147483647L) int maxLines, @Nullable @Nullable Locale locale) Creates a newSidebar.- Parameters:
maxLines- max amount of lines the sidebar will have. Note that vanilla clients can only display at most 15locale- locale which will be used for translatingTranslatableComponents, or null if the locale should depend on the player- Returns:
- newly created sidebar
-
createTeamManager
Creates a newTeamManager.- Returns:
- newly created team manager
-
createObjectiveManager
Creates a newObjectiveManager.- Returns:
- newly created objective manager
-
close
void close()Closes this scoreboard library instance. You should call this inJavaPlugin.onDisable(). -
closed
boolean closed()- Returns:
- whether this scoreboard library instance is closed
-