@@ -57,9 +57,8 @@ public void render(PoseStack stack, MultiBufferSource.BufferSource source, float
57
57
stack .pushPose ();
58
58
var cam = minecraft .gameRenderer .getMainCamera ();
59
59
var camPos = cam .getPosition ();
60
- minecraft .gameRenderer .resetProjectionMatrix (minecraft .gameRenderer .getProjectionMatrix (((GameRendererAccessor ) minecraft .gameRenderer ).invokeGetFov (cam , 0 , false )));
61
- RenderSystem .enableBlend ();
62
60
float fov = (float ) ((GameRendererAccessor ) minecraft .gameRenderer ).invokeGetFov (cam , tick , true );
61
+ RenderSystem .enableBlend ();
63
62
worldRendererWaypoints .clear ();
64
63
65
64
for (Waypoint waypoint : AxolotlClientWaypoints .getCurrentWaypoints ()) {
@@ -97,22 +96,23 @@ private void renderWaypoint(Waypoint waypoint, PoseStack stack, Vec3 camPos, Cam
97
96
stack .mulPose (cam .rotation ());
98
97
float scale = 0.04F ;
99
98
stack .scale (-scale , -scale , scale );
100
- //fillRect(stack, bufferSource, -width / 2f, -height / 2f, 0f, width / 2f, height / 2f, waypoint.color ().toInt() );
101
- drawFontBatch ( waypoint . display (), - textWidth / 2f , -textHeight / 2f , stack . last (). pose (), bufferSource , waypoint .color ().toInt ());
99
+ drawFontBatch ( waypoint . display (), - textWidth / 2f , -textHeight / 2f , stack . last ().pose (), bufferSource );
100
+ fillRect ( stack , bufferSource , - width / 2f , -height / 2f , 0.001f , width / 2f , height / 2f , waypoint .color ().toInt ());
102
101
stack .popPose ();
103
102
}
104
103
105
104
private void fillRect (PoseStack stack , MultiBufferSource .BufferSource source , float x , float y , float z , float x2 , float y2 , int color ) {
106
- var buf = source .getBuffer (RenderType .textBackgroundSeeThrough ());
105
+ var buf = source .getBuffer (RenderType .gui ());
107
106
var matrix = stack .last ().pose ();
108
107
buf .vertex (matrix , x , y , z ).color (color ).uv2 (0xF000F0 ).endVertex ();
109
108
buf .vertex (matrix , x , y2 , z ).color (color ).uv2 (0xF000F0 ).endVertex ();
110
109
buf .vertex (matrix , x2 , y2 , z ).color (color ).uv2 (0xF000F0 ).endVertex ();
111
110
buf .vertex (matrix , x2 , y , z ).color (color ).uv2 (0xF000F0 ).endVertex ();
111
+ source .endBatch ();
112
112
}
113
113
114
- private void drawFontBatch (String text , float x , float y , Matrix4f matrix , MultiBufferSource bufferSource , int bgColor ) {
115
- minecraft .font .drawInBatch (text , x , y , -1 , false , matrix , bufferSource , Font .DisplayMode .NORMAL , bgColor , 0xF000F0 );
114
+ private void drawFontBatch (String text , float x , float y , Matrix4f matrix , MultiBufferSource bufferSource ) {
115
+ minecraft .font .drawInBatch (text , x , y , -1 , false , matrix , bufferSource , Font .DisplayMode .NORMAL , 0 , 0xF000F0 );
116
116
}
117
117
118
118
public void renderWaypoints (GuiGraphics graphics , float delta ) {
@@ -182,7 +182,7 @@ private void renderWaypoint(Waypoint waypoint, GuiGraphics graphics, float tick,
182
182
maxX > 0 && minY > 0 && maxX < guiWidth && minY < guiHeight ||
183
183
minX < guiWidth && maxX > 0 && minY < guiHeight && maxY > 0 ;
184
184
} else {
185
- _3dOnScreen = false ;
185
+ _3dOnScreen = false ;
186
186
}
187
187
boolean displayX = Math .abs (result .x () - graphics .guiWidth () / 2f ) < (_3dOnScreen ? Math .max (projWidth , width ) : width ) / 2f + graphics .guiWidth () / 4f ;
188
188
boolean displayY = Math .abs (result .y () - graphics .guiHeight () / 2f ) < (_3dOnScreen ? Math .max (height , projHeight ) : height ) / 2f + graphics .guiHeight () / 4f ;
@@ -235,7 +235,6 @@ private void renderWaypoint(Waypoint waypoint, GuiGraphics graphics, float tick,
235
235
projection .mul (view );
236
236
viewProj .mul (projection );
237
237
238
-
239
238
if (orthoOffset == null && AxolotlClientWaypoints .renderOutOfViewWaypointsOnScreenEdge .get ()) {
240
239
viewProj .w = Math .max (Math .abs (viewProj .x ()), Math .max (Math .abs (viewProj .y ()), viewProj .w ()));
241
240
}
@@ -251,7 +250,7 @@ private void renderWaypoint(Waypoint waypoint, GuiGraphics graphics, float tick,
251
250
//float x = (graphics.guiWidth()/2f) + ((graphics.guiWidth() - width) * (viewProj.x() / 2f));
252
251
float resultX = 0.5f * (minecraft .getWindow ().getGuiScaledWidth () * (projX + 1 ) - width * projX );
253
252
//float y = graphics.guiHeight() - (graphics.guiHeight()/2f + (graphics.guiHeight()-height) * (viewProj.y() / 2f));
254
- float resultY = minecraft .getWindow ().getGuiScaledWidth () * (0.5f - projY / 2 ) + (height * projY ) / 2f ;
253
+ float resultY = minecraft .getWindow ().getGuiScaledHeight () * (0.5f - projY / 2 ) + (height * projY ) / 2f ;
255
254
return new Result (resultX , resultY );
256
255
}
257
256
0 commit comments