Skip to content

Commit 980ecbb

Browse files
TrentinTheKidItsNature
authored andcommitted
update serverlink docs
1 parent f10dbf5 commit 980ecbb

3 files changed

Lines changed: 26 additions & 51 deletions

File tree

docs/developers/modules/serverlink.mdx

Lines changed: 25 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@ import { Tab, Tabs } from 'nextra-theme-docs'
44

55
## Overview
66

7-
TODO
7+
The server link module provides enhancements and additional support to the vanilla Minecraft server link feature. Display your important URLs directly to your users.
8+
9+
- Adds improvements to the existing server link features
10+
- Ability to set a custom image title resource for the server links menu
11+
- Ability to use chat colors and formats for button names
12+
- Backported legacy version support for all versions below 1.21
13+
14+
![Server Link Module Example](/modules/serverlink/overview.png#center)
815

916
## Integration
1017

@@ -89,64 +96,32 @@ public void resetServerLinksExample(Player viewer) {
8996
}
9097
```
9198

92-
### `Hologram` Options
93-
94-
`.id(String)` should include a unique identifier for the hologram.
95-
96-
```java
97-
.id("welcome-hologram")
98-
```
99-
100-
`.location(ApolloLocation)` is using the `ApolloLocation` builder to create the location. See the [locations page](/apollo/developers/utilities/locations) for more.
101-
102-
```java
103-
.location(ApolloLocation.builder()
104-
.world("world")
105-
.x(5)
106-
.y(100)
107-
.z(0)
108-
.build()
109-
)
110-
```
99+
### `ServerLink` Options
111100

112-
`.lines(Component)` should be a string, or an Adventure `Component`. See the [chat components](https://docs.advntr.dev/text.html) page for more.
101+
`.id(String)` sets a unique identifier for the server link.
113102

114103
```java
115-
.lines(List.of(
116-
Component.text()
117-
.content("Welcome to my server!")
118-
.color(NamedTextColor.RED)
119-
.decorate(TextDecoration.BOLD, TextDecoration.UNDERLINED)
120-
.build(),
121-
Component.text()
122-
.content("Type /help to get started!")
123-
.build()
124-
))
104+
.id("website")
125105
```
126106

127-
`.showThroughWalls(Boolean)` if the player is able to see the hologram through walls.
107+
`.displayName(String)` is the public-facing name of the server link. It should contain a string or an Adventure `Component`. See the [chat components](https://docs.advntr.dev/text.html) page for more.
128108

129109
```java
130-
.showThroughWalls(true)
110+
.displayName(Component.text("Website", NamedTextColor.LIGHT_PURPLE))
131111
```
132112

133-
`.showShadow(Boolean)` if the player is able to see the hologram shadow.
113+
`.url(String)` should be a string that specifies the destination URL that will be opened from the server link.
134114

135115
```java
136-
.showShadow(false)
116+
.url("https://www.lunarclient.com/")
137117
```
138118

139-
`.showBackground(Boolean)` if the player is able to see the hologram background.
140-
141-
```java
142-
.showBackground(true)
143-
```
144119

145120
</Tab>
146121

147122
<Tab>
148123

149-
### Override the Server Link Menu resource
124+
**Override the Server Link Menu resource**
150125

151126
```java
152127
public void overrideServerLinkResourceExample(Player viewer) {
@@ -158,7 +133,7 @@ public void overrideServerLinkResourceExample(Player viewer) {
158133
}
159134
```
160135

161-
### Reset the Server Link Menu resource
136+
**Reset the Server Link Menu resource**
162137

163138
```java
164139
public void resetServerLinkResourceExample(Player viewer) {
@@ -167,7 +142,7 @@ public void resetServerLinkResourceExample(Player viewer) {
167142
}
168143
```
169144

170-
### Add Server Link
145+
**Add Server Link**
171146

172147
```java
173148
public void addServerLinkExample(Player viewer) {
@@ -200,7 +175,7 @@ public void addServerLinkExample(Player viewer) {
200175
}
201176
```
202177

203-
### Remove Server Link
178+
**Remove Server Link**
204179

205180
```java
206181
public void removeServerLinkExample(Player viewer) {
@@ -214,7 +189,7 @@ public void removeServerLinkExample(Player viewer) {
214189
}
215190
```
216191

217-
### Resetting all Server Links
192+
**Resetting all Server Links**
218193

219194
```java
220195
public void resetServerLinksExample(Player viewer) {
@@ -227,7 +202,7 @@ public void resetServerLinksExample(Player viewer) {
227202

228203
<Tab>
229204

230-
### Override the Server Link Menu resource
205+
**Override the Server Link Menu resource**
231206

232207
```java
233208
public void overrideServerLinkResourceExample(Player viewer) {
@@ -239,7 +214,7 @@ public void overrideServerLinkResourceExample(Player viewer) {
239214
}
240215
```
241216

242-
### Reset the Server Link Menu resource
217+
**Reset the Server Link Menu resource**
243218

244219
```java
245220
public void resetServerLinkResourceExample(Player viewer) {
@@ -250,7 +225,7 @@ public void resetServerLinkResourceExample(Player viewer) {
250225
}
251226
```
252227

253-
### Add Server Link
228+
**Add Server Link**
254229

255230
```java
256231
public void addServerLinkExample(Player viewer) {
@@ -276,7 +251,7 @@ private JsonObject createServerLinkObject(String id, Component displayName, Stri
276251
}
277252
```
278253

279-
### Remove Server Link
254+
**Remove Server Link**
280255

281256
```java
282257
public void removeServerLinkExample(Player viewer) {
@@ -291,7 +266,7 @@ public void removeServerLinkExample(Player viewer) {
291266
}
292267
```
293268

294-
### Resetting all Server Links
269+
**Resetting all Server Links**
295270

296271
```java
297272
public void resetServerLinksExample(Player viewer) {
108 KB
Loading

example/bukkit/api/src/main/java/com/lunarclient/apollo/example/api/module/NotificationApiExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void displayNotificationExample(Player viewer) {
5151
.append(Component.newline())
5252
.append(Component.text("Good luck!", NamedTextColor.GOLD))
5353
)
54-
.resourceLocation("icons/golden_apple.png") // This field is optional
54+
.resourceLocation("textures/items/apple_golden.png") // This field is optional
5555
.displayTime(Duration.ofSeconds(5))
5656
.build());
5757
});

0 commit comments

Comments
 (0)