1010import net .minecraft .client .gui .DrawContext ;
1111import net .minecraft .client .gui .tooltip .HoveredTooltipPositioner ;
1212import net .minecraft .client .gui .tooltip .TooltipBackgroundRenderer ;
13- import net .minecraft .client .util .math .MatrixStack ;
1413import net .minecraft .text .*;
1514import net .minecraft .util .Identifier ;
1615import org .jetbrains .annotations .Nullable ;
@@ -46,25 +45,28 @@ public abstract class DrawContextMixin {
4645 @ Shadow
4746 @ Nullable
4847 private MinecraftClient client ;
48+
4949 @ Shadow
5050 @ Final
51- private MatrixStack matrices ;
51+ private #MatrixStack # matrices ;
52+
5253 @ Shadow
5354 public abstract int getScaledWindowWidth ();
55+
5456 @ Shadow
5557 public abstract int getScaledWindowHeight ();
58+
5659 @ Shadow
5760 public abstract void drawOrderedTooltip (TextRenderer textRenderer , List <? extends OrderedText > text , int x , int y );
61+
62+ @ Shadow
63+ public abstract void drawTexture (
5864// IF >= fabric-1.21.6
59- // @Shadow
60- // public abstract void drawTexturedQuad(Identifier sprite, int x1, int y1, int x2, int y2, float u1, float u2, float v1, float v2);
61- // ELSE
62- // @Shadow
63- // public abstract void drawTexture(
64- // IF >= fabric-1.21.2
65- //Function<Identifier, RenderLayer> renderLayers,
66- // END IF
67- // Identifier texture, int x, int y, float u, float v, int width, int height, int textureWidth, int textureHeight);
65+ // com.mojang.blaze3d.pipeline.RenderPipeline pipeline,
66+ // ELSE IF >= fabric-1.21.2
67+ // Function<Identifier, RenderLayer> renderLayers,
68+ // END IF
69+ Identifier texture , int x , int y , float u , float v , int width , int height , int textureWidth , int textureHeight );
6870// END IF
6971// IF < fabric-1.21.2
7072// @Shadow
@@ -93,7 +95,12 @@ public void drawHoverEvent(TextRenderer textRenderer, Style style, int x, int y,
9395 int l = vector2ic .x ();
9496 int m = vector2ic .y ();
9597 // 背景
96- this .matrices .push ();
98+ // IF >= fabric-1.21.6
99+ // this.matrices.pushMatrix();
100+ //
101+ // ELSE
102+ // this.matrices.push();
103+ // END IF
97104// IF >= fabric-1.21.2
98105// TooltipBackgroundRenderer.render((DrawContext) (Object)this, l, m, allWidth, allHeight,
99106 // IF <= fabric-1.21.5
@@ -105,22 +112,30 @@ public void drawHoverEvent(TextRenderer textRenderer, Style style, int x, int y,
105112// TooltipBackgroundRenderer.render((DrawContext) (Object)this, l, m, allWidth,allHeight, 400);
106113// });
107114// END IF
108- this .matrices .translate (0.0F , 0.0F , 400.0F );
115+
116+
117+
109118
110119 // 图片
111120// IF >= fabric-1.21.6
112- // this.drawTexturedQuad(
121+ // this.matrices.translate(0.0F, 0.0F);
122+ // this.drawTexture(
123+ // net.minecraft.client.gl.RenderPipelines.GUI_TEXTURED,
113124//
114125// ELSE
126+ // this.matrices.translate(0.0F, 0.0F, 400.0F);
115127// this.drawTexture(
116128// END IF
117129// IF >= fabric-1.21.2 && <= fabric-1.21.5
118130// RenderLayer::getGuiTextured,
119131// END IF
120132 (Identifier ) frame .getId (), l + CONFIG .paddingLeft , m + CONFIG .paddingTop , 0 , 0 , viewWidth , viewHeight , viewWidth , viewHeight
121133 );
122-
123- this .matrices .pop ();
134+ // IF >= fabric-1.21.6
135+ // this.matrices.popMatrix();
136+ // ELSE
137+ // this.matrices.pop();
138+ // END IF
124139 frame .gifLoop (CONFIG .gifSpeed );
125140 } else {
126141 MutableText text = (MutableText ) frame .getErrorMessage (
0 commit comments