package aeronicamc.mods.mxtune.render;

import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ActiveRenderInfo;
import net.minecraft.client.renderer.IRenderTypeBuffer;
import net.minecraft.client.renderer.LightTexture;
import net.minecraft.client.renderer.culling.ClippingHelper;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.util.text.StringTextComponent;

public class StageToolRenderer
{
    private static final Minecraft mc = Minecraft.getInstance();

    private StageToolRenderer() { /*NOP */ }

    static void renderUUID(MatrixStack pMatrixStack, IRenderTypeBuffer.Impl pBuffer, LightTexture pLightTexture, ActiveRenderInfo pActiveRenderInfo, float pPartialTicks, ClippingHelper pClippingHelper)
    {
        if (mc.player != null)
        {
            Vector3d cam = pActiveRenderInfo.getPosition();

            mc.level.players().stream().filter(p -> pClippingHelper.isVisible(p.getBoundingBoxForCulling())).forEach(player -> {
                Vector3d playerPos = player.getPosition(pPartialTicks);
                RenderHelper.renderFloatingText(
                        new StringTextComponent(player.getUUID().toString()),
                        new Vector3d(playerPos.x(), playerPos.y()+ player.getBbHeight() + 0.8, playerPos.z()),
                        /*new Vector3d(player.getX(), player.getBbHeight() + 0.5D, player.getZ()),*/
                        pMatrixStack, pBuffer, pActiveRenderInfo ,-1);
                pBuffer.endBatch();
            });

        }
    }

}

@@ -577,16 +577,17 @@
 r() %7B /*
+ 
 NOP */ %7D
@@ -587,16 +587,16 @@
 OP */ %7D%0A
-
 %0A    sta
@@ -820,16 +820,36 @@
 layer !=
+ null && mc.level !=
  null)%0A 
@@ -913,25 +913,24 @@
 Position();%0A
-%0A
             
@@ -1046,16 +1046,126 @@
 er -%3E %7B%0A
+                int packedLight = mc.getEntityRenderDispatcher().getPackedLightCoords(player, pPartialTicks);%0A
         
@@ -1281,86 +1281,8 @@
 xt(%0A
-                        new StringTextComponent(player.getUUID().toString()),%0A
     
@@ -1416,153 +1416,143 @@
     
-/*new Vector3d(player.getX(), player.getBbHeight() + 0.5D, player.getZ()),*/%0A                        pMatrixStack, pBuffer, pActiveRenderInfo ,-1
+pMatrixStack, pBuffer, pActiveRenderInfo, -1,%0A                        new StringTextComponent(player.getUUID().toString()), packedLight
 );%0A 
@@ -1602,17 +1602,16 @@
     %7D);%0A
-%0A
         
@@ -1616,13 +1616,12 @@
   %7D%0A
+
     %7D%0A
-%0A
 %7D%0A

Use of packedLight for rendering text. (Just some silly test code)