• Ищем качественного (не новичок) разработчиков Xenforo для этого форума! В идеале, чтобы ты был фулл стек программистом. Если у тебя есть что показать, то свяжись с нами по контактным данным: https://t.me/DREDD

Визуальная часть BossBar большой не многа

Забаненный
Забаненный
Статус
Оффлайн
Регистрация
28 Авг 2023
Сообщения
135
Реакции
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Выберите загрузчик игры
  1. Vanilla
  2. Forge
  3. Fabric
  4. NeoForge
  5. OptiFine
  6. ForgeOptiFine
  7. Прочие моды
1751734953099.png

типа селфкод:
Expand Collapse Copy
package code.vredux.ui.clienthud.impl;

import com.mojang.blaze3d.matrix.MatrixStack;
import code.vredux.Vredux;
import code.vredux.events.EventRender2D;
import code.vredux.manager.Theme;
import code.vredux.manager.drag.Dragging;
import code.vredux.modules.impl.visual.Hud;
import code.vredux.ui.clienthud.updater.ElementRenderer;
import code.vredux.utils.math.Vector4i;
import code.vredux.utils.render.color.ColorUtility;
import code.vredux.utils.render.engine2d.RenderUtility;
import code.vredux.utils.render.font.Fonts;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.experimental.FieldDefaults;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ClientBossInfo;
import net.minecraft.world.BossInfo;

import java.util.Collection;

/*
 * кароче хз что писать но
 * Рич форевер
 */
@FieldDefaults(level = AccessLevel.PRIVATE)
@RequiredArgsConstructor
public class BossBarHud implements ElementRenderer {

    final Dragging dragging;
    final Minecraft mc = Minecraft.getInstance();

    float width = 250;
    float height = 30;

    float animatedProgress = 0;
    float animatedAlpha = 0;
    float animatedWidth = 0;
    float animatedHeight = 0;
    String lastBossName = "";
    float barGlowIntensity = 0;
    float pulseAnimation = 0;
    float textAnimationScale = 1.0f;
    float percentageAnimationAlpha = 0;

    long lastUpdateTime = System.currentTimeMillis();
    float deltaTime = 0;

    @Override
    public void render(EventRender2D eventRender2D) {
        long currentTime = System.currentTimeMillis();
        deltaTime = Math.min((currentTime - lastUpdateTime) / 1000.0f, 0.05f);
        lastUpdateTime = currentTime;

        Collection<ClientBossInfo> bossInfos = mc.ingameGUI.getBossOverlay().getActiveBossBars();
        if (bossInfos.isEmpty()) {
            animatedAlpha = smoothLerp(animatedAlpha, 0, 3.0f);
            percentageAnimationAlpha = smoothLerp(percentageAnimationAlpha, 0, 4.0f);
            barGlowIntensity = smoothLerp(barGlowIntensity, 0, 5.0f);
            if (animatedAlpha < 0.01f) {
                return;
            }
        } else {
            animatedAlpha = 1.0f;
            percentageAnimationAlpha = 1.0f;
            barGlowIntensity = smoothLerp(barGlowIntensity, 1, 2.0f);
        }

        MatrixStack ms = eventRender2D.getMatrixStack();

        float posX = dragging.getX();
        float posY = dragging.getY();

        if (!bossInfos.isEmpty()) {
            BossInfo boss = bossInfos.iterator().next();
            String bossName = boss.getName().getString();
            float progress = boss.getPercent();

            animatedProgress = smoothLerp(animatedProgress, progress, 2.5f);

            lastBossName = bossName;

            pulseAnimation += deltaTime * 3.0f;

            textAnimationScale = smoothLerp(textAnimationScale, 1.0f, 8.0f);

            Hud hud = Vredux.getInst().getModuleManager().getHud();

            if (hud.tHudMode.is("Обычный")) {
                renderNormalMode(ms, posX, posY, bossName, animatedProgress);
            } else if (hud.tHudMode.is("Большой")) {
                renderBigMode(ms, posX, posY, bossName, animatedProgress);
            } else {
                renderModernMode(ms, posX, posY, bossName, animatedProgress);
            }
        }

        dragging.setWidth(width);
        dragging.setHeight(height);
    }

    private void renderNormalMode(MatrixStack ms, float posX, float posY, String bossName, float progress) {
        Fonts.sf.drawText(ms, bossName, posX + 1, posY + 3, ColorUtility.rgba(0, 0, 0, (int)(150 * animatedAlpha)), 9);
        Fonts.sf.drawText(ms, bossName, posX, posY + 2, ColorUtility.rgba(getRGB(Theme.textColor)[0], getRGB(Theme.textColor)[1], getRGB(Theme.textColor)[2], (int)(255 * animatedAlpha)), 9);
       
        float barWidth = width;
        float barHeight = 8;
        float barX = posX;
        float barY = posY + 12;

        float pulseFactor = (float)(Math.sin(pulseAnimation) * 0.1f + 0.9f);
        RenderUtility.drawRoundedRect(barX, barY, barWidth, barHeight, 4,
                ColorUtility.rgba(30, 30, 30, (int)(180 * animatedAlpha * pulseFactor)));

        Vector4i progressColor = getHealthColorWithAlpha(progress, animatedAlpha);
        RenderUtility.drawRoundedRect(barX, barY, barWidth * progress, barHeight, 4, progressColor);

        if (progress > 0.1f && barGlowIntensity > 0.1f) {
            float glowAlpha = (float)(Math.sin(pulseAnimation * 2) * 0.3f + 0.7f) * barGlowIntensity * animatedAlpha;
            RenderUtility.drawRoundedRect(barX, barY + 1, barWidth * progress, barHeight - 2, 3,
                    ColorUtility.rgba(255, 255, 255, (int)(40 * glowAlpha)));
        }

        String healthText = Math.round(progress * 100) + "%";
        float textWidth = Fonts.sf.getWidth(healthText, 8);
        int healthTextColor = getHealthTextColorWithAlpha(progress, animatedAlpha * percentageAnimationAlpha);

        ms.push();
        ms.scale(textAnimationScale, textAnimationScale, 1.0f);
        float scaledX = (posX + barWidth - textWidth - 2) / textAnimationScale;
        float scaledY = (posY + 2) / textAnimationScale;
        Fonts.sf.drawText(ms, healthText, scaledX, scaledY, healthTextColor, 8);
        ms.pop();
    }

    private void renderBigMode(MatrixStack ms, float posX, float posY, String bossName, float progress) {
        width = 300;
        height = 35;

        Fonts.sf.drawText(ms, bossName, posX + 1, posY + 3, ColorUtility.rgba(0, 0, 0, (int)(150 * animatedAlpha)), 11);
        Fonts.sf.drawText(ms, bossName, posX, posY + 2, ColorUtility.rgba(getRGB(Theme.textColor)[0], getRGB(Theme.textColor)[1], getRGB(Theme.textColor)[2], (int)(255 * animatedAlpha)), 11);

        float barWidth = width;
        float barHeight = 10;
        float barX = posX;
        float barY = posY + 15;

        float borderPulse = (float)(Math.sin(pulseAnimation * 1.5f) * 0.2f + 0.8f);
        RenderUtility.drawRoundedRect(barX - 1, barY - 1, barWidth + 2, barHeight + 2, 5,
                ColorUtility.rgba(60, 60, 60, (int)(120 * animatedAlpha * borderPulse)));
        RenderUtility.drawRoundedRect(barX, barY, barWidth, barHeight, 4,
                ColorUtility.rgba(20, 20, 20, (int)(200 * animatedAlpha)));

        Vector4i progressColor = getHealthColorWithAlpha(progress, animatedAlpha);
        RenderUtility.drawRoundedRect(barX, barY, barWidth * progress, barHeight, 4, progressColor);

        if (progress > 0.1f && barGlowIntensity > 0.1f) {
            float glowTime = (System.currentTimeMillis() % 2000) / 2000f;
            float glowAlpha = (float)(Math.sin(glowTime * Math.PI * 3) * 0.4f + 0.6f) * barGlowIntensity * animatedAlpha;
            RenderUtility.drawRoundedRect(barX, barY + 1, barWidth * progress, barHeight - 2, 3,
                    ColorUtility.rgba(255, 255, 255, (int)(50 * glowAlpha)));

            float waveOffset = (glowTime * barWidth * progress) % (barWidth * progress);
            if (waveOffset > 0) {
                RenderUtility.drawRoundedRect(barX + waveOffset - 10, barY, 20, barHeight, 4,
                        ColorUtility.rgba(255, 255, 255, (int)(30 * glowAlpha)));
            }
        }

        String healthText = Math.round(progress * 100) + "%";
        float textWidth = Fonts.sf.getWidth(healthText, 9);
        int healthTextColor = getHealthTextColorWithAlpha(progress, animatedAlpha * percentageAnimationAlpha);

        ms.push();
        float textPulse = (float)(Math.sin(pulseAnimation * 2) * 0.1f + 1.0f) * textAnimationScale;
        ms.scale(textPulse, textPulse, 1.0f);
        float scaledX = (posX + (barWidth - textWidth) / 2) / textPulse;
        float scaledY = (posY + 27) / textPulse;
        Fonts.sf.drawText(ms, healthText, scaledX, scaledY, healthTextColor, 9);
        ms.pop();
    }

    private void renderModernMode(MatrixStack ms, float posX, float posY, String bossName, float progress) {
        width = 280;
        height = 25;

        Fonts.sf.drawText(ms, bossName, posX, posY + 2, ColorUtility.rgba(getRGB(Theme.textColor)[0], getRGB(Theme.textColor)[1], getRGB(Theme.textColor)[2], (int)(255 * animatedAlpha)), 10);

        float barWidth = width;
        float barHeight = 6;
        float barX = posX;
        float barY = posY + 12;

        float backgroundPulse = (float)(Math.sin(pulseAnimation * 0.5f) * 0.15f + 0.85f);
        RenderUtility.drawRoundedRect(barX, barY, barWidth, barHeight, 3,
                ColorUtility.rgba(40, 40, 40, (int)(160 * animatedAlpha * backgroundPulse)));

        Vector4i modernColor = new Vector4i(
                ColorUtility.rgba(getRGB(Theme.mainRectColor)[0], getRGB(Theme.mainRectColor)[1], getRGB(Theme.mainRectColor)[2], (int)(255 * animatedAlpha)),
                ColorUtility.rgba(getRGB(Theme.mainRectColor)[0], getRGB(Theme.mainRectColor)[1], getRGB(Theme.mainRectColor)[2], (int)(255 * animatedAlpha)),
                ColorUtility.rgba(getRGB(Theme.textColor)[0], getRGB(Theme.textColor)[1], getRGB(Theme.textColor)[2], (int)(255 * animatedAlpha)),
                ColorUtility.rgba(getRGB(Theme.textColor)[0], getRGB(Theme.textColor)[1], getRGB(Theme.textColor)[2], (int)(255 * animatedAlpha))
        );
        RenderUtility.drawRoundedRect(barX, barY, barWidth * progress, barHeight, 3, modernColor);

        if (progress > 0.05f && barGlowIntensity > 0.1f) {
            float glowTime = (System.currentTimeMillis() % 1200) / 1200f;
            float glowAlpha = (float)(Math.sin(glowTime * Math.PI * 4) * 0.5f + 0.5f) * barGlowIntensity * animatedAlpha;
            float glowX = barX + (barWidth * progress) - 4;

            RenderUtility.drawRoundedRect(glowX, barY - 1, 4, barHeight + 2, 2,
                    ColorUtility.rgba(255, 255, 255, (int)(150 * glowAlpha)));

            RenderUtility.drawRoundedRect(glowX - 8, barY, 8, barHeight, 2,
                    ColorUtility.rgba(255, 255, 255, (int)(50 * glowAlpha)));
        }

        String healthText = Math.round(progress * 100) + "%";
        float textWidth = Fonts.sf.getWidth(healthText, 8);
        int healthTextColor = getHealthTextColorWithAlpha(progress, animatedAlpha * percentageAnimationAlpha);

        ms.push();
        float textPulse = (float)(Math.sin(pulseAnimation * 1.5f) * 0.05f + 0.95f) * textAnimationScale;
        ms.scale(textPulse, textPulse, 1.0f);
        float scaledX = (posX + barWidth - textWidth) / textPulse;
        float scaledY = (posY + 20) / textPulse;
        Fonts.sf.drawText(ms, healthText, scaledX, scaledY, healthTextColor, 8);
        ms.pop();
    }

    private Vector4i getHealthColor(float progress) {
        if (progress > 0.75f) {
            return new Vector4i(
                    ColorUtility.rgba(85, 255, 85, 255),
                    ColorUtility.rgba(50, 255, 50, 255),
                    ColorUtility.rgba(40, 200, 40, 255),
                    ColorUtility.rgba(30, 150, 30, 255)
            );
        } else if (progress > 0.5f) {
            return new Vector4i(
                    ColorUtility.rgba(255, 255, 85, 255),
                    ColorUtility.rgba(255, 255, 50, 255),
                    ColorUtility.rgba(200, 200, 40, 255),
                    ColorUtility.rgba(150, 150, 30, 255)
            );
        } else if (progress > 0.25f) {
            return new Vector4i(
                    ColorUtility.rgba(255, 165, 50, 255),
                    ColorUtility.rgba(255, 140, 40, 255),
                    ColorUtility.rgba(200, 120, 30, 255),
                    ColorUtility.rgba(150, 100, 20, 255)
            );
        } else {
            return new Vector4i(
                    ColorUtility.rgba(255, 85, 85, 255),
                    ColorUtility.rgba(255, 50, 50, 255),
                    ColorUtility.rgba(200, 40, 40, 255),
                    ColorUtility.rgba(150, 30, 30, 255)
            );
        }
    }

    private Vector4i getHealthColorWithAlpha(float progress, float alpha) {
        int alphaInt = (int)(255 * alpha);
        if (progress > 0.75f) {
            return new Vector4i(
                    ColorUtility.rgba(85, 255, 85, alphaInt),
                    ColorUtility.rgba(50, 255, 50, alphaInt),
                    ColorUtility.rgba(40, 200, 40, alphaInt),
                    ColorUtility.rgba(30, 150, 30, alphaInt)
            );
        } else if (progress > 0.5f) {
            return new Vector4i(
                    ColorUtility.rgba(255, 255, 85, alphaInt),
                    ColorUtility.rgba(255, 255, 50, alphaInt),
                    ColorUtility.rgba(200, 200, 40, alphaInt),
                    ColorUtility.rgba(150, 150, 30, alphaInt)
            );
        } else if (progress > 0.25f) {
            return new Vector4i(
                    ColorUtility.rgba(255, 165, 50, alphaInt),
                    ColorUtility.rgba(255, 140, 40, alphaInt),
                    ColorUtility.rgba(200, 120, 30, alphaInt),
                    ColorUtility.rgba(150, 100, 20, alphaInt)
            );
        } else {
            return new Vector4i(
                    ColorUtility.rgba(255, 85, 85, alphaInt),
                    ColorUtility.rgba(255, 50, 50, alphaInt),
                    ColorUtility.rgba(200, 40, 40, alphaInt),
                    ColorUtility.rgba(150, 30, 30, alphaInt)
            );
        }
    }

    private int getHealthTextColorWithAlpha(float progress, float alpha) {
        int alphaInt = (int)(255 * alpha);
        if (progress > 0.75f) {
            return ColorUtility.rgba(85, 255, 85, alphaInt);
        } else if (progress > 0.5f) {
            return ColorUtility.rgba(255, 255, 85, alphaInt);
        } else if (progress > 0.25f) {
            return ColorUtility.rgba(255, 165, 50, alphaInt);
        } else {
            return ColorUtility.rgba(255, 85, 85, alphaInt);
        }
    }

    private int getHealthTextColor(float progress) {
        if (progress > 0.75f) {
            return ColorUtility.rgba(85, 255, 85, 255);
        } else if (progress > 0.5f) {
            return ColorUtility.rgba(255, 255, 85, 255);
        } else if (progress > 0.25f) {
            return ColorUtility.rgba(255, 165, 50, 255);
        } else {
            return ColorUtility.rgba(255, 85, 85, 255);
        }
    }

    private int[] getRGB(int color) {
        return new int[]{(color >> 16) & 0xFF, (color >> 8) & 0xFF, color & 0xFF};
    }

    private float smoothLerp(float start, float end, float speed) {
        float factor = 1.0f - (float)Math.exp(-speed * deltaTime);
        return start + factor * (end - start);
    }

    private float lerp(float start, float end, float factor) {
        return start + factor * (end - start);
    }
}


Написан на базе вредукса как можна понять по импортам ну ок да (первая работа каторая фигня я думаю)

переделал дизайн =D

(во вложение старый СС)
 

Вложения

  • 1751712578280.png
    1751712578280.png
    27.4 KB · Просмотры: 426
Последнее редактирование:

типа селфкод:
Expand Collapse Copy
package code.vredux.ui.clienthud.impl;

import com.mojang.blaze3d.matrix.MatrixStack;
import code.vredux.Vredux;
import code.vredux.events.EventRender2D;
import code.vredux.manager.Theme;
import code.vredux.manager.drag.Dragging;
import code.vredux.modules.impl.visual.Hud;
import code.vredux.ui.clienthud.updater.ElementRenderer;
import code.vredux.utils.math.Vector4i;
import code.vredux.utils.render.color.ColorUtility;
import code.vredux.utils.render.engine2d.RenderUtility;
import code.vredux.utils.render.font.Fonts;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.experimental.FieldDefaults;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ClientBossInfo;
import net.minecraft.world.BossInfo;

import java.util.Collection;

/*
 * кароче хз что писать но
 * Рич форевер
 */
@FieldDefaults(level = AccessLevel.PRIVATE)
@RequiredArgsConstructor
public class BossBarHud implements ElementRenderer {

    final Dragging dragging;
    final Minecraft mc = Minecraft.getInstance();

    float width = 300;
    float height = 50;

    @Override
    public void render(EventRender2D eventRender2D) {
        Collection<ClientBossInfo> bossInfos = mc.ingameGUI.getBossOverlay().getActiveBossBars();
        if (bossInfos.isEmpty()) {
            return;
        }
        MatrixStack ms = eventRender2D.getMatrixStack();

        float posX = dragging.getX();
        float posY = dragging.getY();

        BossInfo boss = bossInfos.iterator().next();
        String bossName = boss.getName().getString();
        float progress = boss.getPercent();

        Hud hud = Vredux.getInst().getModuleManager().getHud();

        drawGradientBackground(posX, posY);

        if (hud.tHudMode.is("Обычный")) {
            renderNormalMode(ms, posX, posY, bossName, progress);
        } else if (hud.tHudMode.is("Большой")) {
            renderBigMode(ms, posX, posY, bossName, progress);
        } else {
            renderModernMode(ms, posX, posY, bossName, progress);
        }

        dragging.setWidth(width);
        dragging.setHeight(height);
    }

    private void drawGradientBackground(float posX, float posY) {
        Vector4i backgroundGradient = new Vector4i(
                ColorUtility.rgba(25, 25, 25, 220),
                ColorUtility.rgba(15, 15, 15, 220),
                ColorUtility.rgba(10, 10, 10, 220),
                ColorUtility.rgba(20, 20, 20, 220)
        );
        RenderUtility.drawRoundedRect(posX, posY, width, height, 8, backgroundGradient);

        RenderUtility.drawRoundedRect(posX - 0.5f, posY - 0.5f, width + 1, height + 1, 8.5f,
                ColorUtility.rgba(60, 60, 60, 100));

        RenderUtility.drawRoundedRect(posX + 2, posY + 2, width - 4, height - 4, 6,
                ColorUtility.rgba(0, 0, 0, 60));
    }

    private void renderNormalMode(MatrixStack ms, float posX, float posY, String bossName, float progress) {

        Fonts.sf.drawText(ms, bossName, posX + 35, posY + 10, ColorUtility.rgba(0, 0, 0, 100), 10);
        Fonts.sf.drawText(ms, bossName, posX + 34, posY + 9, Theme.textColor, 10);

        float barWidth = width - 60;
        float barHeight = 6;
        float barX = posX + 30;
        float barY = posY + height - 18;

        Vector4i barBg = new Vector4i(
                ColorUtility.rgba(40, 40, 40, 255),
                ColorUtility.rgba(30, 30, 30, 255),
                ColorUtility.rgba(25, 25, 25, 255),
                ColorUtility.rgba(35, 35, 35, 255)
        );
        RenderUtility.drawRoundedRect(barX, barY, barWidth, barHeight, 3, barBg);

        Vector4i progressColor = getHealthColor(progress);
        RenderUtility.drawRoundedRect(barX, barY, barWidth * progress, barHeight, 3, progressColor);

        if (progress > 0.05f) {
            RenderUtility.drawRoundedRect(barX, barY, barWidth * progress, barHeight, 3,
                    ColorUtility.rgba(255, 255, 255, 30));
        }

        String healthText = Math.round(progress * 100) + "%";
        Fonts.sf.drawText(ms, healthText, posX + width - 40, posY + 9, getHealthTextColor(progress), 9);
    }

    private void renderBigMode(MatrixStack ms, float posX, float posY, String bossName, float progress) {
        drawBossIcon(ms, posX + 10, posY + 6);

        Fonts.sf.drawText(ms, bossName, posX + 40, posY + 8, ColorUtility.rgba(0, 0, 0, 120), 12);
        Fonts.sf.drawText(ms, bossName, posX + 39, posY + 7, Theme.textColor, 12);

        float barWidth = width - 50;
        float barHeight = 10;
        float barX = posX + 25;
        float barY = posY + height - 20;

        RenderUtility.drawRoundedRect(barX - 1, barY - 1, barWidth + 2, barHeight + 2, 5,
                ColorUtility.rgba(80, 80, 80, 200));
        RenderUtility.drawRoundedRect(barX, barY, barWidth, barHeight, 4,
                ColorUtility.rgba(20, 20, 20, 255));

        Vector4i progressColor = getHealthColor(progress);
        RenderUtility.drawRoundedRect(barX, barY, barWidth * progress, barHeight, 4, progressColor);

        if (progress > 0.1f) {
            RenderUtility.drawRoundedRect(barX, barY + 1, barWidth * progress, barHeight - 2, 3,
                    ColorUtility.rgba(255, 255, 255, 40));
        }

        String healthText = Math.round(progress * 100) + "%";
        Fonts.sf.drawCenteredText(ms, healthText, posX + width / 2, posY + height - 8,
                getHealthTextColor(progress), 10);
    }

    private void renderModernMode(MatrixStack ms, float posX, float posY, String bossName, float progress) {
        drawModernIcon(ms, posX + 12, posY + 12);

        Fonts.sf.drawText(ms, bossName, posX + 35, posY + 12, Theme.textColor, 11);

        float barWidth = width - 40;
        float barHeight = 4;
        float barX = posX + 20;
        float barY = posY + height - 15;

        RenderUtility.drawRoundedRect(barX, barY, barWidth, barHeight, 2,
                ColorUtility.rgba(50, 50, 50, 200));

        Vector4i modernColor = new Vector4i(Theme.mainRectColor, Theme.mainRectColor,
                Theme.textColor, Theme.textColor);
        RenderUtility.drawRoundedRect(barX, barY, barWidth * progress, barHeight, 2, modernColor);

        if (progress > 0.1f) {
            float glowX = barX + (barWidth * progress) - 4;
            RenderUtility.drawRoundedRect(glowX, barY - 1, 4, barHeight + 2, 2,
                    ColorUtility.rgba(255, 255, 255, 180));
            RenderUtility.drawRoundedRect(glowX + 1, barY, 2, barHeight, 1,
                    ColorUtility.rgba(255, 255, 255, 100));
        }

        String healthText = Math.round(progress * 100) + "%";
        Fonts.sf.drawText(ms, healthText, posX + width - 35, posY + 12,
                getHealthTextColor(progress), 9);
    }

    private void drawBossIcon(MatrixStack ms, float x, float y) {
        RenderUtility.drawRoundedRect(x, y, 16, 16, 8, ColorUtility.rgba(60, 60, 60, 200));
        Fonts.sf.drawText(ms, "☠", x + 2, y + 2, ColorUtility.rgba(255, 80, 80, 255), 12);
    }

    private void drawModernIcon(MatrixStack ms, float x, float y) {
        RenderUtility.drawRoundedRect(x, y, 12, 12, 2, ColorUtility.rgba(Theme.mainRectColor));
        RenderUtility.drawRoundedRect(x + 2, y + 2, 8, 8, 1, ColorUtility.rgba(255, 255, 255, 150));
    }

    private Vector4i getHealthColor(float progress) {
        if (progress > 0.75f) {
            return new Vector4i(
                    ColorUtility.rgba(100, 255, 100, 255),
                    ColorUtility.rgba(50, 255, 50, 255),
                    ColorUtility.rgba(50, 200, 50, 255),
                    ColorUtility.rgba(50, 150, 50, 255)
            );
        } else if (progress > 0.5f) {
            return new Vector4i(
                    ColorUtility.rgba(255, 255, 100, 255),
                    ColorUtility.rgba(255, 255, 50, 255),
                    ColorUtility.rgba(200, 200, 50, 255),
                    ColorUtility.rgba(150, 150, 50, 255)
            );
        } else if (progress > 0.25f) {
            return new Vector4i(
                    ColorUtility.rgba(255, 150, 50, 255),
                    ColorUtility.rgba(255, 120, 50, 255),
                    ColorUtility.rgba(200, 100, 50, 255),
                    ColorUtility.rgba(150, 80, 50, 255)
            );
        } else {
            return new Vector4i(
                    ColorUtility.rgba(255, 80, 80, 255),
                    ColorUtility.rgba(255, 50, 50, 255),
                    ColorUtility.rgba(200, 50, 50, 255),
                    ColorUtility.rgba(150, 50, 50, 255)
            );
        }
    }

    private int getHealthTextColor(float progress) {
        if (progress > 0.75f) {
            return ColorUtility.rgba(100, 255, 100, 255);
        } else if (progress > 0.5f) {
            return ColorUtility.rgba(255, 255, 100, 255);
        } else if (progress > 0.25f) {
            return ColorUtility.rgba(255, 150, 50, 255);
        } else {
            return ColorUtility.rgba(255, 80, 80, 255);
        }
    }
}

Написан на базе вредукса как можна понять по импортам ну ок да (первая работа каторая фигня я думаю)
мб можно скид каталавна
 

типа селфкод:
Expand Collapse Copy
package code.vredux.ui.clienthud.impl;

import com.mojang.blaze3d.matrix.MatrixStack;
import code.vredux.Vredux;
import code.vredux.events.EventRender2D;
import code.vredux.manager.Theme;
import code.vredux.manager.drag.Dragging;
import code.vredux.modules.impl.visual.Hud;
import code.vredux.ui.clienthud.updater.ElementRenderer;
import code.vredux.utils.math.Vector4i;
import code.vredux.utils.render.color.ColorUtility;
import code.vredux.utils.render.engine2d.RenderUtility;
import code.vredux.utils.render.font.Fonts;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.experimental.FieldDefaults;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ClientBossInfo;
import net.minecraft.world.BossInfo;

import java.util.Collection;

/*
 * кароче хз что писать но
 * Рич форевер
 */
@FieldDefaults(level = AccessLevel.PRIVATE)
@RequiredArgsConstructor
public class BossBarHud implements ElementRenderer {

    final Dragging dragging;
    final Minecraft mc = Minecraft.getInstance();

    float width = 300;
    float height = 50;

    @Override
    public void render(EventRender2D eventRender2D) {
        Collection<ClientBossInfo> bossInfos = mc.ingameGUI.getBossOverlay().getActiveBossBars();
        if (bossInfos.isEmpty()) {
            return;
        }
        MatrixStack ms = eventRender2D.getMatrixStack();

        float posX = dragging.getX();
        float posY = dragging.getY();

        BossInfo boss = bossInfos.iterator().next();
        String bossName = boss.getName().getString();
        float progress = boss.getPercent();

        Hud hud = Vredux.getInst().getModuleManager().getHud();

        drawGradientBackground(posX, posY);

        if (hud.tHudMode.is("Обычный")) {
            renderNormalMode(ms, posX, posY, bossName, progress);
        } else if (hud.tHudMode.is("Большой")) {
            renderBigMode(ms, posX, posY, bossName, progress);
        } else {
            renderModernMode(ms, posX, posY, bossName, progress);
        }

        dragging.setWidth(width);
        dragging.setHeight(height);
    }

    private void drawGradientBackground(float posX, float posY) {
        Vector4i backgroundGradient = new Vector4i(
                ColorUtility.rgba(25, 25, 25, 220),
                ColorUtility.rgba(15, 15, 15, 220),
                ColorUtility.rgba(10, 10, 10, 220),
                ColorUtility.rgba(20, 20, 20, 220)
        );
        RenderUtility.drawRoundedRect(posX, posY, width, height, 8, backgroundGradient);

        RenderUtility.drawRoundedRect(posX - 0.5f, posY - 0.5f, width + 1, height + 1, 8.5f,
                ColorUtility.rgba(60, 60, 60, 100));

        RenderUtility.drawRoundedRect(posX + 2, posY + 2, width - 4, height - 4, 6,
                ColorUtility.rgba(0, 0, 0, 60));
    }

    private void renderNormalMode(MatrixStack ms, float posX, float posY, String bossName, float progress) {

        Fonts.sf.drawText(ms, bossName, posX + 35, posY + 10, ColorUtility.rgba(0, 0, 0, 100), 10);
        Fonts.sf.drawText(ms, bossName, posX + 34, posY + 9, Theme.textColor, 10);

        float barWidth = width - 60;
        float barHeight = 6;
        float barX = posX + 30;
        float barY = posY + height - 18;

        Vector4i barBg = new Vector4i(
                ColorUtility.rgba(40, 40, 40, 255),
                ColorUtility.rgba(30, 30, 30, 255),
                ColorUtility.rgba(25, 25, 25, 255),
                ColorUtility.rgba(35, 35, 35, 255)
        );
        RenderUtility.drawRoundedRect(barX, barY, barWidth, barHeight, 3, barBg);

        Vector4i progressColor = getHealthColor(progress);
        RenderUtility.drawRoundedRect(barX, barY, barWidth * progress, barHeight, 3, progressColor);

        if (progress > 0.05f) {
            RenderUtility.drawRoundedRect(barX, barY, barWidth * progress, barHeight, 3,
                    ColorUtility.rgba(255, 255, 255, 30));
        }

        String healthText = Math.round(progress * 100) + "%";
        Fonts.sf.drawText(ms, healthText, posX + width - 40, posY + 9, getHealthTextColor(progress), 9);
    }

    private void renderBigMode(MatrixStack ms, float posX, float posY, String bossName, float progress) {
        drawBossIcon(ms, posX + 10, posY + 6);

        Fonts.sf.drawText(ms, bossName, posX + 40, posY + 8, ColorUtility.rgba(0, 0, 0, 120), 12);
        Fonts.sf.drawText(ms, bossName, posX + 39, posY + 7, Theme.textColor, 12);

        float barWidth = width - 50;
        float barHeight = 10;
        float barX = posX + 25;
        float barY = posY + height - 20;

        RenderUtility.drawRoundedRect(barX - 1, barY - 1, barWidth + 2, barHeight + 2, 5,
                ColorUtility.rgba(80, 80, 80, 200));
        RenderUtility.drawRoundedRect(barX, barY, barWidth, barHeight, 4,
                ColorUtility.rgba(20, 20, 20, 255));

        Vector4i progressColor = getHealthColor(progress);
        RenderUtility.drawRoundedRect(barX, barY, barWidth * progress, barHeight, 4, progressColor);

        if (progress > 0.1f) {
            RenderUtility.drawRoundedRect(barX, barY + 1, barWidth * progress, barHeight - 2, 3,
                    ColorUtility.rgba(255, 255, 255, 40));
        }

        String healthText = Math.round(progress * 100) + "%";
        Fonts.sf.drawCenteredText(ms, healthText, posX + width / 2, posY + height - 8,
                getHealthTextColor(progress), 10);
    }

    private void renderModernMode(MatrixStack ms, float posX, float posY, String bossName, float progress) {
        drawModernIcon(ms, posX + 12, posY + 12);

        Fonts.sf.drawText(ms, bossName, posX + 35, posY + 12, Theme.textColor, 11);

        float barWidth = width - 40;
        float barHeight = 4;
        float barX = posX + 20;
        float barY = posY + height - 15;

        RenderUtility.drawRoundedRect(barX, barY, barWidth, barHeight, 2,
                ColorUtility.rgba(50, 50, 50, 200));

        Vector4i modernColor = new Vector4i(Theme.mainRectColor, Theme.mainRectColor,
                Theme.textColor, Theme.textColor);
        RenderUtility.drawRoundedRect(barX, barY, barWidth * progress, barHeight, 2, modernColor);

        if (progress > 0.1f) {
            float glowX = barX + (barWidth * progress) - 4;
            RenderUtility.drawRoundedRect(glowX, barY - 1, 4, barHeight + 2, 2,
                    ColorUtility.rgba(255, 255, 255, 180));
            RenderUtility.drawRoundedRect(glowX + 1, barY, 2, barHeight, 1,
                    ColorUtility.rgba(255, 255, 255, 100));
        }

        String healthText = Math.round(progress * 100) + "%";
        Fonts.sf.drawText(ms, healthText, posX + width - 35, posY + 12,
                getHealthTextColor(progress), 9);
    }

    private void drawBossIcon(MatrixStack ms, float x, float y) {
        RenderUtility.drawRoundedRect(x, y, 16, 16, 8, ColorUtility.rgba(60, 60, 60, 200));
        Fonts.sf.drawText(ms, "☠", x + 2, y + 2, ColorUtility.rgba(255, 80, 80, 255), 12);
    }

    private void drawModernIcon(MatrixStack ms, float x, float y) {
        RenderUtility.drawRoundedRect(x, y, 12, 12, 2, ColorUtility.rgba(Theme.mainRectColor));
        RenderUtility.drawRoundedRect(x + 2, y + 2, 8, 8, 1, ColorUtility.rgba(255, 255, 255, 150));
    }

    private Vector4i getHealthColor(float progress) {
        if (progress > 0.75f) {
            return new Vector4i(
                    ColorUtility.rgba(100, 255, 100, 255),
                    ColorUtility.rgba(50, 255, 50, 255),
                    ColorUtility.rgba(50, 200, 50, 255),
                    ColorUtility.rgba(50, 150, 50, 255)
            );
        } else if (progress > 0.5f) {
            return new Vector4i(
                    ColorUtility.rgba(255, 255, 100, 255),
                    ColorUtility.rgba(255, 255, 50, 255),
                    ColorUtility.rgba(200, 200, 50, 255),
                    ColorUtility.rgba(150, 150, 50, 255)
            );
        } else if (progress > 0.25f) {
            return new Vector4i(
                    ColorUtility.rgba(255, 150, 50, 255),
                    ColorUtility.rgba(255, 120, 50, 255),
                    ColorUtility.rgba(200, 100, 50, 255),
                    ColorUtility.rgba(150, 80, 50, 255)
            );
        } else {
            return new Vector4i(
                    ColorUtility.rgba(255, 80, 80, 255),
                    ColorUtility.rgba(255, 50, 50, 255),
                    ColorUtility.rgba(200, 50, 50, 255),
                    ColorUtility.rgba(150, 50, 50, 255)
            );
        }
    }

    private int getHealthTextColor(float progress) {
        if (progress > 0.75f) {
            return ColorUtility.rgba(100, 255, 100, 255);
        } else if (progress > 0.5f) {
            return ColorUtility.rgba(255, 255, 100, 255);
        } else if (progress > 0.25f) {
            return ColorUtility.rgba(255, 150, 50, 255);
        } else {
            return ColorUtility.rgba(255, 80, 80, 255);
        }
    }
}

Написан на базе вредукса как можна понять по импортам ну ок да (первая работа каторая фигня я думаю)
аааа а я то думал на фт зашел
 

типа селфкод:
Expand Collapse Copy
package code.vredux.ui.clienthud.impl;

import com.mojang.blaze3d.matrix.MatrixStack;
import code.vredux.Vredux;
import code.vredux.events.EventRender2D;
import code.vredux.manager.Theme;
import code.vredux.manager.drag.Dragging;
import code.vredux.modules.impl.visual.Hud;
import code.vredux.ui.clienthud.updater.ElementRenderer;
import code.vredux.utils.math.Vector4i;
import code.vredux.utils.render.color.ColorUtility;
import code.vredux.utils.render.engine2d.RenderUtility;
import code.vredux.utils.render.font.Fonts;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.experimental.FieldDefaults;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ClientBossInfo;
import net.minecraft.world.BossInfo;

import java.util.Collection;

/*
 * кароче хз что писать но
 * Рич форевер
 */
@FieldDefaults(level = AccessLevel.PRIVATE)
@RequiredArgsConstructor
public class BossBarHud implements ElementRenderer {

    final Dragging dragging;
    final Minecraft mc = Minecraft.getInstance();

    float width = 300;
    float height = 50;

    @Override
    public void render(EventRender2D eventRender2D) {
        Collection<ClientBossInfo> bossInfos = mc.ingameGUI.getBossOverlay().getActiveBossBars();
        if (bossInfos.isEmpty()) {
            return;
        }
        MatrixStack ms = eventRender2D.getMatrixStack();

        float posX = dragging.getX();
        float posY = dragging.getY();

        BossInfo boss = bossInfos.iterator().next();
        String bossName = boss.getName().getString();
        float progress = boss.getPercent();

        Hud hud = Vredux.getInst().getModuleManager().getHud();

        drawGradientBackground(posX, posY);

        if (hud.tHudMode.is("Обычный")) {
            renderNormalMode(ms, posX, posY, bossName, progress);
        } else if (hud.tHudMode.is("Большой")) {
            renderBigMode(ms, posX, posY, bossName, progress);
        } else {
            renderModernMode(ms, posX, posY, bossName, progress);
        }

        dragging.setWidth(width);
        dragging.setHeight(height);
    }

    private void drawGradientBackground(float posX, float posY) {
        Vector4i backgroundGradient = new Vector4i(
                ColorUtility.rgba(25, 25, 25, 220),
                ColorUtility.rgba(15, 15, 15, 220),
                ColorUtility.rgba(10, 10, 10, 220),
                ColorUtility.rgba(20, 20, 20, 220)
        );
        RenderUtility.drawRoundedRect(posX, posY, width, height, 8, backgroundGradient);

        RenderUtility.drawRoundedRect(posX - 0.5f, posY - 0.5f, width + 1, height + 1, 8.5f,
                ColorUtility.rgba(60, 60, 60, 100));

        RenderUtility.drawRoundedRect(posX + 2, posY + 2, width - 4, height - 4, 6,
                ColorUtility.rgba(0, 0, 0, 60));
    }

    private void renderNormalMode(MatrixStack ms, float posX, float posY, String bossName, float progress) {

        Fonts.sf.drawText(ms, bossName, posX + 35, posY + 10, ColorUtility.rgba(0, 0, 0, 100), 10);
        Fonts.sf.drawText(ms, bossName, posX + 34, posY + 9, Theme.textColor, 10);

        float barWidth = width - 60;
        float barHeight = 6;
        float barX = posX + 30;
        float barY = posY + height - 18;

        Vector4i barBg = new Vector4i(
                ColorUtility.rgba(40, 40, 40, 255),
                ColorUtility.rgba(30, 30, 30, 255),
                ColorUtility.rgba(25, 25, 25, 255),
                ColorUtility.rgba(35, 35, 35, 255)
        );
        RenderUtility.drawRoundedRect(barX, barY, barWidth, barHeight, 3, barBg);

        Vector4i progressColor = getHealthColor(progress);
        RenderUtility.drawRoundedRect(barX, barY, barWidth * progress, barHeight, 3, progressColor);

        if (progress > 0.05f) {
            RenderUtility.drawRoundedRect(barX, barY, barWidth * progress, barHeight, 3,
                    ColorUtility.rgba(255, 255, 255, 30));
        }

        String healthText = Math.round(progress * 100) + "%";
        Fonts.sf.drawText(ms, healthText, posX + width - 40, posY + 9, getHealthTextColor(progress), 9);
    }

    private void renderBigMode(MatrixStack ms, float posX, float posY, String bossName, float progress) {
        drawBossIcon(ms, posX + 10, posY + 6);

        Fonts.sf.drawText(ms, bossName, posX + 40, posY + 8, ColorUtility.rgba(0, 0, 0, 120), 12);
        Fonts.sf.drawText(ms, bossName, posX + 39, posY + 7, Theme.textColor, 12);

        float barWidth = width - 50;
        float barHeight = 10;
        float barX = posX + 25;
        float barY = posY + height - 20;

        RenderUtility.drawRoundedRect(barX - 1, barY - 1, barWidth + 2, barHeight + 2, 5,
                ColorUtility.rgba(80, 80, 80, 200));
        RenderUtility.drawRoundedRect(barX, barY, barWidth, barHeight, 4,
                ColorUtility.rgba(20, 20, 20, 255));

        Vector4i progressColor = getHealthColor(progress);
        RenderUtility.drawRoundedRect(barX, barY, barWidth * progress, barHeight, 4, progressColor);

        if (progress > 0.1f) {
            RenderUtility.drawRoundedRect(barX, barY + 1, barWidth * progress, barHeight - 2, 3,
                    ColorUtility.rgba(255, 255, 255, 40));
        }

        String healthText = Math.round(progress * 100) + "%";
        Fonts.sf.drawCenteredText(ms, healthText, posX + width / 2, posY + height - 8,
                getHealthTextColor(progress), 10);
    }

    private void renderModernMode(MatrixStack ms, float posX, float posY, String bossName, float progress) {
        drawModernIcon(ms, posX + 12, posY + 12);

        Fonts.sf.drawText(ms, bossName, posX + 35, posY + 12, Theme.textColor, 11);

        float barWidth = width - 40;
        float barHeight = 4;
        float barX = posX + 20;
        float barY = posY + height - 15;

        RenderUtility.drawRoundedRect(barX, barY, barWidth, barHeight, 2,
                ColorUtility.rgba(50, 50, 50, 200));

        Vector4i modernColor = new Vector4i(Theme.mainRectColor, Theme.mainRectColor,
                Theme.textColor, Theme.textColor);
        RenderUtility.drawRoundedRect(barX, barY, barWidth * progress, barHeight, 2, modernColor);

        if (progress > 0.1f) {
            float glowX = barX + (barWidth * progress) - 4;
            RenderUtility.drawRoundedRect(glowX, barY - 1, 4, barHeight + 2, 2,
                    ColorUtility.rgba(255, 255, 255, 180));
            RenderUtility.drawRoundedRect(glowX + 1, barY, 2, barHeight, 1,
                    ColorUtility.rgba(255, 255, 255, 100));
        }

        String healthText = Math.round(progress * 100) + "%";
        Fonts.sf.drawText(ms, healthText, posX + width - 35, posY + 12,
                getHealthTextColor(progress), 9);
    }

    private void drawBossIcon(MatrixStack ms, float x, float y) {
        RenderUtility.drawRoundedRect(x, y, 16, 16, 8, ColorUtility.rgba(60, 60, 60, 200));
        Fonts.sf.drawText(ms, "☠", x + 2, y + 2, ColorUtility.rgba(255, 80, 80, 255), 12);
    }

    private void drawModernIcon(MatrixStack ms, float x, float y) {
        RenderUtility.drawRoundedRect(x, y, 12, 12, 2, ColorUtility.rgba(Theme.mainRectColor));
        RenderUtility.drawRoundedRect(x + 2, y + 2, 8, 8, 1, ColorUtility.rgba(255, 255, 255, 150));
    }

    private Vector4i getHealthColor(float progress) {
        if (progress > 0.75f) {
            return new Vector4i(
                    ColorUtility.rgba(100, 255, 100, 255),
                    ColorUtility.rgba(50, 255, 50, 255),
                    ColorUtility.rgba(50, 200, 50, 255),
                    ColorUtility.rgba(50, 150, 50, 255)
            );
        } else if (progress > 0.5f) {
            return new Vector4i(
                    ColorUtility.rgba(255, 255, 100, 255),
                    ColorUtility.rgba(255, 255, 50, 255),
                    ColorUtility.rgba(200, 200, 50, 255),
                    ColorUtility.rgba(150, 150, 50, 255)
            );
        } else if (progress > 0.25f) {
            return new Vector4i(
                    ColorUtility.rgba(255, 150, 50, 255),
                    ColorUtility.rgba(255, 120, 50, 255),
                    ColorUtility.rgba(200, 100, 50, 255),
                    ColorUtility.rgba(150, 80, 50, 255)
            );
        } else {
            return new Vector4i(
                    ColorUtility.rgba(255, 80, 80, 255),
                    ColorUtility.rgba(255, 50, 50, 255),
                    ColorUtility.rgba(200, 50, 50, 255),
                    ColorUtility.rgba(150, 50, 50, 255)
            );
        }
    }

    private int getHealthTextColor(float progress) {
        if (progress > 0.75f) {
            return ColorUtility.rgba(100, 255, 100, 255);
        } else if (progress > 0.5f) {
            return ColorUtility.rgba(255, 255, 100, 255);
        } else if (progress > 0.25f) {
            return ColorUtility.rgba(255, 150, 50, 255);
        } else {
            return ColorUtility.rgba(255, 80, 80, 255);
        }
    }
}

Написан на базе вредукса как можна понять по импортам ну ок да (первая работа каторая фигня я думаю)
офегет
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
в пасте видел какой то
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
изменил дизайн опять такого не жду хорошого я не особо хочу чтото делать и стараться
 

типа селфкод:
Expand Collapse Copy
package code.vredux.ui.clienthud.impl;

import com.mojang.blaze3d.matrix.MatrixStack;
import code.vredux.Vredux;
import code.vredux.events.EventRender2D;
import code.vredux.manager.Theme;
import code.vredux.manager.drag.Dragging;
import code.vredux.modules.impl.visual.Hud;
import code.vredux.ui.clienthud.updater.ElementRenderer;
import code.vredux.utils.math.Vector4i;
import code.vredux.utils.render.color.ColorUtility;
import code.vredux.utils.render.engine2d.RenderUtility;
import code.vredux.utils.render.font.Fonts;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.experimental.FieldDefaults;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ClientBossInfo;
import net.minecraft.world.BossInfo;

import java.util.Collection;

/*
 * кароче хз что писать но
 * Рич форевер
 */
@FieldDefaults(level = AccessLevel.PRIVATE)
@RequiredArgsConstructor
public class BossBarHud implements ElementRenderer {

    final Dragging dragging;
    final Minecraft mc = Minecraft.getInstance();

    float width = 250;
    float height = 30;

    float animatedProgress = 0;
    float animatedAlpha = 0;
    float animatedWidth = 0;
    float animatedHeight = 0;
    String lastBossName = "";
    float barGlowIntensity = 0;
    float pulseAnimation = 0;
    float textAnimationScale = 1.0f;
    float percentageAnimationAlpha = 0;

    long lastUpdateTime = System.currentTimeMillis();
    float deltaTime = 0;

    @Override
    public void render(EventRender2D eventRender2D) {
        long currentTime = System.currentTimeMillis();
        deltaTime = Math.min((currentTime - lastUpdateTime) / 1000.0f, 0.05f);
        lastUpdateTime = currentTime;

        Collection<ClientBossInfo> bossInfos = mc.ingameGUI.getBossOverlay().getActiveBossBars();
        if (bossInfos.isEmpty()) {
            animatedAlpha = smoothLerp(animatedAlpha, 0, 3.0f);
            percentageAnimationAlpha = smoothLerp(percentageAnimationAlpha, 0, 4.0f);
            barGlowIntensity = smoothLerp(barGlowIntensity, 0, 5.0f);
            if (animatedAlpha < 0.01f) {
                return;
            }
        } else {
            animatedAlpha = 1.0f;
            percentageAnimationAlpha = 1.0f;
            barGlowIntensity = smoothLerp(barGlowIntensity, 1, 2.0f);
        }

        MatrixStack ms = eventRender2D.getMatrixStack();

        float posX = dragging.getX();
        float posY = dragging.getY();

        if (!bossInfos.isEmpty()) {
            BossInfo boss = bossInfos.iterator().next();
            String bossName = boss.getName().getString();
            float progress = boss.getPercent();

            animatedProgress = smoothLerp(animatedProgress, progress, 2.5f);

            lastBossName = bossName;

            pulseAnimation += deltaTime * 3.0f;

            textAnimationScale = smoothLerp(textAnimationScale, 1.0f, 8.0f);

            Hud hud = Vredux.getInst().getModuleManager().getHud();

            if (hud.tHudMode.is("Обычный")) {
                renderNormalMode(ms, posX, posY, bossName, animatedProgress);
            } else if (hud.tHudMode.is("Большой")) {
                renderBigMode(ms, posX, posY, bossName, animatedProgress);
            } else {
                renderModernMode(ms, posX, posY, bossName, animatedProgress);
            }
        }

        dragging.setWidth(width);
        dragging.setHeight(height);
    }

    private void renderNormalMode(MatrixStack ms, float posX, float posY, String bossName, float progress) {
        Fonts.sf.drawText(ms, bossName, posX + 1, posY + 3, ColorUtility.rgba(0, 0, 0, (int)(150 * animatedAlpha)), 9);
        Fonts.sf.drawText(ms, bossName, posX, posY + 2, ColorUtility.rgba(getRGB(Theme.textColor)[0], getRGB(Theme.textColor)[1], getRGB(Theme.textColor)[2], (int)(255 * animatedAlpha)), 9);
      
        float barWidth = width;
        float barHeight = 8;
        float barX = posX;
        float barY = posY + 12;

        float pulseFactor = (float)(Math.sin(pulseAnimation) * 0.1f + 0.9f);
        RenderUtility.drawRoundedRect(barX, barY, barWidth, barHeight, 4,
                ColorUtility.rgba(30, 30, 30, (int)(180 * animatedAlpha * pulseFactor)));

        Vector4i progressColor = getHealthColorWithAlpha(progress, animatedAlpha);
        RenderUtility.drawRoundedRect(barX, barY, barWidth * progress, barHeight, 4, progressColor);

        if (progress > 0.1f && barGlowIntensity > 0.1f) {
            float glowAlpha = (float)(Math.sin(pulseAnimation * 2) * 0.3f + 0.7f) * barGlowIntensity * animatedAlpha;
            RenderUtility.drawRoundedRect(barX, barY + 1, barWidth * progress, barHeight - 2, 3,
                    ColorUtility.rgba(255, 255, 255, (int)(40 * glowAlpha)));
        }

        String healthText = Math.round(progress * 100) + "%";
        float textWidth = Fonts.sf.getWidth(healthText, 8);
        int healthTextColor = getHealthTextColorWithAlpha(progress, animatedAlpha * percentageAnimationAlpha);

        ms.push();
        ms.scale(textAnimationScale, textAnimationScale, 1.0f);
        float scaledX = (posX + barWidth - textWidth - 2) / textAnimationScale;
        float scaledY = (posY + 2) / textAnimationScale;
        Fonts.sf.drawText(ms, healthText, scaledX, scaledY, healthTextColor, 8);
        ms.pop();
    }

    private void renderBigMode(MatrixStack ms, float posX, float posY, String bossName, float progress) {
        width = 300;
        height = 35;

        Fonts.sf.drawText(ms, bossName, posX + 1, posY + 3, ColorUtility.rgba(0, 0, 0, (int)(150 * animatedAlpha)), 11);
        Fonts.sf.drawText(ms, bossName, posX, posY + 2, ColorUtility.rgba(getRGB(Theme.textColor)[0], getRGB(Theme.textColor)[1], getRGB(Theme.textColor)[2], (int)(255 * animatedAlpha)), 11);

        float barWidth = width;
        float barHeight = 10;
        float barX = posX;
        float barY = posY + 15;

        float borderPulse = (float)(Math.sin(pulseAnimation * 1.5f) * 0.2f + 0.8f);
        RenderUtility.drawRoundedRect(barX - 1, barY - 1, barWidth + 2, barHeight + 2, 5,
                ColorUtility.rgba(60, 60, 60, (int)(120 * animatedAlpha * borderPulse)));
        RenderUtility.drawRoundedRect(barX, barY, barWidth, barHeight, 4,
                ColorUtility.rgba(20, 20, 20, (int)(200 * animatedAlpha)));

        Vector4i progressColor = getHealthColorWithAlpha(progress, animatedAlpha);
        RenderUtility.drawRoundedRect(barX, barY, barWidth * progress, barHeight, 4, progressColor);

        if (progress > 0.1f && barGlowIntensity > 0.1f) {
            float glowTime = (System.currentTimeMillis() % 2000) / 2000f;
            float glowAlpha = (float)(Math.sin(glowTime * Math.PI * 3) * 0.4f + 0.6f) * barGlowIntensity * animatedAlpha;
            RenderUtility.drawRoundedRect(barX, barY + 1, barWidth * progress, barHeight - 2, 3,
                    ColorUtility.rgba(255, 255, 255, (int)(50 * glowAlpha)));

            float waveOffset = (glowTime * barWidth * progress) % (barWidth * progress);
            if (waveOffset > 0) {
                RenderUtility.drawRoundedRect(barX + waveOffset - 10, barY, 20, barHeight, 4,
                        ColorUtility.rgba(255, 255, 255, (int)(30 * glowAlpha)));
            }
        }

        String healthText = Math.round(progress * 100) + "%";
        float textWidth = Fonts.sf.getWidth(healthText, 9);
        int healthTextColor = getHealthTextColorWithAlpha(progress, animatedAlpha * percentageAnimationAlpha);

        ms.push();
        float textPulse = (float)(Math.sin(pulseAnimation * 2) * 0.1f + 1.0f) * textAnimationScale;
        ms.scale(textPulse, textPulse, 1.0f);
        float scaledX = (posX + (barWidth - textWidth) / 2) / textPulse;
        float scaledY = (posY + 27) / textPulse;
        Fonts.sf.drawText(ms, healthText, scaledX, scaledY, healthTextColor, 9);
        ms.pop();
    }

    private void renderModernMode(MatrixStack ms, float posX, float posY, String bossName, float progress) {
        width = 280;
        height = 25;

        Fonts.sf.drawText(ms, bossName, posX, posY + 2, ColorUtility.rgba(getRGB(Theme.textColor)[0], getRGB(Theme.textColor)[1], getRGB(Theme.textColor)[2], (int)(255 * animatedAlpha)), 10);

        float barWidth = width;
        float barHeight = 6;
        float barX = posX;
        float barY = posY + 12;

        float backgroundPulse = (float)(Math.sin(pulseAnimation * 0.5f) * 0.15f + 0.85f);
        RenderUtility.drawRoundedRect(barX, barY, barWidth, barHeight, 3,
                ColorUtility.rgba(40, 40, 40, (int)(160 * animatedAlpha * backgroundPulse)));

        Vector4i modernColor = new Vector4i(
                ColorUtility.rgba(getRGB(Theme.mainRectColor)[0], getRGB(Theme.mainRectColor)[1], getRGB(Theme.mainRectColor)[2], (int)(255 * animatedAlpha)),
                ColorUtility.rgba(getRGB(Theme.mainRectColor)[0], getRGB(Theme.mainRectColor)[1], getRGB(Theme.mainRectColor)[2], (int)(255 * animatedAlpha)),
                ColorUtility.rgba(getRGB(Theme.textColor)[0], getRGB(Theme.textColor)[1], getRGB(Theme.textColor)[2], (int)(255 * animatedAlpha)),
                ColorUtility.rgba(getRGB(Theme.textColor)[0], getRGB(Theme.textColor)[1], getRGB(Theme.textColor)[2], (int)(255 * animatedAlpha))
        );
        RenderUtility.drawRoundedRect(barX, barY, barWidth * progress, barHeight, 3, modernColor);

        if (progress > 0.05f && barGlowIntensity > 0.1f) {
            float glowTime = (System.currentTimeMillis() % 1200) / 1200f;
            float glowAlpha = (float)(Math.sin(glowTime * Math.PI * 4) * 0.5f + 0.5f) * barGlowIntensity * animatedAlpha;
            float glowX = barX + (barWidth * progress) - 4;

            RenderUtility.drawRoundedRect(glowX, barY - 1, 4, barHeight + 2, 2,
                    ColorUtility.rgba(255, 255, 255, (int)(150 * glowAlpha)));

            RenderUtility.drawRoundedRect(glowX - 8, barY, 8, barHeight, 2,
                    ColorUtility.rgba(255, 255, 255, (int)(50 * glowAlpha)));
        }

        String healthText = Math.round(progress * 100) + "%";
        float textWidth = Fonts.sf.getWidth(healthText, 8);
        int healthTextColor = getHealthTextColorWithAlpha(progress, animatedAlpha * percentageAnimationAlpha);

        ms.push();
        float textPulse = (float)(Math.sin(pulseAnimation * 1.5f) * 0.05f + 0.95f) * textAnimationScale;
        ms.scale(textPulse, textPulse, 1.0f);
        float scaledX = (posX + barWidth - textWidth) / textPulse;
        float scaledY = (posY + 20) / textPulse;
        Fonts.sf.drawText(ms, healthText, scaledX, scaledY, healthTextColor, 8);
        ms.pop();
    }

    private Vector4i getHealthColor(float progress) {
        if (progress > 0.75f) {
            return new Vector4i(
                    ColorUtility.rgba(85, 255, 85, 255),
                    ColorUtility.rgba(50, 255, 50, 255),
                    ColorUtility.rgba(40, 200, 40, 255),
                    ColorUtility.rgba(30, 150, 30, 255)
            );
        } else if (progress > 0.5f) {
            return new Vector4i(
                    ColorUtility.rgba(255, 255, 85, 255),
                    ColorUtility.rgba(255, 255, 50, 255),
                    ColorUtility.rgba(200, 200, 40, 255),
                    ColorUtility.rgba(150, 150, 30, 255)
            );
        } else if (progress > 0.25f) {
            return new Vector4i(
                    ColorUtility.rgba(255, 165, 50, 255),
                    ColorUtility.rgba(255, 140, 40, 255),
                    ColorUtility.rgba(200, 120, 30, 255),
                    ColorUtility.rgba(150, 100, 20, 255)
            );
        } else {
            return new Vector4i(
                    ColorUtility.rgba(255, 85, 85, 255),
                    ColorUtility.rgba(255, 50, 50, 255),
                    ColorUtility.rgba(200, 40, 40, 255),
                    ColorUtility.rgba(150, 30, 30, 255)
            );
        }
    }

    private Vector4i getHealthColorWithAlpha(float progress, float alpha) {
        int alphaInt = (int)(255 * alpha);
        if (progress > 0.75f) {
            return new Vector4i(
                    ColorUtility.rgba(85, 255, 85, alphaInt),
                    ColorUtility.rgba(50, 255, 50, alphaInt),
                    ColorUtility.rgba(40, 200, 40, alphaInt),
                    ColorUtility.rgba(30, 150, 30, alphaInt)
            );
        } else if (progress > 0.5f) {
            return new Vector4i(
                    ColorUtility.rgba(255, 255, 85, alphaInt),
                    ColorUtility.rgba(255, 255, 50, alphaInt),
                    ColorUtility.rgba(200, 200, 40, alphaInt),
                    ColorUtility.rgba(150, 150, 30, alphaInt)
            );
        } else if (progress > 0.25f) {
            return new Vector4i(
                    ColorUtility.rgba(255, 165, 50, alphaInt),
                    ColorUtility.rgba(255, 140, 40, alphaInt),
                    ColorUtility.rgba(200, 120, 30, alphaInt),
                    ColorUtility.rgba(150, 100, 20, alphaInt)
            );
        } else {
            return new Vector4i(
                    ColorUtility.rgba(255, 85, 85, alphaInt),
                    ColorUtility.rgba(255, 50, 50, alphaInt),
                    ColorUtility.rgba(200, 40, 40, alphaInt),
                    ColorUtility.rgba(150, 30, 30, alphaInt)
            );
        }
    }

    private int getHealthTextColorWithAlpha(float progress, float alpha) {
        int alphaInt = (int)(255 * alpha);
        if (progress > 0.75f) {
            return ColorUtility.rgba(85, 255, 85, alphaInt);
        } else if (progress > 0.5f) {
            return ColorUtility.rgba(255, 255, 85, alphaInt);
        } else if (progress > 0.25f) {
            return ColorUtility.rgba(255, 165, 50, alphaInt);
        } else {
            return ColorUtility.rgba(255, 85, 85, alphaInt);
        }
    }

    private int getHealthTextColor(float progress) {
        if (progress > 0.75f) {
            return ColorUtility.rgba(85, 255, 85, 255);
        } else if (progress > 0.5f) {
            return ColorUtility.rgba(255, 255, 85, 255);
        } else if (progress > 0.25f) {
            return ColorUtility.rgba(255, 165, 50, 255);
        } else {
            return ColorUtility.rgba(255, 85, 85, 255);
        }
    }

    private int[] getRGB(int color) {
        return new int[]{(color >> 16) & 0xFF, (color >> 8) & 0xFF, color & 0xFF};
    }

    private float smoothLerp(float start, float end, float speed) {
        float factor = 1.0f - (float)Math.exp(-speed * deltaTime);
        return start + factor * (end - start);
    }

    private float lerp(float start, float end, float factor) {
        return start + factor * (end - start);
    }
}


Написан на базе вредукса как можна понять по импортам ну ок да (первая работа каторая фигня я думаю)

переделал дизайн =D

(во вложение старый СС)
ебать ты мой босс бар изуродовал
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.

типа селфкод:
Expand Collapse Copy
package code.vredux.ui.clienthud.impl;

import com.mojang.blaze3d.matrix.MatrixStack;
import code.vredux.Vredux;
import code.vredux.events.EventRender2D;
import code.vredux.manager.Theme;
import code.vredux.manager.drag.Dragging;
import code.vredux.modules.impl.visual.Hud;
import code.vredux.ui.clienthud.updater.ElementRenderer;
import code.vredux.utils.math.Vector4i;
import code.vredux.utils.render.color.ColorUtility;
import code.vredux.utils.render.engine2d.RenderUtility;
import code.vredux.utils.render.font.Fonts;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.experimental.FieldDefaults;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ClientBossInfo;
import net.minecraft.world.BossInfo;

import java.util.Collection;

/*
 * кароче хз что писать но
 * Рич форевер
 */
@FieldDefaults(level = AccessLevel.PRIVATE)
@RequiredArgsConstructor
public class BossBarHud implements ElementRenderer {

    final Dragging dragging;
    final Minecraft mc = Minecraft.getInstance();

    float width = 250;
    float height = 30;

    float animatedProgress = 0;
    float animatedAlpha = 0;
    float animatedWidth = 0;
    float animatedHeight = 0;
    String lastBossName = "";
    float barGlowIntensity = 0;
    float pulseAnimation = 0;
    float textAnimationScale = 1.0f;
    float percentageAnimationAlpha = 0;

    long lastUpdateTime = System.currentTimeMillis();
    float deltaTime = 0;

    @Override
    public void render(EventRender2D eventRender2D) {
        long currentTime = System.currentTimeMillis();
        deltaTime = Math.min((currentTime - lastUpdateTime) / 1000.0f, 0.05f);
        lastUpdateTime = currentTime;

        Collection<ClientBossInfo> bossInfos = mc.ingameGUI.getBossOverlay().getActiveBossBars();
        if (bossInfos.isEmpty()) {
            animatedAlpha = smoothLerp(animatedAlpha, 0, 3.0f);
            percentageAnimationAlpha = smoothLerp(percentageAnimationAlpha, 0, 4.0f);
            barGlowIntensity = smoothLerp(barGlowIntensity, 0, 5.0f);
            if (animatedAlpha < 0.01f) {
                return;
            }
        } else {
            animatedAlpha = 1.0f;
            percentageAnimationAlpha = 1.0f;
            barGlowIntensity = smoothLerp(barGlowIntensity, 1, 2.0f);
        }

        MatrixStack ms = eventRender2D.getMatrixStack();

        float posX = dragging.getX();
        float posY = dragging.getY();

        if (!bossInfos.isEmpty()) {
            BossInfo boss = bossInfos.iterator().next();
            String bossName = boss.getName().getString();
            float progress = boss.getPercent();

            animatedProgress = smoothLerp(animatedProgress, progress, 2.5f);

            lastBossName = bossName;

            pulseAnimation += deltaTime * 3.0f;

            textAnimationScale = smoothLerp(textAnimationScale, 1.0f, 8.0f);

            Hud hud = Vredux.getInst().getModuleManager().getHud();

            if (hud.tHudMode.is("Обычный")) {
                renderNormalMode(ms, posX, posY, bossName, animatedProgress);
            } else if (hud.tHudMode.is("Большой")) {
                renderBigMode(ms, posX, posY, bossName, animatedProgress);
            } else {
                renderModernMode(ms, posX, posY, bossName, animatedProgress);
            }
        }

        dragging.setWidth(width);
        dragging.setHeight(height);
    }

    private void renderNormalMode(MatrixStack ms, float posX, float posY, String bossName, float progress) {
        Fonts.sf.drawText(ms, bossName, posX + 1, posY + 3, ColorUtility.rgba(0, 0, 0, (int)(150 * animatedAlpha)), 9);
        Fonts.sf.drawText(ms, bossName, posX, posY + 2, ColorUtility.rgba(getRGB(Theme.textColor)[0], getRGB(Theme.textColor)[1], getRGB(Theme.textColor)[2], (int)(255 * animatedAlpha)), 9);
     
        float barWidth = width;
        float barHeight = 8;
        float barX = posX;
        float barY = posY + 12;

        float pulseFactor = (float)(Math.sin(pulseAnimation) * 0.1f + 0.9f);
        RenderUtility.drawRoundedRect(barX, barY, barWidth, barHeight, 4,
                ColorUtility.rgba(30, 30, 30, (int)(180 * animatedAlpha * pulseFactor)));

        Vector4i progressColor = getHealthColorWithAlpha(progress, animatedAlpha);
        RenderUtility.drawRoundedRect(barX, barY, barWidth * progress, barHeight, 4, progressColor);

        if (progress > 0.1f && barGlowIntensity > 0.1f) {
            float glowAlpha = (float)(Math.sin(pulseAnimation * 2) * 0.3f + 0.7f) * barGlowIntensity * animatedAlpha;
            RenderUtility.drawRoundedRect(barX, barY + 1, barWidth * progress, barHeight - 2, 3,
                    ColorUtility.rgba(255, 255, 255, (int)(40 * glowAlpha)));
        }

        String healthText = Math.round(progress * 100) + "%";
        float textWidth = Fonts.sf.getWidth(healthText, 8);
        int healthTextColor = getHealthTextColorWithAlpha(progress, animatedAlpha * percentageAnimationAlpha);

        ms.push();
        ms.scale(textAnimationScale, textAnimationScale, 1.0f);
        float scaledX = (posX + barWidth - textWidth - 2) / textAnimationScale;
        float scaledY = (posY + 2) / textAnimationScale;
        Fonts.sf.drawText(ms, healthText, scaledX, scaledY, healthTextColor, 8);
        ms.pop();
    }

    private void renderBigMode(MatrixStack ms, float posX, float posY, String bossName, float progress) {
        width = 300;
        height = 35;

        Fonts.sf.drawText(ms, bossName, posX + 1, posY + 3, ColorUtility.rgba(0, 0, 0, (int)(150 * animatedAlpha)), 11);
        Fonts.sf.drawText(ms, bossName, posX, posY + 2, ColorUtility.rgba(getRGB(Theme.textColor)[0], getRGB(Theme.textColor)[1], getRGB(Theme.textColor)[2], (int)(255 * animatedAlpha)), 11);

        float barWidth = width;
        float barHeight = 10;
        float barX = posX;
        float barY = posY + 15;

        float borderPulse = (float)(Math.sin(pulseAnimation * 1.5f) * 0.2f + 0.8f);
        RenderUtility.drawRoundedRect(barX - 1, barY - 1, barWidth + 2, barHeight + 2, 5,
                ColorUtility.rgba(60, 60, 60, (int)(120 * animatedAlpha * borderPulse)));
        RenderUtility.drawRoundedRect(barX, barY, barWidth, barHeight, 4,
                ColorUtility.rgba(20, 20, 20, (int)(200 * animatedAlpha)));

        Vector4i progressColor = getHealthColorWithAlpha(progress, animatedAlpha);
        RenderUtility.drawRoundedRect(barX, barY, barWidth * progress, barHeight, 4, progressColor);

        if (progress > 0.1f && barGlowIntensity > 0.1f) {
            float glowTime = (System.currentTimeMillis() % 2000) / 2000f;
            float glowAlpha = (float)(Math.sin(glowTime * Math.PI * 3) * 0.4f + 0.6f) * barGlowIntensity * animatedAlpha;
            RenderUtility.drawRoundedRect(barX, barY + 1, barWidth * progress, barHeight - 2, 3,
                    ColorUtility.rgba(255, 255, 255, (int)(50 * glowAlpha)));

            float waveOffset = (glowTime * barWidth * progress) % (barWidth * progress);
            if (waveOffset > 0) {
                RenderUtility.drawRoundedRect(barX + waveOffset - 10, barY, 20, barHeight, 4,
                        ColorUtility.rgba(255, 255, 255, (int)(30 * glowAlpha)));
            }
        }

        String healthText = Math.round(progress * 100) + "%";
        float textWidth = Fonts.sf.getWidth(healthText, 9);
        int healthTextColor = getHealthTextColorWithAlpha(progress, animatedAlpha * percentageAnimationAlpha);

        ms.push();
        float textPulse = (float)(Math.sin(pulseAnimation * 2) * 0.1f + 1.0f) * textAnimationScale;
        ms.scale(textPulse, textPulse, 1.0f);
        float scaledX = (posX + (barWidth - textWidth) / 2) / textPulse;
        float scaledY = (posY + 27) / textPulse;
        Fonts.sf.drawText(ms, healthText, scaledX, scaledY, healthTextColor, 9);
        ms.pop();
    }

    private void renderModernMode(MatrixStack ms, float posX, float posY, String bossName, float progress) {
        width = 280;
        height = 25;

        Fonts.sf.drawText(ms, bossName, posX, posY + 2, ColorUtility.rgba(getRGB(Theme.textColor)[0], getRGB(Theme.textColor)[1], getRGB(Theme.textColor)[2], (int)(255 * animatedAlpha)), 10);

        float barWidth = width;
        float barHeight = 6;
        float barX = posX;
        float barY = posY + 12;

        float backgroundPulse = (float)(Math.sin(pulseAnimation * 0.5f) * 0.15f + 0.85f);
        RenderUtility.drawRoundedRect(barX, barY, barWidth, barHeight, 3,
                ColorUtility.rgba(40, 40, 40, (int)(160 * animatedAlpha * backgroundPulse)));

        Vector4i modernColor = new Vector4i(
                ColorUtility.rgba(getRGB(Theme.mainRectColor)[0], getRGB(Theme.mainRectColor)[1], getRGB(Theme.mainRectColor)[2], (int)(255 * animatedAlpha)),
                ColorUtility.rgba(getRGB(Theme.mainRectColor)[0], getRGB(Theme.mainRectColor)[1], getRGB(Theme.mainRectColor)[2], (int)(255 * animatedAlpha)),
                ColorUtility.rgba(getRGB(Theme.textColor)[0], getRGB(Theme.textColor)[1], getRGB(Theme.textColor)[2], (int)(255 * animatedAlpha)),
                ColorUtility.rgba(getRGB(Theme.textColor)[0], getRGB(Theme.textColor)[1], getRGB(Theme.textColor)[2], (int)(255 * animatedAlpha))
        );
        RenderUtility.drawRoundedRect(barX, barY, barWidth * progress, barHeight, 3, modernColor);

        if (progress > 0.05f && barGlowIntensity > 0.1f) {
            float glowTime = (System.currentTimeMillis() % 1200) / 1200f;
            float glowAlpha = (float)(Math.sin(glowTime * Math.PI * 4) * 0.5f + 0.5f) * barGlowIntensity * animatedAlpha;
            float glowX = barX + (barWidth * progress) - 4;

            RenderUtility.drawRoundedRect(glowX, barY - 1, 4, barHeight + 2, 2,
                    ColorUtility.rgba(255, 255, 255, (int)(150 * glowAlpha)));

            RenderUtility.drawRoundedRect(glowX - 8, barY, 8, barHeight, 2,
                    ColorUtility.rgba(255, 255, 255, (int)(50 * glowAlpha)));
        }

        String healthText = Math.round(progress * 100) + "%";
        float textWidth = Fonts.sf.getWidth(healthText, 8);
        int healthTextColor = getHealthTextColorWithAlpha(progress, animatedAlpha * percentageAnimationAlpha);

        ms.push();
        float textPulse = (float)(Math.sin(pulseAnimation * 1.5f) * 0.05f + 0.95f) * textAnimationScale;
        ms.scale(textPulse, textPulse, 1.0f);
        float scaledX = (posX + barWidth - textWidth) / textPulse;
        float scaledY = (posY + 20) / textPulse;
        Fonts.sf.drawText(ms, healthText, scaledX, scaledY, healthTextColor, 8);
        ms.pop();
    }

    private Vector4i getHealthColor(float progress) {
        if (progress > 0.75f) {
            return new Vector4i(
                    ColorUtility.rgba(85, 255, 85, 255),
                    ColorUtility.rgba(50, 255, 50, 255),
                    ColorUtility.rgba(40, 200, 40, 255),
                    ColorUtility.rgba(30, 150, 30, 255)
            );
        } else if (progress > 0.5f) {
            return new Vector4i(
                    ColorUtility.rgba(255, 255, 85, 255),
                    ColorUtility.rgba(255, 255, 50, 255),
                    ColorUtility.rgba(200, 200, 40, 255),
                    ColorUtility.rgba(150, 150, 30, 255)
            );
        } else if (progress > 0.25f) {
            return new Vector4i(
                    ColorUtility.rgba(255, 165, 50, 255),
                    ColorUtility.rgba(255, 140, 40, 255),
                    ColorUtility.rgba(200, 120, 30, 255),
                    ColorUtility.rgba(150, 100, 20, 255)
            );
        } else {
            return new Vector4i(
                    ColorUtility.rgba(255, 85, 85, 255),
                    ColorUtility.rgba(255, 50, 50, 255),
                    ColorUtility.rgba(200, 40, 40, 255),
                    ColorUtility.rgba(150, 30, 30, 255)
            );
        }
    }

    private Vector4i getHealthColorWithAlpha(float progress, float alpha) {
        int alphaInt = (int)(255 * alpha);
        if (progress > 0.75f) {
            return new Vector4i(
                    ColorUtility.rgba(85, 255, 85, alphaInt),
                    ColorUtility.rgba(50, 255, 50, alphaInt),
                    ColorUtility.rgba(40, 200, 40, alphaInt),
                    ColorUtility.rgba(30, 150, 30, alphaInt)
            );
        } else if (progress > 0.5f) {
            return new Vector4i(
                    ColorUtility.rgba(255, 255, 85, alphaInt),
                    ColorUtility.rgba(255, 255, 50, alphaInt),
                    ColorUtility.rgba(200, 200, 40, alphaInt),
                    ColorUtility.rgba(150, 150, 30, alphaInt)
            );
        } else if (progress > 0.25f) {
            return new Vector4i(
                    ColorUtility.rgba(255, 165, 50, alphaInt),
                    ColorUtility.rgba(255, 140, 40, alphaInt),
                    ColorUtility.rgba(200, 120, 30, alphaInt),
                    ColorUtility.rgba(150, 100, 20, alphaInt)
            );
        } else {
            return new Vector4i(
                    ColorUtility.rgba(255, 85, 85, alphaInt),
                    ColorUtility.rgba(255, 50, 50, alphaInt),
                    ColorUtility.rgba(200, 40, 40, alphaInt),
                    ColorUtility.rgba(150, 30, 30, alphaInt)
            );
        }
    }

    private int getHealthTextColorWithAlpha(float progress, float alpha) {
        int alphaInt = (int)(255 * alpha);
        if (progress > 0.75f) {
            return ColorUtility.rgba(85, 255, 85, alphaInt);
        } else if (progress > 0.5f) {
            return ColorUtility.rgba(255, 255, 85, alphaInt);
        } else if (progress > 0.25f) {
            return ColorUtility.rgba(255, 165, 50, alphaInt);
        } else {
            return ColorUtility.rgba(255, 85, 85, alphaInt);
        }
    }

    private int getHealthTextColor(float progress) {
        if (progress > 0.75f) {
            return ColorUtility.rgba(85, 255, 85, 255);
        } else if (progress > 0.5f) {
            return ColorUtility.rgba(255, 255, 85, 255);
        } else if (progress > 0.25f) {
            return ColorUtility.rgba(255, 165, 50, 255);
        } else {
            return ColorUtility.rgba(255, 85, 85, 255);
        }
    }

    private int[] getRGB(int color) {
        return new int[]{(color >> 16) & 0xFF, (color >> 8) & 0xFF, color & 0xFF};
    }

    private float smoothLerp(float start, float end, float speed) {
        float factor = 1.0f - (float)Math.exp(-speed * deltaTime);
        return start + factor * (end - start);
    }

    private float lerp(float start, float end, float factor) {
        return start + factor * (end - start);
    }
}


Написан на базе вредукса как можна понять по импортам ну ок да (первая работа каторая фигня я думаю)

переделал дизайн =D

(во вложение старый СС)
фу пиздец
 
Имба бро!
 
Назад
Сверху Снизу