77import net .minecraft .client .gui .components .events .GuiEventListener ;
88import net .minecraft .client .gui .screens .Screen ;
99import net .minecraft .client .resources .language .I18n ;
10- import net .minecraft .network .chat .Component ;
1110import net .minecraft .network .chat .FormattedText ;
1211import net .minecraft .network .chat .Style ;
12+ import net .minecraft .network .chat .TextComponent ;
13+ import net .minecraft .network .chat .TranslatableComponent ;
1314import net .minecraft .world .phys .Vec2 ;
1415import org .lwjgl .glfw .GLFW ;
1516import org .vivecraft .client_vr .ClientDataHolderVR ;
@@ -31,15 +32,15 @@ public abstract class GuiVROptionsBase extends Screen {
3132 private Button btnDefaults ;
3233
3334 public GuiVROptionsBase (Screen lastScreen ) {
34- super (Component . literal ("" ));
35+ super (new TextComponent ("" ));
3536 this .lastScreen = lastScreen ;
3637 this .vrSettings = ClientDataHolderVR .getInstance ().vrSettings ;
3738 }
3839
3940 protected void addDefaultButtons () {
4041 this .addRenderableWidget (
4142 this .btnDone = new Button (this .width / 2 + 5 , this .height - 30 , 150 , 20 ,
42- Component . translatable ("gui.back" ), (p ) -> {
43+ new TranslatableComponent ("gui.back" ), (p ) -> {
4344 if (!this .onDoneClicked ()) {
4445 this .dataHolder .vrSettings .saveOptions ();
4546 this .minecraft .setScreen (this .lastScreen );
@@ -48,7 +49,7 @@ protected void addDefaultButtons() {
4849
4950 this .addRenderableWidget (
5051 this .btnDefaults = new Button (this .width / 2 - 155 , this .height - 30 , 150 , 20 ,
51- Component . translatable ("vivecraft.gui.loaddefaults" ), (p ) -> {
52+ new TranslatableComponent ("vivecraft.gui.loaddefaults" ), (p ) -> {
5253 this .loadDefaults ();
5354 this .dataHolder .vrSettings .saveOptions ();
5455 this .reinit = true ;
@@ -94,7 +95,7 @@ public void onClick(double mouseX, double mouseY) {
9495 !layout .getCustomHandler ().apply ((GuiVROptionButton ) p , new Vec2 (0.0F , 0.0F )))
9596 {
9697 this .vrSettings .setOptionValue (((GuiVROptionButton ) p ).getOption ());
97- p .setMessage (Component . literal (layout .getButtonText ()));
98+ p .setMessage (new TextComponent (layout .getButtonText ()));
9899 }
99100 }));
100101 } else if (layout .getScreen () != null ) {
@@ -217,7 +218,7 @@ public void render(PoseStack poseStack, int mouseX, int mouseY, float partialTic
217218
218219 super .render (poseStack , mouseX , mouseY , partialTick );
219220
220- drawCenteredString (poseStack , this .font , Component . translatable (this .vrTitle ), this .width / 2 , 15 , 0xFFFFFF );
221+ drawCenteredString (poseStack , this .font , new TranslatableComponent (this .vrTitle ), this .width / 2 , 15 , 0xFFFFFF );
221222
222223 if (this .btnDefaults != null ) {
223224 this .btnDefaults .visible = this .drawDefaultButtons ;
@@ -347,10 +348,10 @@ private void renderTooltip(PoseStack poseStack, int mouseX, int mouseY) {
347348 if (guiHover .getY () + guiHover .getHeight () + formattedText .size () * (this .font .lineHeight + 1 ) +
348349 14 < this .height )
349350 {
350- renderTooltip (poseStack , this .font .split (Component . literal (tooltip ), 308 ),
351+ renderTooltip (poseStack , this .font .split (new TextComponent (tooltip ), 308 ),
351352 this .width / 2 - 166 , guiHover .getY () + guiHover .getHeight () + 14 );
352353 } else {
353- renderTooltip (poseStack , this .font .split (Component . literal (tooltip ), 308 ),
354+ renderTooltip (poseStack , this .font .split (new TextComponent (tooltip ), 308 ),
354355 this .width / 2 - 166 ,
355356 guiHover .getY () - formattedText .size () * (this .font .lineHeight + 1 ) + 9 );
356357 }
0 commit comments