Skip to content

Commit 2406365

Browse files
committed
Update defaults and introduce previously missing motd-hover migration
1 parent 0f0abd6 commit 2406365

2 files changed

Lines changed: 55 additions & 9 deletions

File tree

proxy/src/main/java/com/velocityctd/proxy/config/migration/CtdConfigMigrations.java

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,30 @@ public class CtdConfigMigrations {
2727
public static List<ConfigurationMigration> createCtdMigrations() {
2828
return List.of(
2929
// root
30+
migration(
31+
"Shown when hovering over the player count in the server list. Accepts a list of lines, and\n"
32+
+ " supports the same placeholders as \"fallback-version-ping\" plus the \"{players}\" placeholder.\n"
33+
+ "\n"
34+
+ " \"{players}\" lists online players. By default it shows a random selection, which is the Notchian\n"
35+
+ " (vanilla) behavior. Setting motd-hover = [\"{players}\"] reproduces the vanilla player tooltip.\n"
36+
+ " It accepts optional arguments written as \"{players:arg=value:arg2=value}\":\n"
37+
+ " - max: maximum number of players to list.\n"
38+
+ " - maxPerLine: maximum number of players listed per line.\n"
39+
+ " - ordering: how players are picked and ordered. One of:\n"
40+
+ " - RANDOM: a random selection (Notchian behavior).\n"
41+
+ " - ALPHABETICAL: sorted A-Z by name.\n"
42+
+ " - ALPHABETICAL_REVERSED: sorted Z-A by name.\n"
43+
+ " - LAST_JOINED: most recently joined players first.\n"
44+
+ " - FIRST_JOINED: longest-connected players first.\n"
45+
+ " - empty: text shown when no players are online.\n"
46+
+ " - prefix: text inserted before each player name.\n"
47+
+ " - separator: text inserted between player names (trimmed at the end of each line).\n"
48+
+ " Example: \"{players:max=10:maxPerLine=2:ordering=ALPHABETICAL:separator=<gray>, }\"",
49+
"motd-hover",
50+
List.of(
51+
"<gray>Players online: <white>{player-count}</white>/<white>{max-players}</white></gray>",
52+
"{players}")
53+
),
3054
migration(
3155
"Whether chat signing should be enforced. If disabled, backend servers MUST disable chat signing.",
3256
"enforce-chat-signing",
@@ -160,7 +184,9 @@ public static List<ConfigurationMigration> createCtdMigrations() {
160184
migration(
161185
"Modifies the brand and server version that displays in the multiplayer menu and status pingers.\n"
162186
+ " Supports placeholders: {protocol-min}, {protocol-max}, {protocol}, {proxy-brand},\n"
163-
+ " {proxy-brand-custom}, {proxy-version}, {proxy-vendor}, {player-count}, {max-players}.",
187+
+ " {proxy-brand-custom}, {proxy-version}, {proxy-vendor}, {player-count}, {max-players}.\n"
188+
+ " These placeholders are also available in \"motd\" and \"motd-hover\", and the\n"
189+
+ " \"{players}\" placeholder (documented under \"motd-hover\") may be used here as well.",
164190
"advanced.fallback-version-ping",
165191
"{proxy-brand} {protocol-min}-{protocol-max}"
166192
),

proxy/src/main/resources/default-velocity.toml

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,34 @@ config-version = "2.9"
44
# What port should the proxy be bound to? By default, we'll bind to all addresses on port 25565.
55
bind = "0.0.0.0:25565"
66

7-
# What should be the MOTD? This gets displayed when the player adds your server to
8-
# their server list.
9-
motd = "<#ff3a4c>A Velocity-CTD Server"
7+
# The MOTD shown in the server list when a player adds your server. Accepts a list of lines.
8+
# Supports the "{players}" placeholder (documented under "motd-hover") as well as the other
9+
# placeholders listed under "fallback-version-ping".
10+
motd = [
11+
"<#ff3a4c>A Velocity-CTD Server"
12+
]
1013

11-
# What should it look like when you hover over the player count? This is
12-
# displayed when hovering over the player count/max players' tooltip and
13-
# only supports the legacy colors due to Minecraft limitations.
14+
# Shown when hovering over the player count in the server list. Accepts a list of lines, and
15+
# supports the same placeholders as "fallback-version-ping" plus the "{players}" placeholder.
16+
#
17+
# "{players}" lists online players. By default it shows a random selection, which is the Notchian
18+
# (vanilla) behavior. Setting motd-hover = ["{players}"] reproduces the vanilla player tooltip.
19+
# It accepts optional arguments written as "{players:arg=value:arg2=value}":
20+
# - max: maximum number of players to list.
21+
# - maxPerLine: maximum number of players listed per line.
22+
# - ordering: how players are picked and ordered. One of:
23+
# - RANDOM: a random selection (Notchian behavior).
24+
# - ALPHABETICAL: sorted A-Z by name.
25+
# - ALPHABETICAL_REVERSED: sorted Z-A by name.
26+
# - LAST_JOINED: most recently joined players first.
27+
# - FIRST_JOINED: longest-connected players first.
28+
# - empty: text shown when no players are online.
29+
# - prefix: text inserted before each player name.
30+
# - separator: text inserted between player names (trimmed at the end of each line).
31+
# Example: "{players:max=10:maxPerLine=2:ordering=ALPHABETICAL:separator=<gray>, }"
1432
motd-hover = [
15-
"<red>A Velocity-CTD Tooltip",
16-
"<aqua>that shows more information!"
33+
"<gray>Players online: <white>{player-count}</white>/<white>{max-players}</white></gray>",
34+
"{players}"
1735
]
1836

1937
# What should we display for the maximum number of players? (Velocity does not support a cap
@@ -377,6 +395,8 @@ custom-brand-backend = "Paper"
377395
# the proxy or to all available proxies on Redis.
378396
# - "{max-players}": Returns the total number of players that displays
379397
# to the proxy or to all available proxies on Redis.
398+
# These placeholders are also available in "motd" and "motd-hover". The "{players}" placeholder
399+
# (documented under "motd-hover") may be used here as well.
380400
fallback-version-ping = "{proxy-brand} {protocol-min}-{protocol-max}"
381401

382402
# Instead of "fallback-version-ping" exclusively returning when the

0 commit comments

Comments
 (0)