@@ -57,9 +57,8 @@ public void render(PoseStack stack, MultiBufferSource.BufferSource source, float
5757 stack .pushPose ();
5858 var cam = minecraft .gameRenderer .getMainCamera ();
5959 var camPos = cam .getPosition ();
60- minecraft .gameRenderer .resetProjectionMatrix (minecraft .gameRenderer .getProjectionMatrix (((GameRendererAccessor ) minecraft .gameRenderer ).invokeGetFov (cam , 0 , false )));
61- RenderSystem .enableBlend ();
6260 float fov = (float ) ((GameRendererAccessor ) minecraft .gameRenderer ).invokeGetFov (cam , tick , true );
61+ RenderSystem .enableBlend ();
6362 worldRendererWaypoints .clear ();
6463
6564 for (Waypoint waypoint : AxolotlClientWaypoints .getCurrentWaypoints ()) {
@@ -97,22 +96,23 @@ private void renderWaypoint(Waypoint waypoint, PoseStack stack, Vec3 camPos, Cam
9796 stack .mulPose (cam .rotation ());
9897 float scale = 0.04F ;
9998 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 ());
102101 stack .popPose ();
103102 }
104103
105104 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 ());
107106 var matrix = stack .last ().pose ();
108107 buf .vertex (matrix , x , y , z ).color (color ).uv2 (0xF000F0 ).endVertex ();
109108 buf .vertex (matrix , x , y2 , z ).color (color ).uv2 (0xF000F0 ).endVertex ();
110109 buf .vertex (matrix , x2 , y2 , z ).color (color ).uv2 (0xF000F0 ).endVertex ();
111110 buf .vertex (matrix , x2 , y , z ).color (color ).uv2 (0xF000F0 ).endVertex ();
111+ source .endBatch ();
112112 }
113113
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 );
116116 }
117117
118118 public void renderWaypoints (GuiGraphics graphics , float delta ) {
@@ -182,7 +182,7 @@ private void renderWaypoint(Waypoint waypoint, GuiGraphics graphics, float tick,
182182 maxX > 0 && minY > 0 && maxX < guiWidth && minY < guiHeight ||
183183 minX < guiWidth && maxX > 0 && minY < guiHeight && maxY > 0 ;
184184 } else {
185- _3dOnScreen = false ;
185+ _3dOnScreen = false ;
186186 }
187187 boolean displayX = Math .abs (result .x () - graphics .guiWidth () / 2f ) < (_3dOnScreen ? Math .max (projWidth , width ) : width ) / 2f + graphics .guiWidth () / 4f ;
188188 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,
235235 projection .mul (view );
236236 viewProj .mul (projection );
237237
238-
239238 if (orthoOffset == null && AxolotlClientWaypoints .renderOutOfViewWaypointsOnScreenEdge .get ()) {
240239 viewProj .w = Math .max (Math .abs (viewProj .x ()), Math .max (Math .abs (viewProj .y ()), viewProj .w ()));
241240 }
@@ -251,7 +250,7 @@ private void renderWaypoint(Waypoint waypoint, GuiGraphics graphics, float tick,
251250 //float x = (graphics.guiWidth()/2f) + ((graphics.guiWidth() - width) * (viewProj.x() / 2f));
252251 float resultX = 0.5f * (minecraft .getWindow ().getGuiScaledWidth () * (projX + 1 ) - width * projX );
253252 //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 ;
255254 return new Result (resultX , resultY );
256255 }
257256
0 commit comments