Nametags | forge 1.16.5 ready

Начинающий
Статус
Оффлайн
Регистрация
16 Сен 2023
Сообщения
103
Реакции[?]
4
Поинты[?]
7K
не видел тут неймтегов под forge, так что решил слить
Пожалуйста, авторизуйтесь для просмотра ссылки.

up chatgpt улучшил код, теперь нэймтэги не на весь экран, и работают без лагов
Nametags.java:
public class Nametags extends Module {
    private final NumberSetting scaleSetting = new NumberSetting("Scale", 0.5, 3.0, 1.0, 0.1);
    public Nametags() {
        super("Nametags", 0, Category.VISUAL);
        addSetting(scaleSetting);
    }

    @SubscribeEvent
    public void onRenderWorldLast(RenderWorldLastEvent event) {
        if (mc.level == null || mc.player == null) {
            return;
        }

        MatrixStack matrixStack = event.getMatrixStack();
        List<AbstractClientPlayerEntity> players = mc.level.players();

        players.forEach(player -> {
            if (player == mc.player) return;
            ITextComponent displayName = player.getDisplayName();
            renderPlayerName(matrixStack, player, displayName);
        });
    }

    private void renderPlayerName(MatrixStack matrixStack, PlayerEntity player, ITextComponent name) {
        matrixStack.pushPose();
        double distance = mc.player.distanceTo(player);
        float scale = calculateScale(distance);
        applyCommonTransformations(matrixStack, player, scale);
        renderText(matrixStack, name, 0, -10);
        govnofix(matrixStack);
        matrixStack.popPose();
    }

    private float calculateScale(double distance) {
        float baseScale = (float) (scaleSetting.value * 0.02f);
        float maxScale = (float) (scaleSetting.value * 0.06f);
        float distanceFactor = Math.min((float)distance / 20f, 1f);
        return baseScale + (maxScale - baseScale) * distanceFactor;
    }

    private void applyCommonTransformations(MatrixStack matrixStack, PlayerEntity player, float scale) {
        double x = player.xo + (player.getX() - player.xo) * mc.getFrameTime();
        double y = player.yo + (player.getY() - player.yo) * mc.getFrameTime();
        double z = player.zo + (player.getZ() - player.zo) * mc.getFrameTime();
        double yOffset = player.getBbHeight() + 0.5D;
        matrixStack.translate(
                x - mc.gameRenderer.getMainCamera().getPosition().x(),
                y + yOffset - mc.gameRenderer.getMainCamera().getPosition().y(),
                z - mc.gameRenderer.getMainCamera().getPosition().z()
        );
        matrixStack.mulPose(mc.gameRenderer.getMainCamera().rotation());
        matrixStack.scale(-scale, -scale, scale);
        RenderSystem.enableBlend();
        RenderSystem.defaultBlendFunc();
        RenderSystem.disableDepthTest();
    }

    private void renderText(MatrixStack matrixStack, ITextComponent textComponent, int x, int y) {
        FontRenderer fontRenderer = mc.font;
        String text = textComponent.getString();
        float textWidth = fontRenderer.width(text);
        float textHeight = fontRenderer.lineHeight;
        float padding = 2.0F;
        int backgroundColor = new Color(0, 0, 0, 150).getRGB();
        Matrix4f matrix4f = matrixStack.last().pose();
        int backgroundX = (int) (x - textWidth / 2.0F - padding);
        int backgroundY = (int) (y - padding);
        int backgroundWidth = (int) (textWidth + padding * 2.0F);
        int backgroundHeight = (int) (textHeight + padding * 2.0F);

        RenderSystem.disableTexture();
        RenderSystem.enableBlend();
        RenderSystem.defaultBlendFunc();
        Tessellator tessellator = Tessellator.getInstance();
        BufferBuilder bufferbuilder = tessellator.getBuilder();
        bufferbuilder.begin(7, DefaultVertexFormats.POSITION_COLOR);
        bufferbuilder.vertex(matrix4f, backgroundX, backgroundY + backgroundHeight, 0).color(backgroundColor >> 16 & 255, backgroundColor >> 8 & 255, backgroundColor & 255, backgroundColor >> 24 & 255).endVertex();
        bufferbuilder.vertex(matrix4f, backgroundX + backgroundWidth, backgroundY + backgroundHeight, 0).color(backgroundColor >> 16 & 255, backgroundColor >> 8 & 255, backgroundColor & 255, backgroundColor >> 24 & 255).endVertex();
        bufferbuilder.vertex(matrix4f, backgroundX + backgroundWidth, backgroundY, 0).color(backgroundColor >> 16 & 255, backgroundColor >> 8 & 255, backgroundColor & 255, backgroundColor >> 24 & 255).endVertex();
        bufferbuilder.vertex(matrix4f, backgroundX, backgroundY, 0).color(backgroundColor >> 16 & 255, backgroundColor >> 8 & 255, backgroundColor & 255, backgroundColor >> 24 & 255).endVertex();
        tessellator.end();
        RenderSystem.disableBlend();
        RenderSystem.enableTexture();
        fontRenderer.drawInBatch(textComponent, x - textWidth / 2.0F, y, 0xFFFFFF, false, matrix4f, mc.renderBuffers().bufferSource(), true, 0, 15728880);
        RenderSystem.disableBlend();
    }

    private void govnofix(MatrixStack matrixStack) {
        String distanceText = ".";
        int x = 99999;
        int y = 99999;
        Matrix4f matrix4f = matrixStack.last().pose();
        mc.font.drawInBatch(distanceText, x, y, 0xFFFFFF, false, matrix4f, mc.renderBuffers().bufferSource(), false, 0, 15728880);
    }
}
 
Последнее редактирование:
Начинающий
Статус
Оффлайн
Регистрация
26 Дек 2023
Сообщения
1,173
Реакции[?]
15
Поинты[?]
6K
не видел тут неймтегов под forge, так что решил слить
Пожалуйста, авторизуйтесь для просмотра ссылки.

Nametags.java:
public class Nametags extends Module {
    NumberSetting Scale = new NumberSetting("Scale", 1, 100, 50, 1);
    public Nametags() {
        super("Nametags", 0, Category.VISUAL);
        addSetting(Scale);
    }


    @SubscribeEvent
    public void onRenderWorldLast(RenderWorldLastEvent event) {
        if (mc.level == null || mc.player == null) {
            return;
        }

        MatrixStack matrixStack = event.getMatrixStack();
        List<PlayerEntity> players = mc.level.getEntitiesOfClass(PlayerEntity.class, mc.player.getBoundingBox().inflate(50.0D));


        players.forEach(player -> {
            if (player == mc.player) return;
            ITextComponent displayName = player.getDisplayName();
            renderPlayerName(matrixStack, player, displayName);
        });
    }



    private void renderPlayerName(MatrixStack matrixStack, PlayerEntity player, ITextComponent name) {
        matrixStack.pushPose();
        double distance = mc.player.distanceTo(player);
        float scale = (float) (0.025F * (((float) distance / 4F)) + Scale.value / 10000);
        applyCommonTransformations(matrixStack, player, scale);
        renderText(matrixStack, name, 0, -10);
        govnofix(matrixStack);
        matrixStack.popPose();
    }

    private void applyCommonTransformations(MatrixStack matrixStack, PlayerEntity player, float scale) {
        double yOffset = player.getBbHeight() + 0.5D;
        matrixStack.translate(
                player.getX() - mc.gameRenderer.getMainCamera().getPosition().x(),
                player.getY() + yOffset- mc.gameRenderer.getMainCamera().getPosition().y(),
                player.getZ() - mc.gameRenderer.getMainCamera().getPosition().z()
        );
        matrixStack.mulPose(mc.gameRenderer.getMainCamera().rotation());
        matrixStack.scale(-scale, -scale, scale);
        RenderSystem.enableBlend();
        RenderSystem.defaultBlendFunc();
        RenderSystem.disableDepthTest();
    }

    private void renderText(MatrixStack matrixStack, ITextComponent textComponent, int x, int y) {
        FontRenderer fontRenderer = mc.font;
        String text = textComponent.getString();
        float textWidth = fontRenderer.width(text);
        float textHeight = fontRenderer.lineHeight;
        float padding = 2.0F;
        int backgroundColor = 0x90000000;
        Matrix4f matrix4f = matrixStack.last().pose();
        int backgroundX = (int) (x - textWidth / 2.0F - padding);
        int backgroundY = (int) (y - padding);
        int backgroundWidth = (int) (textWidth + padding * 2.0F);
        int backgroundHeight = (int) (textHeight + padding * 2.0F);

        RenderSystem.disableTexture();
        RenderSystem.enableBlend();
        RenderSystem.defaultBlendFunc();
        Tessellator tessellator = Tessellator.getInstance();
        BufferBuilder bufferbuilder = tessellator.getBuilder();
        bufferbuilder.begin(7, DefaultVertexFormats.POSITION_COLOR); // 7 for GL_QUADS
        bufferbuilder.vertex(matrix4f, backgroundX, backgroundY + backgroundHeight, 0).color(backgroundColor >> 16 & 255, backgroundColor >> 8 & 255, backgroundColor & 255, backgroundColor >> 24 & 255).endVertex();
        bufferbuilder.vertex(matrix4f, backgroundX + backgroundWidth, backgroundY + backgroundHeight, 0).color(backgroundColor >> 16 & 255, backgroundColor >> 8 & 255, backgroundColor & 255, backgroundColor >> 24 & 255).endVertex();
        bufferbuilder.vertex(matrix4f, backgroundX + backgroundWidth, backgroundY, 0).color(backgroundColor >> 16 & 255, backgroundColor >> 8 & 255, backgroundColor & 255, backgroundColor >> 24 & 255).endVertex();
        bufferbuilder.vertex(matrix4f, backgroundX, backgroundY, 0).color(backgroundColor >> 16 & 255, backgroundColor >> 8 & 255, backgroundColor & 255, backgroundColor >> 24 & 255).endVertex();
        tessellator.end();
        RenderSystem.disableBlend();
        RenderSystem.enableTexture();
        fontRenderer.drawInBatch(textComponent, x - textWidth / 2.0F, y, 0xFFFFFF, false, matrix4f, mc.renderBuffers().bufferSource(), true, 0, 15728880);
        RenderSystem.disableBlend();
    }


    private void govnofix(MatrixStack matrixStack) {
        String distanceText = ".";
        int x = 99999;
        int y = 99999;
        Matrix4f matrix4f = matrixStack.last().pose();
        mc.font.drawInBatch(distanceText, x, y, 0xFFFFFF, false, matrix4f, mc.renderBuffers().bufferSource(), false, 0, 15728880);
    }
}
респект
 
Начинающий
Статус
Оффлайн
Регистрация
25 Янв 2024
Сообщения
467
Реакции[?]
1
Поинты[?]
3K
не видел тут неймтегов под forge, так что решил слить
Пожалуйста, авторизуйтесь для просмотра ссылки.

Nametags.java:
public class Nametags extends Module {
    NumberSetting Scale = new NumberSetting("Scale", 1, 100, 50, 1);
    public Nametags() {
        super("Nametags", 0, Category.VISUAL);
        addSetting(Scale);
    }


    @SubscribeEvent
    public void onRenderWorldLast(RenderWorldLastEvent event) {
        if (mc.level == null || mc.player == null) {
            return;
        }

        MatrixStack matrixStack = event.getMatrixStack();
        List<PlayerEntity> players = mc.level.getEntitiesOfClass(PlayerEntity.class, mc.player.getBoundingBox().inflate(50.0D));


        players.forEach(player -> {
            if (player == mc.player) return;
            ITextComponent displayName = player.getDisplayName();
            renderPlayerName(matrixStack, player, displayName);
        });
    }



    private void renderPlayerName(MatrixStack matrixStack, PlayerEntity player, ITextComponent name) {
        matrixStack.pushPose();
        double distance = mc.player.distanceTo(player);
        float scale = (float) (0.025F * (((float) distance / 4F)) + Scale.value / 10000);
        applyCommonTransformations(matrixStack, player, scale);
        renderText(matrixStack, name, 0, -10);
        govnofix(matrixStack);
        matrixStack.popPose();
    }

    private void applyCommonTransformations(MatrixStack matrixStack, PlayerEntity player, float scale) {
        double yOffset = player.getBbHeight() + 0.5D;
        matrixStack.translate(
                player.getX() - mc.gameRenderer.getMainCamera().getPosition().x(),
                player.getY() + yOffset- mc.gameRenderer.getMainCamera().getPosition().y(),
                player.getZ() - mc.gameRenderer.getMainCamera().getPosition().z()
        );
        matrixStack.mulPose(mc.gameRenderer.getMainCamera().rotation());
        matrixStack.scale(-scale, -scale, scale);
        RenderSystem.enableBlend();
        RenderSystem.defaultBlendFunc();
        RenderSystem.disableDepthTest();
    }

    private void renderText(MatrixStack matrixStack, ITextComponent textComponent, int x, int y) {
        FontRenderer fontRenderer = mc.font;
        String text = textComponent.getString();
        float textWidth = fontRenderer.width(text);
        float textHeight = fontRenderer.lineHeight;
        float padding = 2.0F;
        int backgroundColor = 0x90000000;
        Matrix4f matrix4f = matrixStack.last().pose();
        int backgroundX = (int) (x - textWidth / 2.0F - padding);
        int backgroundY = (int) (y - padding);
        int backgroundWidth = (int) (textWidth + padding * 2.0F);
        int backgroundHeight = (int) (textHeight + padding * 2.0F);

        RenderSystem.disableTexture();
        RenderSystem.enableBlend();
        RenderSystem.defaultBlendFunc();
        Tessellator tessellator = Tessellator.getInstance();
        BufferBuilder bufferbuilder = tessellator.getBuilder();
        bufferbuilder.begin(7, DefaultVertexFormats.POSITION_COLOR); // 7 for GL_QUADS
        bufferbuilder.vertex(matrix4f, backgroundX, backgroundY + backgroundHeight, 0).color(backgroundColor >> 16 & 255, backgroundColor >> 8 & 255, backgroundColor & 255, backgroundColor >> 24 & 255).endVertex();
        bufferbuilder.vertex(matrix4f, backgroundX + backgroundWidth, backgroundY + backgroundHeight, 0).color(backgroundColor >> 16 & 255, backgroundColor >> 8 & 255, backgroundColor & 255, backgroundColor >> 24 & 255).endVertex();
        bufferbuilder.vertex(matrix4f, backgroundX + backgroundWidth, backgroundY, 0).color(backgroundColor >> 16 & 255, backgroundColor >> 8 & 255, backgroundColor & 255, backgroundColor >> 24 & 255).endVertex();
        bufferbuilder.vertex(matrix4f, backgroundX, backgroundY, 0).color(backgroundColor >> 16 & 255, backgroundColor >> 8 & 255, backgroundColor & 255, backgroundColor >> 24 & 255).endVertex();
        tessellator.end();
        RenderSystem.disableBlend();
        RenderSystem.enableTexture();
        fontRenderer.drawInBatch(textComponent, x - textWidth / 2.0F, y, 0xFFFFFF, false, matrix4f, mc.renderBuffers().bufferSource(), true, 0, 15728880);
        RenderSystem.disableBlend();
    }


    private void govnofix(MatrixStack matrixStack) {
        String distanceText = ".";
        int x = 99999;
        int y = 99999;
        Matrix4f matrix4f = matrixStack.last().pose();
        mc.font.drawInBatch(distanceText, x, y, 0xFFFFFF, false, matrix4f, mc.renderBuffers().bufferSource(), false, 0, 15728880);
    }
}
gpt broy fppfpfpf
 
Начинающий
Статус
Оффлайн
Регистрация
8 Ноя 2024
Сообщения
52
Реакции[?]
0
Поинты[?]
0
бля , такое чувство что ты переписал вулкан есп слитые
а так ну вроде нормик
private void govnofix(MatrixStack matrixStack) { String distanceText = "."; int x = 99999; int y = 99999; Matrix4f matrix4f = matrixStack.last().pose(); mc.font.drawInBatch(distanceText, x, y, 0xFFFFFF, false, matrix4f, mc.renderBuffers().bufferSource(), false, 0, 15728880); }
если не секрет, фикс чего?
 
Начинающий
Статус
Оффлайн
Регистрация
16 Сен 2023
Сообщения
103
Реакции[?]
4
Поинты[?]
7K
Начинающий
Статус
Оффлайн
Регистрация
1 Янв 2025
Сообщения
16
Реакции[?]
0
Поинты[?]
0
не видел тут неймтегов под forge, так что решил слить
Пожалуйста, авторизуйтесь для просмотра ссылки.

Nametags.java:
public class Nametags extends Module {
    NumberSetting Scale = new NumberSetting("Scale", 1, 100, 50, 1);
    public Nametags() {
        super("Nametags", 0, Category.VISUAL);
        addSetting(Scale);
    }


    @SubscribeEvent
    public void onRenderWorldLast(RenderWorldLastEvent event) {
        if (mc.level == null || mc.player == null) {
            return;
        }

        MatrixStack matrixStack = event.getMatrixStack();
        List<PlayerEntity> players = mc.level.getEntitiesOfClass(PlayerEntity.class, mc.player.getBoundingBox().inflate(50.0D));


        players.forEach(player -> {
            if (player == mc.player) return;
            ITextComponent displayName = player.getDisplayName();
            renderPlayerName(matrixStack, player, displayName);
        });
    }



    private void renderPlayerName(MatrixStack matrixStack, PlayerEntity player, ITextComponent name) {
        matrixStack.pushPose();
        double distance = mc.player.distanceTo(player);
        float scale = (float) (0.025F * (((float) distance / 4F)) + Scale.value / 10000);
        applyCommonTransformations(matrixStack, player, scale);
        renderText(matrixStack, name, 0, -10);
        govnofix(matrixStack);
        matrixStack.popPose();
    }

    private void applyCommonTransformations(MatrixStack matrixStack, PlayerEntity player, float scale) {
        double yOffset = player.getBbHeight() + 0.5D;
        matrixStack.translate(
                player.getX() - mc.gameRenderer.getMainCamera().getPosition().x(),
                player.getY() + yOffset- mc.gameRenderer.getMainCamera().getPosition().y(),
                player.getZ() - mc.gameRenderer.getMainCamera().getPosition().z()
        );
        matrixStack.mulPose(mc.gameRenderer.getMainCamera().rotation());
        matrixStack.scale(-scale, -scale, scale);
        RenderSystem.enableBlend();
        RenderSystem.defaultBlendFunc();
        RenderSystem.disableDepthTest();
    }

    private void renderText(MatrixStack matrixStack, ITextComponent textComponent, int x, int y) {
        FontRenderer fontRenderer = mc.font;
        String text = textComponent.getString();
        float textWidth = fontRenderer.width(text);
        float textHeight = fontRenderer.lineHeight;
        float padding = 2.0F;
        int backgroundColor = 0x90000000;
        Matrix4f matrix4f = matrixStack.last().pose();
        int backgroundX = (int) (x - textWidth / 2.0F - padding);
        int backgroundY = (int) (y - padding);
        int backgroundWidth = (int) (textWidth + padding * 2.0F);
        int backgroundHeight = (int) (textHeight + padding * 2.0F);

        RenderSystem.disableTexture();
        RenderSystem.enableBlend();
        RenderSystem.defaultBlendFunc();
        Tessellator tessellator = Tessellator.getInstance();
        BufferBuilder bufferbuilder = tessellator.getBuilder();
        bufferbuilder.begin(7, DefaultVertexFormats.POSITION_COLOR); // 7 for GL_QUADS
        bufferbuilder.vertex(matrix4f, backgroundX, backgroundY + backgroundHeight, 0).color(backgroundColor >> 16 & 255, backgroundColor >> 8 & 255, backgroundColor & 255, backgroundColor >> 24 & 255).endVertex();
        bufferbuilder.vertex(matrix4f, backgroundX + backgroundWidth, backgroundY + backgroundHeight, 0).color(backgroundColor >> 16 & 255, backgroundColor >> 8 & 255, backgroundColor & 255, backgroundColor >> 24 & 255).endVertex();
        bufferbuilder.vertex(matrix4f, backgroundX + backgroundWidth, backgroundY, 0).color(backgroundColor >> 16 & 255, backgroundColor >> 8 & 255, backgroundColor & 255, backgroundColor >> 24 & 255).endVertex();
        bufferbuilder.vertex(matrix4f, backgroundX, backgroundY, 0).color(backgroundColor >> 16 & 255, backgroundColor >> 8 & 255, backgroundColor & 255, backgroundColor >> 24 & 255).endVertex();
        tessellator.end();
        RenderSystem.disableBlend();
        RenderSystem.enableTexture();
        fontRenderer.drawInBatch(textComponent, x - textWidth / 2.0F, y, 0xFFFFFF, false, matrix4f, mc.renderBuffers().bufferSource(), true, 0, 15728880);
        RenderSystem.disableBlend();
    }


    private void govnofix(MatrixStack matrixStack) {
        String distanceText = ".";
        int x = 99999;
        int y = 99999;
        Matrix4f matrix4f = matrixStack.last().pose();
        mc.font.drawInBatch(distanceText, x, y, 0xFFFFFF, false, matrix4f, mc.renderBuffers().bufferSource(), false, 0, 15728880);
    }
}
го на фабрик
 
Начинающий
Статус
Оффлайн
Регистрация
26 Дек 2023
Сообщения
1,173
Реакции[?]
15
Поинты[?]
6K
Забаненный
Статус
Оффлайн
Регистрация
7 Дек 2024
Сообщения
28
Реакции[?]
0
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
не видел тут неймтегов под forge, так что решил слить
Пожалуйста, авторизуйтесь для просмотра ссылки.

up chatgpt улучшил код, теперь нэймтэги не на весь экран, и работают без лагов
Nametags.java:
public class Nametags extends Module {
    private final NumberSetting scaleSetting = new NumberSetting("Scale", 0.5, 3.0, 1.0, 0.1);
    public Nametags() {
        super("Nametags", 0, Category.VISUAL);
        addSetting(scaleSetting);
    }

    @SubscribeEvent
    public void onRenderWorldLast(RenderWorldLastEvent event) {
        if (mc.level == null || mc.player == null) {
            return;
        }

        MatrixStack matrixStack = event.getMatrixStack();
        List<AbstractClientPlayerEntity> players = mc.level.players();

        players.forEach(player -> {
            if (player == mc.player) return;
            ITextComponent displayName = player.getDisplayName();
            renderPlayerName(matrixStack, player, displayName);
        });
    }

    private void renderPlayerName(MatrixStack matrixStack, PlayerEntity player, ITextComponent name) {
        matrixStack.pushPose();
        double distance = mc.player.distanceTo(player);
        float scale = calculateScale(distance);
        applyCommonTransformations(matrixStack, player, scale);
        renderText(matrixStack, name, 0, -10);
        govnofix(matrixStack);
        matrixStack.popPose();
    }

    private float calculateScale(double distance) {
        float baseScale = (float) (scaleSetting.value * 0.02f);
        float maxScale = (float) (scaleSetting.value * 0.06f);
        float distanceFactor = Math.min((float)distance / 20f, 1f);
        return baseScale + (maxScale - baseScale) * distanceFactor;
    }

    private void applyCommonTransformations(MatrixStack matrixStack, PlayerEntity player, float scale) {
        double x = player.xo + (player.getX() - player.xo) * mc.getFrameTime();
        double y = player.yo + (player.getY() - player.yo) * mc.getFrameTime();
        double z = player.zo + (player.getZ() - player.zo) * mc.getFrameTime();
        double yOffset = player.getBbHeight() + 0.5D;
        matrixStack.translate(
                x - mc.gameRenderer.getMainCamera().getPosition().x(),
                y + yOffset - mc.gameRenderer.getMainCamera().getPosition().y(),
                z - mc.gameRenderer.getMainCamera().getPosition().z()
        );
        matrixStack.mulPose(mc.gameRenderer.getMainCamera().rotation());
        matrixStack.scale(-scale, -scale, scale);
        RenderSystem.enableBlend();
        RenderSystem.defaultBlendFunc();
        RenderSystem.disableDepthTest();
    }

    private void renderText(MatrixStack matrixStack, ITextComponent textComponent, int x, int y) {
        FontRenderer fontRenderer = mc.font;
        String text = textComponent.getString();
        float textWidth = fontRenderer.width(text);
        float textHeight = fontRenderer.lineHeight;
        float padding = 2.0F;
        int backgroundColor = new Color(0, 0, 0, 150).getRGB();
        Matrix4f matrix4f = matrixStack.last().pose();
        int backgroundX = (int) (x - textWidth / 2.0F - padding);
        int backgroundY = (int) (y - padding);
        int backgroundWidth = (int) (textWidth + padding * 2.0F);
        int backgroundHeight = (int) (textHeight + padding * 2.0F);

        RenderSystem.disableTexture();
        RenderSystem.enableBlend();
        RenderSystem.defaultBlendFunc();
        Tessellator tessellator = Tessellator.getInstance();
        BufferBuilder bufferbuilder = tessellator.getBuilder();
        bufferbuilder.begin(7, DefaultVertexFormats.POSITION_COLOR);
        bufferbuilder.vertex(matrix4f, backgroundX, backgroundY + backgroundHeight, 0).color(backgroundColor >> 16 & 255, backgroundColor >> 8 & 255, backgroundColor & 255, backgroundColor >> 24 & 255).endVertex();
        bufferbuilder.vertex(matrix4f, backgroundX + backgroundWidth, backgroundY + backgroundHeight, 0).color(backgroundColor >> 16 & 255, backgroundColor >> 8 & 255, backgroundColor & 255, backgroundColor >> 24 & 255).endVertex();
        bufferbuilder.vertex(matrix4f, backgroundX + backgroundWidth, backgroundY, 0).color(backgroundColor >> 16 & 255, backgroundColor >> 8 & 255, backgroundColor & 255, backgroundColor >> 24 & 255).endVertex();
        bufferbuilder.vertex(matrix4f, backgroundX, backgroundY, 0).color(backgroundColor >> 16 & 255, backgroundColor >> 8 & 255, backgroundColor & 255, backgroundColor >> 24 & 255).endVertex();
        tessellator.end();
        RenderSystem.disableBlend();
        RenderSystem.enableTexture();
        fontRenderer.drawInBatch(textComponent, x - textWidth / 2.0F, y, 0xFFFFFF, false, matrix4f, mc.renderBuffers().bufferSource(), true, 0, 15728880);
        RenderSystem.disableBlend();
    }

    private void govnofix(MatrixStack matrixStack) {
        String distanceText = ".";
        int x = 99999;
        int y = 99999;
        Matrix4f matrix4f = matrixStack.last().pose();
        mc.font.drawInBatch(distanceText, x, y, 0xFFFFFF, false, matrix4f, mc.renderBuffers().bufferSource(), false, 0, 15728880);
    }
}
хз, но выглядит как дерьмо
 
Сверху Снизу