26
26
import net .minecraft .client .gui .components .Checkbox ;
27
27
import net .minecraft .client .gui .screens .Screen ;
28
28
import net .minecraft .network .chat .CommonComponents ;
29
- import net .minecraft .network .chat .TranslatableComponent ;
29
+ import net .minecraft .network .chat .Component ;
30
30
31
31
public class DarknessConfigScreen extends Screen {
32
32
protected final Screen parent ;
@@ -40,7 +40,7 @@ public class DarknessConfigScreen extends Screen {
40
40
protected Checkbox darkSkylessWidget ;
41
41
42
42
public DarknessConfigScreen (Screen parent ) {
43
- super (new TranslatableComponent ("config.darkness.title" ));
43
+ super (Component . translatable ("config.darkness.title" ));
44
44
this .parent = parent ;
45
45
}
46
46
@@ -57,91 +57,91 @@ public void onClose() {
57
57
@ Override
58
58
protected void init () {
59
59
int i = 27 ;
60
- blockLightOnlyWidget = new Checkbox (width / 2 - 100 , i , 200 , 20 , new TranslatableComponent ("config.darkness.label.block_light_only" ), Darkness .blockLightOnly ) {
60
+ blockLightOnlyWidget = new Checkbox (width / 2 - 100 , i , 200 , 20 , Component . translatable ("config.darkness.label.block_light_only" ), Darkness .blockLightOnly ) {
61
61
@ Override
62
62
public void renderButton (PoseStack matrices , int mouseX , int mouseY , float delta ) {
63
63
super .renderButton (matrices , mouseX , mouseY , delta );
64
64
65
65
if (isHovered ) {
66
- DarknessConfigScreen .this .renderTooltip (matrices , new TranslatableComponent ("config.darkness.help.block_light_only" ), mouseX , mouseY );
66
+ DarknessConfigScreen .this .renderTooltip (matrices , Component . translatable ("config.darkness.help.block_light_only" ), mouseX , mouseY );
67
67
}
68
68
}
69
69
};
70
70
71
71
i += 27 ;
72
72
73
- ignoreMoonPhaseWidget = new Checkbox (width / 2 - 100 , i , 200 , 20 , new TranslatableComponent ("config.darkness.label.ignore_moon_phase" ), Darkness .ignoreMoonPhase ) {
73
+ ignoreMoonPhaseWidget = new Checkbox (width / 2 - 100 , i , 200 , 20 , Component . translatable ("config.darkness.label.ignore_moon_phase" ), Darkness .ignoreMoonPhase ) {
74
74
@ Override
75
75
public void renderButton (PoseStack matrices , int mouseX , int mouseY , float delta ) {
76
76
super .renderButton (matrices , mouseX , mouseY , delta );
77
77
78
78
if (isHovered ) {
79
- DarknessConfigScreen .this .renderTooltip (matrices , new TranslatableComponent ("config.darkness.help.ignore_moon_phase" ), mouseX , mouseY );
79
+ DarknessConfigScreen .this .renderTooltip (matrices , Component . translatable ("config.darkness.help.ignore_moon_phase" ), mouseX , mouseY );
80
80
}
81
81
}
82
82
};
83
83
84
84
i += 27 ;
85
85
86
- darkOverworldWidget = new Checkbox (width / 2 - 100 , i , 200 , 20 , new TranslatableComponent ("config.darkness.label.dark_overworld" ), Darkness .darkOverworld ) {
86
+ darkOverworldWidget = new Checkbox (width / 2 - 100 , i , 200 , 20 , Component . translatable ("config.darkness.label.dark_overworld" ), Darkness .darkOverworld ) {
87
87
@ Override
88
88
public void renderButton (PoseStack matrices , int mouseX , int mouseY , float delta ) {
89
89
super .renderButton (matrices , mouseX , mouseY , delta );
90
90
91
91
if (isHovered ) {
92
- DarknessConfigScreen .this .renderTooltip (matrices , new TranslatableComponent ("config.darkness.help.dark_overworld" ), mouseX , mouseY );
92
+ DarknessConfigScreen .this .renderTooltip (matrices , Component . translatable ("config.darkness.help.dark_overworld" ), mouseX , mouseY );
93
93
}
94
94
}
95
95
};
96
96
97
97
i += 27 ;
98
98
99
- darkNetherWidget = new Checkbox (width / 2 - 100 , i , 200 , 20 , new TranslatableComponent ("config.darkness.label.dark_nether" ), Darkness .darkNether ) {
99
+ darkNetherWidget = new Checkbox (width / 2 - 100 , i , 200 , 20 , Component . translatable ("config.darkness.label.dark_nether" ), Darkness .darkNether ) {
100
100
@ Override
101
101
public void renderButton (PoseStack matrices , int mouseX , int mouseY , float delta ) {
102
102
super .renderButton (matrices , mouseX , mouseY , delta );
103
103
104
104
if (isHovered ) {
105
- DarknessConfigScreen .this .renderTooltip (matrices , new TranslatableComponent ("config.darkness.help.dark_nether" ), mouseX , mouseY );
105
+ DarknessConfigScreen .this .renderTooltip (matrices , Component . translatable ("config.darkness.help.dark_nether" ), mouseX , mouseY );
106
106
}
107
107
}
108
108
};
109
109
110
110
i += 27 ;
111
111
112
- darkEndWidget = new Checkbox (width / 2 - 100 , i , 200 , 20 , new TranslatableComponent ("config.darkness.label.dark_end" ), Darkness .darkEnd ) {
112
+ darkEndWidget = new Checkbox (width / 2 - 100 , i , 200 , 20 , Component . translatable ("config.darkness.label.dark_end" ), Darkness .darkEnd ) {
113
113
@ Override
114
114
public void renderButton (PoseStack matrices , int mouseX , int mouseY , float delta ) {
115
115
super .renderButton (matrices , mouseX , mouseY , delta );
116
116
117
117
if (isHovered ) {
118
- DarknessConfigScreen .this .renderTooltip (matrices , new TranslatableComponent ("config.darkness.help.dark_end" ), mouseX , mouseY );
118
+ DarknessConfigScreen .this .renderTooltip (matrices , Component . translatable ("config.darkness.help.dark_end" ), mouseX , mouseY );
119
119
}
120
120
}
121
121
};
122
122
123
123
i += 27 ;
124
124
125
- darkDefaultWidget = new Checkbox (width / 2 - 100 , i , 200 , 20 , new TranslatableComponent ("config.darkness.label.dark_default" ), Darkness .darkDefault ) {
125
+ darkDefaultWidget = new Checkbox (width / 2 - 100 , i , 200 , 20 , Component . translatable ("config.darkness.label.dark_default" ), Darkness .darkDefault ) {
126
126
@ Override
127
127
public void renderButton (PoseStack matrices , int mouseX , int mouseY , float delta ) {
128
128
super .renderButton (matrices , mouseX , mouseY , delta );
129
129
130
130
if (isHovered ) {
131
- DarknessConfigScreen .this .renderTooltip (matrices , new TranslatableComponent ("config.darkness.help.dark_default" ), mouseX , mouseY );
131
+ DarknessConfigScreen .this .renderTooltip (matrices , Component . translatable ("config.darkness.help.dark_default" ), mouseX , mouseY );
132
132
}
133
133
}
134
134
};
135
135
136
136
i += 27 ;
137
137
138
- darkSkylessWidget = new Checkbox (width / 2 - 100 , i , 200 , 20 , new TranslatableComponent ("config.darkness.label.dark_skyless" ), Darkness .darkSkyless ) {
138
+ darkSkylessWidget = new Checkbox (width / 2 - 100 , i , 200 , 20 , Component . translatable ("config.darkness.label.dark_skyless" ), Darkness .darkSkyless ) {
139
139
@ Override
140
140
public void renderButton (PoseStack matrices , int mouseX , int mouseY , float delta ) {
141
141
super .renderButton (matrices , mouseX , mouseY , delta );
142
142
143
143
if (isHovered ) {
144
- DarknessConfigScreen .this .renderTooltip (matrices , new TranslatableComponent ("config.darkness.help.dark_skyless" ), mouseX , mouseY );
144
+ DarknessConfigScreen .this .renderTooltip (matrices , Component . translatable ("config.darkness.help.dark_skyless" ), mouseX , mouseY );
145
145
}
146
146
}
147
147
};
0 commit comments