mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Cache server motd
This commit is contained in:
38
patches/server/0289-Cache-server-motd.patch
Normal file
38
patches/server/0289-Cache-server-motd.patch
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: BillyGalbreath <blake.galbreath@gmail.com>
|
||||||
|
Date: Fri, 22 Jul 2022 20:33:58 -0500
|
||||||
|
Subject: [PATCH] Cache server motd
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
|
index 2ece154b5e7daaa3e0b128145fc5e1d452125f72..7175c21e8094206f5fd33bdccd417613bdddffa3 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
|
@@ -1885,7 +1885,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
|
||||||
|
public void setMotd(String motd) {
|
||||||
|
this.motd = motd;
|
||||||
|
+ // Purpur start
|
||||||
|
+ this.motdComponent = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(motd);
|
||||||
|
+ }
|
||||||
|
+ public net.kyori.adventure.text.Component motd() {
|
||||||
|
+ return this.motdComponent;
|
||||||
|
}
|
||||||
|
+ private net.kyori.adventure.text.Component motdComponent;
|
||||||
|
+ // Purpur end
|
||||||
|
|
||||||
|
public boolean previewsChat() {
|
||||||
|
return false;
|
||||||
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
|
index 7208236ee3c604620fd0d0afe49215320e45e24b..ccd410d2fa62ab9f868f5d25d1a7418e4e6c485c 100644
|
||||||
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
|
@@ -2236,7 +2236,7 @@ public final class CraftServer implements Server {
|
||||||
|
// Paper start
|
||||||
|
@Override
|
||||||
|
public net.kyori.adventure.text.Component motd() {
|
||||||
|
- return net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(console.getMotd());
|
||||||
|
+ return console.motd(); // Purpur
|
||||||
|
}
|
||||||
|
// Paper end
|
||||||
|
@Override
|
||||||
Reference in New Issue
Block a user