1414import net .minecraft .client .font .TextRenderer ;
1515import net .minecraft .client .gui .screen .Screen ;
1616import net .minecraft .client .util .math .MatrixStack ;
17- import net .minecraft .text .LiteralText ;
1817import net .minecraft .text .Text ;
19- import net .minecraft .text .TranslatableText ;
2018
2119public class ModMenuIntegration implements ModMenuApi {
2220
2321 @ Override
2422 public ConfigScreenFactory <?> getModConfigScreenFactory () {
2523 return (screen ) -> {
2624 ResourcePreloaderConfig config = ResourcePreloader .getConfig ();
27- ConfigScreen configScreen = new ConfigScreen (screen , new TranslatableText ("key.lemclienthelper.title" ));
25+ ConfigScreen configScreen = new ConfigScreen (screen , Text . translatable ("key.lemclienthelper.title" ));
2826 configScreen .setSavingEvent (() -> {
2927 LEMClientHelperMod .configManager .save ();
3028 });
3129
32- ConfigSection rplSection = new ConfigSection (configScreen , new TranslatableText ("key.lemclienthelper.resourcepreloader" ));
30+ ConfigSection rplSection = new ConfigSection (configScreen , Text . translatable ("key.lemclienthelper.resourcepreloader" ));
3331
34- rplSection .addConfigItem (new TextItem (new TranslatableText ("key.lemclienthelper.downloadurl" ), config .URL , ResourcePreloaderConfig .DEFAULT_URL ).setMaxLength (1024 ).setSaveConsumer (val -> config .URL = val ));
35- rplSection .addConfigItem (new BooleanItem (new TranslatableText ("key.lemclienthelper.allowOptifine" ), config .allowOptifine , false ).setSaveConsumer (val -> config .allowOptifine = val ));
36- rplSection .addConfigItem (new BooleanItem (new TranslatableText ("key.lemclienthelper.multiDownload" ), config .multiDownload , true ).setSaveConsumer (val -> config .multiDownload = val ));
37- rplSection .addConfigItem (new BooleanItem (new TranslatableText ("key.lemclienthelper.toastcomplete" ), config .toastComplete , true ).setSaveConsumer (val -> config .toastComplete = val ));
32+ rplSection .addConfigItem (new TextItem (Text . translatable ("key.lemclienthelper.downloadurl" ), config .URL , ResourcePreloaderConfig .DEFAULT_URL ).setMaxLength (1024 ).setSaveConsumer (val -> config .URL = val ));
33+ rplSection .addConfigItem (new BooleanItem (Text . translatable ("key.lemclienthelper.allowOptifine" ), config .allowOptifine , false ).setSaveConsumer (val -> config .allowOptifine = val ));
34+ rplSection .addConfigItem (new BooleanItem (Text . translatable ("key.lemclienthelper.multiDownload" ), config .multiDownload , true ).setSaveConsumer (val -> config .multiDownload = val ));
35+ rplSection .addConfigItem (new BooleanItem (Text . translatable ("key.lemclienthelper.toastcomplete" ), config .toastComplete , true ).setSaveConsumer (val -> config .toastComplete = val ));
3836
39- rplSection .addConfigItem (new ButtonItem (new TranslatableText ("key.lemclienthelper.deletePacks" )).setClickEvent (() -> {
37+ rplSection .addConfigItem (new ButtonItem (Text . translatable ("key.lemclienthelper.deletePacks" )).setClickEvent (() -> {
4038 configScreen .save ();
4139 ResourcePreloader .deletePacks ();
4240 }));
4341
44- SubItem <?> sub = new SubItem <>(new TranslatableText ("key.lemclienthelper.packdownloads" ), true );
42+ SubItem <?> sub = new SubItem <>(Text . translatable ("key.lemclienthelper.packdownloads" ), true );
4543
46- rplSection .addConfigItem (new ButtonItem (new TranslatableText ("key.lemclienthelper.previewList" )).setClickEvent (() -> {
44+ rplSection .addConfigItem (new ButtonItem (Text . translatable ("key.lemclienthelper.previewList" )).setClickEvent (() -> {
4745 configScreen .save ();
4846 ResourcePreloader .getPackList ();
4947 addPacksToSub (sub );
5048 }));
5149
52- rplSection .addConfigItem (new ButtonItem (new TranslatableText ("key.lemclienthelper.startdownload" )).setClickEvent (() -> {
50+ rplSection .addConfigItem (new ButtonItem (Text . translatable ("key.lemclienthelper.startdownload" )).setClickEvent (() -> {
5351 configScreen .save ();
5452 ResourcePreloader .getPackList ();
5553 ResourcePreloader .downloadPacks ();
@@ -59,8 +57,8 @@ public ConfigScreenFactory<?> getModConfigScreenFactory() {
5957 rplSection .addConfigItem (sub );
6058 addPacksToSub (sub );
6159
62- ConfigSection smallInvSection = new ConfigSection (configScreen , new TranslatableText ("key.lemclienthelper.smallinv" ));
63- smallInvSection .addConfigItem (new BooleanItem (new TranslatableText ("key.lemclienthelper.smallinv.enabled" ), SmallInvInit .getConfig ().enabled , true ).setSaveConsumer (val -> SmallInvInit .getConfig ().enabled = val ));
60+ ConfigSection smallInvSection = new ConfigSection (configScreen , Text . translatable ("key.lemclienthelper.smallinv" ));
61+ smallInvSection .addConfigItem (new BooleanItem (Text . translatable ("key.lemclienthelper.smallinv.enabled" ), SmallInvInit .getConfig ().enabled , true ).setSaveConsumer (val -> SmallInvInit .getConfig ().enabled = val ));
6462
6563 return configScreen ;
6664 };
@@ -70,7 +68,7 @@ public void addPacksToSub(SubItem<?> sub) {
7068 if (ResourcePreloader .allPacks != null && ResourcePreloader .allPacks .packs .size () > 0 ) {
7169 sub .clearConfigItems ();
7270 ResourcePreloader .allPacks .packs .forEach (rpOption -> {
73- sub .addConfigItem (new RPDownloadItem (rpOption ).setToolTip (new LiteralText (rpOption .url )));
71+ sub .addConfigItem (new RPDownloadItem (rpOption ).setToolTip (Text . literal (rpOption .url )));
7472 });
7573 }
7674 }
@@ -79,7 +77,7 @@ public static class RPDownloadItem extends ConfigItem<Object> {
7977 private final AllPacks .RPOption rpOption ;
8078
8179 public RPDownloadItem (AllPacks .RPOption option ) {
82- super (new LiteralText (option .packname ), null , null );
80+ super (Text . literal (option .packname ), null , null );
8381 this .rpOption = option ;
8482 }
8583
@@ -98,7 +96,7 @@ public void render(MatrixStack matrices, int x, int y, int mouseX, int mouseY, f
9896 Screen .drawCenteredText (matrices , textRenderer , progressListener .title , titleX , y , 16777215 );
9997
10098 if (rpOption .progressListener .task != null ) {
101- Text task = (new LiteralText ("" )).append (progressListener .task ).append (" " + progressListener .progress + "%" );
99+ Text task = (Text . literal ("" )).append (progressListener .task ).append (" " + progressListener .progress + "%" );
102100 Screen .drawCenteredText (matrices , textRenderer , task , titleX , y + 10 , 16777215 );
103101 }
104102 }
0 commit comments