10
10
import net .minecraft .client .Minecraft ;
11
11
import net .minecraft .client .gui .Font ;
12
12
import net .minecraft .client .gui .GuiGraphics ;
13
- import net .minecraft .client .renderer .RenderType ;
13
+ import net .minecraft .client .renderer .RenderPipelines ;
14
14
import net .minecraft .network .chat .Component ;
15
15
import net .minecraft .resources .ResourceLocation ;
16
16
import net .minecraft .util .FormattedCharSequence ;
@@ -145,12 +145,11 @@ public void render(@NotNull GuiGraphics graphics) {
145
145
int arrowX = this .visibleDim .x () - ARROW_WIDTH ;
146
146
int arrowY = this .hoveredElement .getCenterY () - (ARROW_HEIGHT / 2 );
147
147
148
- graphics .pose ().pushPose ();
149
- graphics .pose ().translate (0.0F , 0.0F , 400.0F );
148
+ graphics .nextStratum ();
150
149
151
150
// parameters are: render type, sprite, x, y, u offset, v offset, render width, render height, u size, v size, color
152
- graphics .blit (RenderType :: guiTextured , ARROW_TEXTURE , arrowX , arrowY , ARROW_WIDTH , 0 , ARROW_WIDTH , ARROW_HEIGHT , SPRITE_WIDTH , ARROW_HEIGHT , Colors .BACKGROUND_LIGHT );
153
- graphics .blit (RenderType :: guiTextured , ARROW_TEXTURE , arrowX , arrowY , 0 , 0 , ARROW_WIDTH , ARROW_HEIGHT , SPRITE_WIDTH , ARROW_HEIGHT , Colors .BACKGROUND_DEFAULT );
151
+ graphics .blit (RenderPipelines . GUI_TEXTURED , ARROW_TEXTURE , arrowX , arrowY , ARROW_WIDTH , 0 , ARROW_WIDTH , ARROW_HEIGHT , SPRITE_WIDTH , ARROW_HEIGHT , Colors .BACKGROUND_LIGHT );
152
+ graphics .blit (RenderPipelines . GUI_TEXTURED , ARROW_TEXTURE , arrowX , arrowY , 0 , 0 , ARROW_WIDTH , ARROW_HEIGHT , SPRITE_WIDTH , ARROW_HEIGHT , Colors .BACKGROUND_DEFAULT );
154
153
155
154
int lineHeight = this .getLineHeight ();
156
155
@@ -161,14 +160,13 @@ public void render(@NotNull GuiGraphics graphics) {
161
160
162
161
graphics .enableScissor (this .visibleDim .x (), this .visibleDim .y (), this .visibleDim .getLimitX (), this .visibleDim .getLimitY ());
163
162
graphics .fill (this .visibleDim .x (), this .visibleDim .y (), this .visibleDim .getLimitX (), this .visibleDim .getLimitY (), Colors .BACKGROUND_LIGHT );
164
- graphics .pose (). translate ( 0.0F , 0.0F , 400.0F );
163
+ graphics .nextStratum ( );
165
164
for (int i = 0 ; i < this .content .size (); i ++) {
166
165
graphics .drawString (this .font , this .content .get (i ),
167
166
this .visibleDim .x () + TEXT_HORIZONTAL_PADDING , this .visibleDim .y () + TEXT_VERTICAL_PADDING + (i * lineHeight ) - scrollAmount ,
168
167
Colors .FOREGROUND );
169
168
}
170
169
graphics .disableScissor ();
171
- graphics .pose ().popPose ();
172
170
}
173
171
174
172
public boolean mouseScrolled (double d , double e , double amount ) {
0 commit comments