1111import dev .isxander .yacl3 .api .controller .TickBoxControllerBuilder ;
1212import io .toadlabs .numeralping .NumeralPingMod ;
1313import io .toadlabs .numeralping .config .NumeralConfig ;
14- import net .minecraft .text .Text ;
15-
1614import java .awt .*;
15+ import net .minecraft .network .chat .Component ;
1716
1817import static io .toadlabs .numeralping .NumeralPingMod .ID ;
1918
@@ -26,15 +25,15 @@ public ConfigScreenFactory<?> getModConfigScreenFactory() {
2625 return parent -> {
2726 NumeralConfig config = NumeralConfig .instance ();
2827 return YetAnotherConfigLib .createBuilder ()
29- .title (Text . of (NumeralPingMod .NAME ))
28+ .title (Component . nullToEmpty (NumeralPingMod .NAME ))
3029
3130 .category (ConfigCategory .createBuilder ()
32- .name (Text . of (NumeralPingMod .NAME ))
31+ .name (Component . nullToEmpty (NumeralPingMod .NAME ))
3332
3433 // Player List
3534 .option (Option .<Boolean >createBuilder ()
36- .name (Text .translatable (OPTION + ".playerList" ))
37- .description (OptionDescription .of (Text .translatable (OPTION + ".playerList.desc" )))
35+ .name (Component .translatable (OPTION + ".playerList" ))
36+ .description (OptionDescription .of (Component .translatable (OPTION + ".playerList.desc" )))
3837 .binding (NumeralConfig .DEFAULTS .playerList ,
3938 () -> config .playerList ,
4039 value -> config .playerList = value )
@@ -43,8 +42,8 @@ public ConfigScreenFactory<?> getModConfigScreenFactory() {
4342
4443 // Server List
4544 .option (Option .<Boolean >createBuilder ()
46- .name (Text .translatable (OPTION + ".serverList" ))
47- .description (OptionDescription .of (Text .translatable (OPTION + ".serverList.desc" )))
45+ .name (Component .translatable (OPTION + ".serverList" ))
46+ .description (OptionDescription .of (Component .translatable (OPTION + ".serverList.desc" )))
4847 .binding (NumeralConfig .DEFAULTS .serverList ,
4948 () -> config .serverList ,
5049 value -> config .serverList = value )
@@ -53,8 +52,8 @@ public ConfigScreenFactory<?> getModConfigScreenFactory() {
5352
5453 // Small Ping
5554 .option (Option .<Boolean >createBuilder ()
56- .name (Text .translatable (OPTION + ".smallPing" ))
57- .description (OptionDescription .of (Text .translatable (OPTION + ".smallPing.desc" )))
55+ .name (Component .translatable (OPTION + ".smallPing" ))
56+ .description (OptionDescription .of (Component .translatable (OPTION + ".smallPing.desc" )))
5857 .binding (NumeralConfig .DEFAULTS .smallPing ,
5958 () -> config .smallPing ,
6059 value -> config .smallPing = value )
@@ -65,8 +64,8 @@ public ConfigScreenFactory<?> getModConfigScreenFactory() {
6564
6665 // Default
6766 .option (Option .<Integer >createBuilder ()
68- .name (Text .translatable (OPTION + ".defaultPingThreshold" ))
69- .description (OptionDescription .of (Text .translatable (OPTION + ".defaultPingThreshold.desc" )))
67+ .name (Component .translatable (OPTION + ".defaultPingThreshold" ))
68+ .description (OptionDescription .of (Component .translatable (OPTION + ".defaultPingThreshold.desc" )))
7069 .binding (NumeralConfig .DEFAULTS .defaultPingThreshold ,
7170 () -> config .defaultPingThreshold ,
7271 value -> config .defaultPingThreshold = value )
@@ -75,8 +74,8 @@ public ConfigScreenFactory<?> getModConfigScreenFactory() {
7574
7675 // levelOnePingThreshold
7776 .option (Option .<Integer >createBuilder ()
78- .name (Text .translatable (OPTION + ".levelOnePingThreshold" ))
79- .description (OptionDescription .of (Text .translatable (OPTION + ".levelOnePingThreshold.desc" )))
77+ .name (Component .translatable (OPTION + ".levelOnePingThreshold" ))
78+ .description (OptionDescription .of (Component .translatable (OPTION + ".levelOnePingThreshold.desc" )))
8079 .binding (NumeralConfig .DEFAULTS .levelOnePingThreshold ,
8180 () -> config .levelOnePingThreshold ,
8281 value -> config .levelOnePingThreshold = value )
@@ -85,8 +84,8 @@ public ConfigScreenFactory<?> getModConfigScreenFactory() {
8584
8685 // levelTwoPingThreshold
8786 .option (Option .<Integer >createBuilder ()
88- .name (Text .translatable (OPTION + ".levelTwoPingThreshold" ))
89- .description (OptionDescription .of (Text .translatable (OPTION + ".levelTwoPingThreshold.desc" )))
87+ .name (Component .translatable (OPTION + ".levelTwoPingThreshold" ))
88+ .description (OptionDescription .of (Component .translatable (OPTION + ".levelTwoPingThreshold.desc" )))
9089 .binding (NumeralConfig .DEFAULTS .levelTwoPingThreshold ,
9190 () -> config .levelTwoPingThreshold ,
9291 value -> config .levelTwoPingThreshold = value )
@@ -95,8 +94,8 @@ public ConfigScreenFactory<?> getModConfigScreenFactory() {
9594
9695 // levelThreePingThreshold
9796 .option (Option .<Integer >createBuilder ()
98- .name (Text .translatable (OPTION + ".levelThreePingThreshold" ))
99- .description (OptionDescription .of (Text .translatable (OPTION + ".levelThreePingThreshold.desc" )))
97+ .name (Component .translatable (OPTION + ".levelThreePingThreshold" ))
98+ .description (OptionDescription .of (Component .translatable (OPTION + ".levelThreePingThreshold.desc" )))
10099 .binding (NumeralConfig .DEFAULTS .levelThreePingThreshold ,
101100 () -> config .levelThreePingThreshold ,
102101 value -> config .levelThreePingThreshold = value )
@@ -105,7 +104,7 @@ public ConfigScreenFactory<?> getModConfigScreenFactory() {
105104
106105 // Ping < defaultPingThreshold Colour
107106 .option (Option .<Color >createBuilder ()
108- .name (Text .translatable (OPTION + ".defaultPingColour" ))
107+ .name (Component .translatable (OPTION + ".defaultPingColour" ))
109108 .binding (NumeralConfig .DEFAULTS .defaultPingColour ,
110109 () -> config .defaultPingColour ,
111110 value -> config .defaultPingColour = value )
@@ -114,7 +113,7 @@ public ConfigScreenFactory<?> getModConfigScreenFactory() {
114113
115114 // Ping < levelOnePingThreshold Colour
116115 .option (Option .<Color >createBuilder ()
117- .name (Text .translatable (OPTION + ".levelOnePingColour" ))
116+ .name (Component .translatable (OPTION + ".levelOnePingColour" ))
118117 .binding (NumeralConfig .DEFAULTS .levelOnePingColour ,
119118 () -> config .levelOnePingColour ,
120119 value -> config .levelOnePingColour = value )
@@ -123,7 +122,7 @@ public ConfigScreenFactory<?> getModConfigScreenFactory() {
123122
124123 // Ping < levelTwoPingThreshold Colour
125124 .option (Option .<Color >createBuilder ()
126- .name (Text .translatable (OPTION + ".levelTwoPingColour" ))
125+ .name (Component .translatable (OPTION + ".levelTwoPingColour" ))
127126 .binding (NumeralConfig .DEFAULTS .levelTwoPingColour ,
128127 () -> config .levelTwoPingColour ,
129128 value -> config .levelTwoPingColour = value )
@@ -132,7 +131,7 @@ public ConfigScreenFactory<?> getModConfigScreenFactory() {
132131
133132 // Ping < levelThreePingThreshold Colour
134133 .option (Option .<Color >createBuilder ()
135- .name (Text .translatable (OPTION + ".levelThreePingColour" ))
134+ .name (Component .translatable (OPTION + ".levelThreePingColour" ))
136135 .binding (NumeralConfig .DEFAULTS .levelThreePingColour ,
137136 () -> config .levelThreePingColour ,
138137 value -> config .levelThreePingColour = value )
@@ -141,8 +140,8 @@ public ConfigScreenFactory<?> getModConfigScreenFactory() {
141140
142141 // Ping ≥ levelThreePingThreshold Colour
143142 .option (Option .<Color >createBuilder ()
144- .name (Text .translatable (OPTION + ".levelFourPingColour" ))
145- .description (OptionDescription .of (Text .translatable (OPTION + ".levelFourPingColour.desc" )))
143+ .name (Component .translatable (OPTION + ".levelFourPingColour" ))
144+ .description (OptionDescription .of (Component .translatable (OPTION + ".levelFourPingColour.desc" )))
146145 .binding (NumeralConfig .DEFAULTS .levelFourPingColour ,
147146 () -> config .levelFourPingColour ,
148147 value -> config .levelFourPingColour = value )
@@ -151,7 +150,7 @@ public ConfigScreenFactory<?> getModConfigScreenFactory() {
151150
152151 // Timed Out Ping Colour
153152 .option (Option .<Color >createBuilder ()
154- .name (Text .translatable (OPTION + ".levelFivePingColour" ))
153+ .name (Component .translatable (OPTION + ".levelFivePingColour" ))
155154 .binding (NumeralConfig .DEFAULTS .levelFivePingColour ,
156155 () -> config .levelFivePingColour ,
157156 value -> config .levelFivePingColour = value )
0 commit comments