@@ -26,7 +26,7 @@ public class TeammateRenderer {
2626 private static final MinecraftClient client = MinecraftClient .getInstance ();
2727 private static final float ARROW_SIZE = 0.3f ;
2828 private static final int TEXT_OFFSET = 20 ;
29- private static final float ARROW_OFFSET_Y = 2.15f ;
29+ private static final float ARROW_OFFSET_Y = 2.f ;
3030
3131 public static void render (MatrixStack matrices , Camera camera , Map <UUID , Teammate > teammates , double tickDelta ) {
3232 if (client .player == null || client .world == null || !TeammatesConfig .HANDLER .instance ().enabled ) return ;
@@ -68,12 +68,16 @@ public static void render(MatrixStack matrices, Camera camera, Map<UUID, Teammat
6868 return Double .compare (distanceB , distanceA );
6969 })
7070 .forEach (teammate -> {
71- InterpolatedLocation location = getLocation (teammate , currentTime , tickDelta )
72- .withOffset (0 , ARROW_OFFSET_Y , 0 )
73- .relativeToCamera (camera );
71+ InterpolatedLocation location = getLocation (teammate , currentTime , tickDelta );
7472
7573 double distance = calculateDistance (location , cameraPos );
76- renderTeammateMarker (matrices , location , teammate , distance );
74+ renderTeammateMarker (
75+ matrices ,
76+ location .withOffset (0 , ARROW_OFFSET_Y + TeammatesConfig .HANDLER .instance ().yOffset , 0 )
77+ .relativeToCamera (cameraPos ),
78+ teammate ,
79+ distance
80+ );
7781 });
7882
7983 matrices .pop ();
@@ -97,7 +101,7 @@ private static void renderTeammateMarker(MatrixStack matrices, InterpolatedLocat
97101
98102 EntityRenderDispatcher dispatcher = client .getEntityRenderDispatcher ();
99103 matrices .multiply (dispatcher .getRotation ());
100- float scale = (float ) getScale (distance , TeammatesConfig .HANDLER .instance ().markerScale * 0.25f );
104+ float scale = (float ) getScale (distance , TeammatesConfig .HANDLER .instance ().markerScale );
101105 matrices .scale (scale , scale , scale );
102106 int backgroundColor = (int )(MinecraftClient .getInstance ().options .getTextBackgroundOpacity (0.25F ) * 255.0F ) << 24 | 0x666666 ;
103107
@@ -158,8 +162,8 @@ private static void renderText(MatrixStack matrices, Text text, float x, float y
158162
159163 private static double getScale (double distance , float scaleFactor ) {
160164 if (distance < 10.f ) return scaleFactor ;
161- // return scaleFactor * (distance / 10.f);
162- return scaleFactor * (distance - 9.f );
165+ return scaleFactor * (distance / 10.f );
166+ // return scaleFactor * (distance - 9.f);
163167 }
164168
165169 private static double calculateDistance (InterpolatedLocation location , Vec3d cameraPos ) {
0 commit comments