Class SidebarRender

java.lang.Object
dev.itsharshxd.zentrix.api.scoreboard.SidebarRender

public final class SidebarRender extends Object
One sidebar about to be shown to one player, which a SidebarContributor may change.

Title and lines are rendered text in Zentrix's colour format (& codes and &#RRGGBB hex colours), with Zentrix's own placeholders and PlaceholderAPI already resolved. A sidebar shows at most 15 lines; extra lines are dropped. Text a contributor adds is shown as written, so it must respect identity masking itself - use the player's display name rather than their real one.

Since:
1.8.0
  • Field Details

    • MAX_LINES

      public static final int MAX_LINES
      The most lines a sidebar can show.
      See Also:
  • Constructor Details

    • SidebarRender

      public SidebarRender(@NotNull @NotNull org.bukkit.entity.Player player, @Nullable @Nullable ZentrixGame game, @NotNull @NotNull String title, @NotNull @NotNull List<String> lines)
  • Method Details

    • getPlayer

      @NotNull public @NotNull org.bukkit.entity.Player getPlayer()
      The player who will see the sidebar.
    • getGame

      @NotNull public @NotNull Optional<ZentrixGame> getGame()
      The match the player is in or spectates; empty for the lobby sidebar and anywhere outside a match.
    • getTitle

      @NotNull public @NotNull String getTitle()
      The title.
    • setTitle

      public void setTitle(@NotNull @NotNull String title)
      Replaces the title.
    • getLines

      @NotNull public @NotNull List<String> getLines()
      The lines, top to bottom; listeners may change the list. Null entries are not allowed.