Skip to content

Support multi-line MOTDs natively via a string list in the config#1825

Open
WouterGritter wants to merge 1 commit into
PaperMC:dev/3.0.0from
WouterGritter:multiline-motd
Open

Support multi-line MOTDs natively via a string list in the config#1825
WouterGritter wants to merge 1 commit into
PaperMC:dev/3.0.0from
WouterGritter:multiline-motd

Conversation

@WouterGritter

@WouterGritter WouterGritter commented Jun 18, 2026

Copy link
Copy Markdown
Member

As the title says.

As a bonus, we get rid of the ugly FQDN instead of an import for Component in ProxyConfig and VelocityConfig, and ProxyConfig#getMotd's javadoc is updated to correctly reflect where the MOTD is actually being used.

I had first used a regex in MotdMultilineMigration to split on literal newline, \n <newline> and <br> (MM's newline tags) when migrating, but this seemed too intrusive. In its current state, this PR just migrates the existing string to a string list of size 1 and leaves it up to the user to split out into multiple lines.

}
final byte[] forwardingSecret = forwardingSecretString.getBytes(StandardCharsets.UTF_8);
final String motd = config.getOrElse("motd", "<#09add3>A Velocity Server");
final List<String> motd = config.getOrElse("motd", ImmutableList.of("<#09add3>A Velocity Server"));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be a good idea to add a validation check in case someone tries to add more than 2 lines

Comment on lines +36 to +39
String motd = config.get("motd");
config.set("motd", List.of(motd));

config.set("config-version", "2.9");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the migration will only happen once, it might be a good idea to migrate the use of \n or <newline>/<br> to a new line in the configuration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants