File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed
minecraft-patches/sources/net/minecraft/server
src/main/java/de/pascalpex/deepslatemc/files Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 3535 }
3636
3737 public SystemReport fillSystemReport(SystemReport systemReport) {
38+ @@ -2038,7 +_,18 @@
39+
40+ public void setMotd(String motd) {
41+ // Paper start - Adventure
42+ - this.motd = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserializeOr(motd, net.kyori.adventure.text.Component.empty());
43+ + // Deepslate start - MiniMessage MOTD
44+ + if(de.pascalpex.deepslatemc.files.Config.getMinimessageMotd()) {
45+ + try {
46+ + this.motd = net.kyori.adventure.text.minimessage.MiniMessage.miniMessage().deserializeOr(motd, net.kyori.adventure.text.Component.empty());
47+ + } catch (net.kyori.adventure.text.minimessage.internal.parser.ParsingExceptionImpl e) {
48+ + org.bukkit.Bukkit.getLogger().warning("You have enabled DeepslateMC's miniMessageMotdSupport but your motd contains legacy color codes. Will fallback to legacy colors.");
49+ + this.motd = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserializeOr(motd, net.kyori.adventure.text.Component.empty());
50+ + }
51+ + } else {
52+ + this.motd = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserializeOr(motd, net.kyori.adventure.text.Component.empty());
53+ + }
54+ + // Deepslate end - MiniMessage MOTD
55+ }
56+
57+ public net.kyori.adventure.text.Component motd() {
Original file line number Diff line number Diff line change @@ -148,5 +148,8 @@ public static boolean getActionbarEnabled() {
148148 public static String getActionbarText () {
149149 return config .getString (ACTIONBAR_TEXT .key );
150150 }
151+ public static boolean getMinimessageMotd () {
152+ return config .getBoolean (MINIMESSAGE_MOTD .key );
153+ }
151154
152155}
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ enum ConfigEntry {
3131 BOSSBAR_STYLE ("bossbar" + ".style" , BossBar .Overlay .PROGRESS .name ()),
3232 BOSSBAR_TEXT ("bossbar" + ".text" , "&6Custom Bossbar" ),
3333 ACTIONBAR_ENABLED ("actionbar" + ".enabled" , false ),
34+ MINIMESSAGE_MOTD ("miniMessageMotdSupport" , false ),
3435 ACTIONBAR_TEXT ("actionbar" + ".text" , "&6Custom Actionbar" );
3536
3637 final String key ;
You can’t perform that action at this time.
0 commit comments