File tree Expand file tree Collapse file tree
src/main/java/com/mosadie/servermainmenu Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88public interface MenuTheme {
99 String getId ();
1010 Identifier getPanorama ();
11- String getSplashText ();
11+ @ Deprecated
12+ default String getSplashText () {
13+ return null ;
14+ }
15+ Text getSplashAsText ();
1216
1317 boolean rollOdds ();
1418
Original file line number Diff line number Diff line change @@ -20,8 +20,8 @@ public Identifier getPanorama() {
2020 }
2121
2222 @ Override
23- public String getSplashText () {
24- return "Just a normal menu..." ;
23+ public Text getSplashAsText () {
24+ return Text . literal ( "Just a normal menu..." ) ;
2525 }
2626
2727 @ Override
Original file line number Diff line number Diff line change @@ -78,12 +78,15 @@ public static MenuTheme getTheme() {
7878
7979 private static ServerMainMenuLibConfig config ;
8080
81+ @ SuppressWarnings ("deprecation" )
8182 public static Text getSplashText () {
8283 if (config != null && config .splashOptions .overrideSplash ) {
8384 return Text .of (config .splashOptions .overrideSplashText );
8485 }
8586
86- return Text .of (getTheme ().getSplashText ());
87+ // Should still work with old mods that don't implement the asText method I hope...
88+ if (getTheme ().getSplashText () != null ) return Text .of (getTheme ().getSplashText ());
89+ return getTheme ().getSplashAsText ();
8790 }
8891
8992 public static Text getButtonText () {
You can’t perform that action at this time.
0 commit comments