Use MOTD provided in Paper config, if it exists

This commit is contained in:
wordandahalf 2022-08-07 20:06:58 -05:00
parent 124b763b7c
commit fdc8aac894
No known key found for this signature in database
GPG Key ID: 0CFD762A8B682D9D

View File

@ -0,0 +1,23 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: wordandahalf <10679776+wordandahalf@users.noreply.github.com>
Date: Sun, 7 Aug 2022 20:06:23 -0500
Subject: [PATCH] Use MOTD provided in Paper config, if it exists
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index bfde5bbcccfaa754ec6bdf4f3817981a93e465bd..750ed134ebf520ce91f9ea3d4ead3a56b624b566 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2184,6 +2184,12 @@ public final class CraftServer implements Server {
// Paper start
@Override
public net.kyori.adventure.text.Component motd() {
+ net.kyori.adventure.text.Component paperMotd =
+ io.papermc.paper.configuration.GlobalConfiguration.get().messages.motd;
+
+ if (paperMotd != null)
+ return paperMotd;
+
return console.getComponentMotd();
}
// Paper end