Package org.bukkit
Interface ServerLinks
Represents a collections of links which may be sent to a client.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Represents a server link.static enum
Represents a known type of link which will be translated by the client and may have special functionality. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Adds the given link to the list of links.addLink
(@NotNull ServerLinks.Type type, @NotNull URI url) Adds the given link to the list of links.copy()
Returns a copy of this link collection, unassociated from the server.getLink
(@NotNull ServerLinks.Type type) Gets the link of a given type, if it exists.getLinks()
Gets an immutable list of all links.boolean
Removes the given link.setLink
(@NotNull ServerLinks.Type type, @NotNull URI url) Adds the given link, overwriting the first link of the same type if already set.
-
Method Details
-
getLink
Gets the link of a given type, if it exists.- Parameters:
type
- link type- Returns:
- link or null
-
getLinks
Gets an immutable list of all links.- Returns:
- immutable list
-
setLink
@NotNull @NotNull ServerLinks.ServerLink setLink(@NotNull @NotNull ServerLinks.Type type, @NotNull @NotNull URI url) Adds the given link, overwriting the first link of the same type if already set.- Parameters:
type
- link typeurl
- link url- Returns:
- the added link
-
addLink
@NotNull @NotNull ServerLinks.ServerLink addLink(@NotNull @NotNull ServerLinks.Type type, @NotNull @NotNull URI url) Adds the given link to the list of links.- Parameters:
type
- link typeurl
- link url- Returns:
- the added link
-
addLink
@NotNull @NotNull ServerLinks.ServerLink addLink(@NotNull Component displayName, @NotNull @NotNull URI url) Adds the given link to the list of links.- Parameters:
displayName
- link name / display text Componenturl
- link url- Returns:
- the added link
-
addLink
@Deprecated @NotNull @NotNull ServerLinks.ServerLink addLink(@NotNull @NotNull String displayName, @NotNull @NotNull URI url) Deprecated.in favour ofaddLink(net.kyori.adventure.text.Component, URI)
Adds the given link to the list of links.- Parameters:
displayName
- link name / display texturl
- link url- Returns:
- the added link
-
removeLink
Removes the given link.- Parameters:
link
- the link to remove- Returns:
- if the link existed and was removed
-
copy
Returns a copy of this link collection, unassociated from the server.- Returns:
- copied links
-
addLink(net.kyori.adventure.text.Component, URI)