@@ -348,13 +348,13 @@ public List<? extends GuiEventListener> children()
348348 }
349349
350350 @ Override
351- public void render (GuiGraphics graphics , int index , int top , int left , int width , int height , int mouseX , int mouseY , boolean selected , float partialTicks )
351+ public void renderContent (GuiGraphics graphics , int mouseX , int mouseY , boolean hovered , float partialTick )
352352 {
353- super .render (graphics , index , top , left , width , height , mouseX , mouseY , selected , partialTicks );
354- this .button .setX (left - 1 );
355- this .button .setY (top );
356- this .button .setWidth (width );
357- this .button .render (graphics , mouseX , mouseY , partialTicks );
353+ super .renderContent (graphics , mouseX , mouseY , hovered , partialTick );
354+ this .button .setX (this . getX () - 1 );
355+ this .button .setY (this . getY () );
356+ this .button .setWidth (this . getWidth () );
357+ this .button .render (graphics , mouseX , mouseY , partialTick );
358358 }
359359
360360 private static Component createLabelForFolderEntry (IConfigEntry entry )
@@ -403,26 +403,26 @@ public List<? extends GuiEventListener> children()
403403 }
404404
405405 @ Override
406- public void render (GuiGraphics graphics , int x , int top , int left , int width , int p_230432_6_ , int mouseX , int mouseY , boolean hovered , float partialTicks )
406+ public void renderContent (GuiGraphics graphics , int mouseX , int mouseY , boolean hovered , float partialTick )
407407 {
408408 boolean showValidationHint = this .validationHint != null ;
409409 int trimLength = showValidationHint ? 100 : 80 ;
410410 ChatFormatting labelStyle = this .holder .isChanged () ? Config .getChangedFormatting () : ChatFormatting .RESET ;
411- graphics .drawString (Minecraft .getInstance ().font , this .getTrimmedLabel (width - trimLength ).withStyle (labelStyle ), left , top + 6 , 0xFFFFFFFF );
411+ graphics .drawString (Minecraft .getInstance ().font , this .getTrimmedLabel (this . getWidth () - trimLength ).withStyle (labelStyle ), this . getX (), this . getY () + 6 , 0xFFFFFFFF );
412412
413413 if (showValidationHint )
414414 {
415- graphics .blit (RenderPipelines .GUI_TEXTURED , IconButton .ICONS , left + width - 88 , top + 3 , 11 , 11 , 16 , 16 , 11 , 11 , 64 , 64 );
415+ graphics .blit (RenderPipelines .GUI_TEXTURED , IconButton .ICONS , this . getX () + this . getWidth () - 88 , this . getY () + 3 , 11 , 11 , 16 , 16 , 11 , 11 , 64 , 64 );
416416 }
417417
418418 if (!ConfigScreen .this .config .isReadOnly ())
419419 {
420420 if (this .holder .requiresGameRestart () || this .holder .requiresWorldRestart ())
421421 {
422422 boolean gameRestart = this .holder .requiresGameRestart ();
423- graphics .blit (RenderPipelines .GUI_TEXTURED , IconButton .ICONS , left - 18 , top + 5 , gameRestart ? 51 : 11 , 22 , 11 , 11 , 11 , 11 , 64 , 64 );
423+ graphics .blit (RenderPipelines .GUI_TEXTURED , IconButton .ICONS , this . getX () - 18 , this . getY () + 5 , gameRestart ? 51 : 11 , 22 , 11 , 11 , 11 , 11 , 64 , 64 );
424424
425- if (ScreenUtil .isMouseWithin (left - 18 , top + 5 , 11 , 11 , mouseX , mouseY ))
425+ if (ScreenUtil .isMouseWithin (this . getX () - 18 , this . getY () + 5 , 11 , 11 , mouseX , mouseY ))
426426 {
427427 String translationKey = gameRestart ? "configured.gui.requires_game_restart" : "configured.gui.requires_world_restart" ;
428428 TooltipStyle style = gameRestart ? TooltipStyle .HINT : TooltipStyle .SUCCESS ;
@@ -433,7 +433,7 @@ public void render(GuiGraphics graphics, int x, int top, int left, int width, in
433433
434434 if (this .isMouseOver (mouseX , mouseY ))
435435 {
436- if (showValidationHint && ScreenUtil .isMouseWithin (left + width - 92 , top , 23 , 20 , mouseX , mouseY ))
436+ if (showValidationHint && ScreenUtil .isMouseWithin (this . getX () + this . getWidth () - 92 , this . getY () , 23 , 20 , mouseX , mouseY ))
437437 {
438438 ConfigScreen .this .setActiveTooltip (graphics , this .validationHint , mouseX , mouseY , TooltipStyle .ERROR );
439439 }
@@ -444,9 +444,9 @@ else if(mouseX < ConfigScreen.this.list.getRowLeft() + ConfigScreen.this.list.ge
444444 }
445445
446446 this .resetButton .active = !this .holder .isDefault () && !ConfigScreen .this .config .isReadOnly ();
447- this .resetButton .setX (left + width - 21 );
448- this .resetButton .setY (top );
449- this .resetButton .render (graphics , mouseX , mouseY , partialTicks );
447+ this .resetButton .setX (this . getX () + this . getWidth () - 21 );
448+ this .resetButton .setY (this . getY () );
449+ this .resetButton .render (graphics , mouseX , mouseY , partialTick );
450450 }
451451
452452 private MutableComponent getTrimmedLabel (int maxWidth )
@@ -538,18 +538,18 @@ public NumberItem(IConfigValue<T> holder, Function<String, Number> parser)
538538 }
539539
540540 @ Override
541- public void render (GuiGraphics graphics , int index , int top , int left , int width , int p_230432_6_ , int mouseX , int mouseY , boolean hovered , float partialTicks )
541+ public void renderContent (GuiGraphics graphics , int mouseX , int mouseY , boolean hovered , float partialTick )
542542 {
543- super .render (graphics , index , top , left , width , p_230432_6_ , mouseX , mouseY , hovered , partialTicks );
543+ super .renderContent (graphics , mouseX , mouseY , hovered , partialTick );
544544 long time = Util .getMillis ();
545545 if (time - this .lastTick >= 50 )
546546 {
547547 //this.textField.tick(); // TODO what happened to this
548548 this .lastTick = time ;
549549 }
550- this .textField .setX (left + width - 68 );
551- this .textField .setY (top + 1 );
552- this .textField .render (graphics , mouseX , mouseY , partialTicks );
550+ this .textField .setX (this . getX () + this . getWidth () - 68 );
551+ this .textField .setY (this . getY () + 1 );
552+ this .textField .render (graphics , mouseX , mouseY , partialTick );
553553 }
554554
555555 @ Override
@@ -600,12 +600,12 @@ public BooleanItem(IConfigValue<Boolean> holder)
600600 }
601601
602602 @ Override
603- public void render (GuiGraphics graphics , int index , int top , int left , int width , int p_230432_6_ , int mouseX , int mouseY , boolean hovered , float partialTicks )
603+ public void renderContent (GuiGraphics graphics , int mouseX , int mouseY , boolean hovered , float partialTick )
604604 {
605- super .render (graphics , index , top , left , width , p_230432_6_ , mouseX , mouseY , hovered , partialTicks );
606- this .button .setX (left + width - 69 );
607- this .button .setY (top );
608- this .button .render (graphics , mouseX , mouseY , partialTicks );
605+ super .renderContent (graphics , mouseX , mouseY , hovered , partialTick );
606+ this .button .setX (this . getX () + this . getWidth () - 69 );
607+ this .button .setY (this . getY () );
608+ this .button .render (graphics , mouseX , mouseY , partialTick );
609609 }
610610
611611 @ Override
@@ -633,12 +633,12 @@ public StringItem(IConfigValue<String> holder)
633633 }
634634
635635 @ Override
636- public void render (GuiGraphics graphics , int index , int top , int left , int width , int p_230432_6_ , int mouseX , int mouseY , boolean hovered , float partialTicks )
636+ public void renderContent (GuiGraphics graphics , int mouseX , int mouseY , boolean hovered , float partialTick )
637637 {
638- super .render (graphics , index , top , left , width , p_230432_6_ , mouseX , mouseY , hovered , partialTicks );
639- this .button .setX (left + width - 69 );
640- this .button .setY (top );
641- this .button .render (graphics , mouseX , mouseY , partialTicks );
638+ super .renderContent (graphics , mouseX , mouseY , hovered , partialTick );
639+ this .button .setX (this . getX () + this . getWidth () - 69 );
640+ this .button .setY (this . getY () );
641+ this .button .render (graphics , mouseX , mouseY , partialTick );
642642 }
643643 }
644644
@@ -662,12 +662,12 @@ public ListItem(IConfigValue<List<?>> holder)
662662 }
663663
664664 @ Override
665- public void render (GuiGraphics graphics , int index , int top , int left , int width , int p_230432_6_ , int mouseX , int mouseY , boolean hovered , float partialTicks )
665+ public void renderContent (GuiGraphics graphics , int mouseX , int mouseY , boolean hovered , float partialTick )
666666 {
667- super .render (graphics , index , top , left , width , p_230432_6_ , mouseX , mouseY , hovered , partialTicks );
668- this .button .setX (left + width - 69 );
669- this .button .setY (top );
670- this .button .render (graphics , mouseX , mouseY , partialTicks );
667+ super .renderContent (graphics , mouseX , mouseY , hovered , partialTick );
668+ this .button .setX (this . getX () + this . getWidth () - 69 );
669+ this .button .setY (this . getY () );
670+ this .button .render (graphics , mouseX , mouseY , partialTick );
671671 if (this .listType == ListTypes .getUnknown () && this .button .isHovered ())
672672 {
673673 ConfigScreen .this .setActiveTooltip (graphics , Component .translatable ("configured.gui.unsupported_property" ), mouseX , mouseY , TooltipStyle .ERROR );
@@ -691,12 +691,12 @@ public EnumItem(IConfigValue<Enum<?>> holder)
691691 }
692692
693693 @ Override
694- public void render (GuiGraphics graphics , int index , int top , int left , int width , int p_230432_6_ , int mouseX , int mouseY , boolean hovered , float partialTicks )
694+ public void renderContent (GuiGraphics graphics , int mouseX , int mouseY , boolean hovered , float partialTick )
695695 {
696- super .render (graphics , index , top , left , width , p_230432_6_ , mouseX , mouseY , hovered , partialTicks );
697- this .button .setX (left + width - 69 );
698- this .button .setY (top );
699- this .button .render (graphics , mouseX , mouseY , partialTicks );
696+ super .renderContent (graphics , mouseX , mouseY , hovered , partialTick );
697+ this .button .setX (this . getX () + this . getWidth () - 69 );
698+ this .button .setY (this . getY () );
699+ this .button .render (graphics , mouseX , mouseY , partialTick );
700700 }
701701 }
702702
0 commit comments