Package org.bukkit

Interface ServerLinks


@Experimental public interface ServerLinks
Represents a collections of links which may be sent to a client.
  • Method Details

    • getLink

      @Nullable ServerLinks.ServerLink getLink(@NotNull ServerLinks.Type type)
      Gets the link of a given type, if it exists.
      Parameters:
      type - link type
      Returns:
      link or null
    • getLinks

      @NotNull List<ServerLinks.ServerLink> getLinks()
      Gets an immutable list of all links.
      Returns:
      immutable list
    • setLink

      @NotNull ServerLinks.ServerLink setLink(@NotNull ServerLinks.Type type, @NotNull URI url)
      Adds the given link, overwriting the first link of the same type if already set.
      Parameters:
      type - link type
      url - link url
      Returns:
      the added link
    • addLink

      @NotNull ServerLinks.ServerLink addLink(@NotNull ServerLinks.Type type, @NotNull URI url)
      Adds the given link to the list of links.
      Parameters:
      type - link type
      url - link url
      Returns:
      the added link
    • addLink

      @NotNull ServerLinks.ServerLink addLink(@NotNull String displayName, @NotNull URI url)
      Adds the given link to the list of links.
      Parameters:
      displayName - link name / display text
      url - link url
      Returns:
      the added link
    • removeLink

      boolean removeLink(@NotNull ServerLinks.ServerLink link)
      Removes the given link.
      Parameters:
      link - the link to remove
      Returns:
      if the link existed and was removed
    • copy

      @NotNull ServerLinks copy()
      Returns a copy of this link collection, unassociated from the server.
      Returns:
      copied links