Подписывайтесь на наш Telegram и не пропускайте важные новости! Перейти

Визуальная часть BossBarWidget evaware v3

  • Автор темы Автор темы killse
  • Дата начала Дата начала
Начинающий
Начинающий
Статус
Оффлайн
Регистрация
6 Июн 2024
Сообщения
39
Реакции
0
Выберите загрузчик игры
  1. Прочие моды
BossBarWidget:
Expand Collapse Copy
package killse.dest.client.ui.widget.overlay;

import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.client.gui.hud.BossBarHud;
import net.minecraft.client.gui.hud.ClientBossBar;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import killse.dest.api.utils.color.UIColors;
import killse.dest.api.utils.render.RenderUtil;
import killse.dest.client.ui.widget.Widget;

import java.awt.*;
import java.util.Map;
import java.util.UUID;

public class BossBarWidget extends Widget {
    private float widgetWidth = 0f;
    private float widgetHeight = 0f;

    public BossBarWidget() {
        super(3f, 50f);
    }

    @Override
    public String getName() {
        return "BossBar";
    }

    @Override
    public void render(MatrixStack matrixStack) {
        float x = getDraggable().getX();
        float y = getDraggable().getY();
        float gap = getGap();

        if (mc.player == null || mc.world == null || mc.inGameHud == null) {
            getDraggable().setWidth(0f);
            getDraggable().setHeight(0f);
            return;
        }

        BossBarHud bossBarHud = mc.inGameHud.getBossBarHud();
        if (bossBarHud == null) {
            getDraggable().setWidth(0f);
            getDraggable().setHeight(0f);
            return;
        }

        Map<UUID, ClientBossBar> bossBars = bossBarHud.bossBars;
        if (bossBars.isEmpty()) {
            getDraggable().setWidth(0f);
            getDraggable().setHeight(0f);
            return;
        }

        float currentY = y;
        float maxWidth = 0f;
        float totalHeight = 0f;

        for (ClientBossBar bossBar : bossBars.values()) {
            float[] barDimensions = renderBossBar(matrixStack, x, currentY, bossBar);
            maxWidth = Math.max(maxWidth, barDimensions[2]);
            totalHeight += barDimensions[3] + gap;
            currentY += barDimensions[3] + gap;
        }

 
        if (totalHeight > 0) {
            totalHeight -= gap;
        }

        widgetWidth = maxWidth;
        widgetHeight = totalHeight;

        getDraggable().setWidth(widgetWidth);
        getDraggable().setHeight(widgetHeight);
    }

    private float[] renderBossBar(MatrixStack matrixStack, float x, float y, ClientBossBar bossBar) {
        float fontSize = scaled(6f);
        float barHeight = scaled(6f);
        float barWidth = scaled(120f);
        float gap = getGap() * 0.8f;
        String name = bossBar.getName().getString();
        float progress = bossBar.getPercent();
        Color barColor = getBossBarColor(bossBar.getColor());
        Color backgroundColor = new Color(12, 12, 18, 220);

        float textWidth = getMediumFont().getWidth(name, fontSize);
        float contentWidth = Math.max(barWidth + gap * 2f, textWidth + gap * 3f);

        float backgroundHeight = fontSize + barHeight + gap * 2f;
        float round = backgroundHeight * 0.3f;
      
        RenderUtil.BLUR_RECT.draw(matrixStack, x, y, contentWidth, backgroundHeight, round, backgroundColor);

        float textX = x + (contentWidth - textWidth) / 2f;
        float textY = y + gap;
        getMediumFont().drawText(matrixStack, name, textX, textY, fontSize, Color.WHITE);
        float barX = x + (contentWidth - barWidth) / 2f;
        float barY = y + fontSize + gap * 1.5f;
        float barRound = barHeight * 0.2f;
      
        RenderUtil.BLUR_RECT.draw(matrixStack, barX, barY, barWidth, barHeight, barRound, new Color(20, 20, 25, 180));

        float progressWidth = barWidth * progress;
        if (progressWidth > 0) {
            RenderUtil.BLUR_RECT.draw(matrixStack, barX, barY, progressWidth, barHeight, barRound, barColor);
        }

        return new float[]{x, y, contentWidth, backgroundHeight};
    }

    private Color getBossBarColor(ClientBossBar.Color color) {
        switch (color) {
            case PINK:
                return new Color(255, 182, 193);
            case BLUE:
                return new Color(100, 149, 237);
            case RED:
                return new Color(255, 69, 69);
            case GREEN:
                return new Color(50, 205, 50);
            case YELLOW:
                return new Color(255, 215, 0);
            case PURPLE:
                return new Color(147, 112, 219);
            case WHITE:
                return new Color(255, 255, 255);
            default:
                return new Color(128, 128, 128);
        }
    }
}
 

Вложения

  • 1768732586218.png
    1768732586218.png
    22.1 KB · Просмотры: 172
Последнее редактирование:
это и так понятно она как то популярной стала и все её используют для своих клиентов
BossBarWidget:
Expand Collapse Copy
package killse.dest.client.ui.widget.overlay;

import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.client.gui.hud.BossBarHud;
import net.minecraft.client.gui.hud.ClientBossBar;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import killse.dest.api.utils.color.UIColors;
import killse.dest.api.utils.render.RenderUtil;
import killse.dest.client.ui.widget.Widget;

import java.awt.*;
import java.util.Map;
import java.util.UUID;

public class BossBarWidget extends Widget {
    private float widgetWidth = 0f;
    private float widgetHeight = 0f;

    public BossBarWidget() {
        super(3f, 50f);
    }

    @Override
    public String getName() {
        return "BossBar";
    }

    @Override
    public void render(MatrixStack matrixStack) {
        float x = getDraggable().getX();
        float y = getDraggable().getY();
        float gap = getGap();

        if (mc.player == null || mc.world == null || mc.inGameHud == null) {
            getDraggable().setWidth(0f);
            getDraggable().setHeight(0f);
            return;
        }

        BossBarHud bossBarHud = mc.inGameHud.getBossBarHud();
        if (bossBarHud == null) {
            getDraggable().setWidth(0f);
            getDraggable().setHeight(0f);
            return;
        }

        Map<UUID, ClientBossBar> bossBars = bossBarHud.bossBars;
        if (bossBars.isEmpty()) {
            getDraggable().setWidth(0f);
            getDraggable().setHeight(0f);
            return;
        }

        float currentY = y;
        float maxWidth = 0f;
        float totalHeight = 0f;

        for (ClientBossBar bossBar : bossBars.values()) {
            float[] barDimensions = renderBossBar(matrixStack, x, currentY, bossBar);
            maxWidth = Math.max(maxWidth, barDimensions[2]);
            totalHeight += barDimensions[3] + gap;
            currentY += barDimensions[3] + gap;
        }

 
        if (totalHeight > 0) {
            totalHeight -= gap;
        }

        widgetWidth = maxWidth;
        widgetHeight = totalHeight;

        getDraggable().setWidth(widgetWidth);
        getDraggable().setHeight(widgetHeight);
    }

    private float[] renderBossBar(MatrixStack matrixStack, float x, float y, ClientBossBar bossBar) {
        float fontSize = scaled(6f);
        float barHeight = scaled(6f);
        float barWidth = scaled(120f);
        float gap = getGap() * 0.8f;
        String name = bossBar.getName().getString();
        float progress = bossBar.getPercent();
        Color barColor = getBossBarColor(bossBar.getColor());
        Color backgroundColor = new Color(12, 12, 18, 220);

        float textWidth = getMediumFont().getWidth(name, fontSize);
        float contentWidth = Math.max(barWidth + gap * 2f, textWidth + gap * 3f);

        float backgroundHeight = fontSize + barHeight + gap * 2f;
        float round = backgroundHeight * 0.3f;
      
        RenderUtil.BLUR_RECT.draw(matrixStack, x, y, contentWidth, backgroundHeight, round, backgroundColor);

        float textX = x + (contentWidth - textWidth) / 2f;
        float textY = y + gap;
        getMediumFont().drawText(matrixStack, name, textX, textY, fontSize, Color.WHITE);
        float barX = x + (contentWidth - barWidth) / 2f;
        float barY = y + fontSize + gap * 1.5f;
        float barRound = barHeight * 0.2f;
      
        RenderUtil.BLUR_RECT.draw(matrixStack, barX, barY, barWidth, barHeight, barRound, new Color(20, 20, 25, 180));

        float progressWidth = barWidth * progress;
        if (progressWidth > 0) {
            RenderUtil.BLUR_RECT.draw(matrixStack, barX, barY, progressWidth, barHeight, barRound, barColor);
        }

        return new float[]{x, y, contentWidth, backgroundHeight};
    }

    private Color getBossBarColor(ClientBossBar.Color color) {
        switch (color) {
            case PINK:
                return new Color(255, 182, 193);
            case BLUE:
                return new Color(100, 149, 237);
            case RED:
                return new Color(255, 69, 69);
            case GREEN:
                return new Color(50, 205, 50);
            case YELLOW:
                return new Color(255, 215, 0);
            case PURPLE:
                return new Color(147, 112, 219);
            case WHITE:
                return new Color(255, 255, 255);
            default:
                return new Color(128, 128, 128);
        }
    }
}
Посмотреть вложение 325033
И ужасно.
 
Потому что самая лучшая база на данный момент
я на зените рекоде делаю вроде тоже не плохо.
я рил тоже не понимаю почему на еву всё перешли, в чём ее такое премущество?
 
я на зените рекоде делаю вроде тоже не плохо.
я рил тоже не понимаю почему на еву всё перешли, в чём ее такое премущество?
Потому что база не хуйня ёбанная. Код чистый и понятный. даже базовый глэк без знаний всё поймёт.
 
BossBarWidget:
Expand Collapse Copy
package killse.dest.client.ui.widget.overlay;

import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.client.gui.hud.BossBarHud;
import net.minecraft.client.gui.hud.ClientBossBar;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import killse.dest.api.utils.color.UIColors;
import killse.dest.api.utils.render.RenderUtil;
import killse.dest.client.ui.widget.Widget;

import java.awt.*;
import java.util.Map;
import java.util.UUID;

public class BossBarWidget extends Widget {
    private float widgetWidth = 0f;
    private float widgetHeight = 0f;

    public BossBarWidget() {
        super(3f, 50f);
    }

    @Override
    public String getName() {
        return "BossBar";
    }

    @Override
    public void render(MatrixStack matrixStack) {
        float x = getDraggable().getX();
        float y = getDraggable().getY();
        float gap = getGap();

        if (mc.player == null || mc.world == null || mc.inGameHud == null) {
            getDraggable().setWidth(0f);
            getDraggable().setHeight(0f);
            return;
        }

        BossBarHud bossBarHud = mc.inGameHud.getBossBarHud();
        if (bossBarHud == null) {
            getDraggable().setWidth(0f);
            getDraggable().setHeight(0f);
            return;
        }

        Map<UUID, ClientBossBar> bossBars = bossBarHud.bossBars;
        if (bossBars.isEmpty()) {
            getDraggable().setWidth(0f);
            getDraggable().setHeight(0f);
            return;
        }

        float currentY = y;
        float maxWidth = 0f;
        float totalHeight = 0f;

        for (ClientBossBar bossBar : bossBars.values()) {
            float[] barDimensions = renderBossBar(matrixStack, x, currentY, bossBar);
            maxWidth = Math.max(maxWidth, barDimensions[2]);
            totalHeight += barDimensions[3] + gap;
            currentY += barDimensions[3] + gap;
        }

 
        if (totalHeight > 0) {
            totalHeight -= gap;
        }

        widgetWidth = maxWidth;
        widgetHeight = totalHeight;

        getDraggable().setWidth(widgetWidth);
        getDraggable().setHeight(widgetHeight);
    }

    private float[] renderBossBar(MatrixStack matrixStack, float x, float y, ClientBossBar bossBar) {
        float fontSize = scaled(6f);
        float barHeight = scaled(6f);
        float barWidth = scaled(120f);
        float gap = getGap() * 0.8f;
        String name = bossBar.getName().getString();
        float progress = bossBar.getPercent();
        Color barColor = getBossBarColor(bossBar.getColor());
        Color backgroundColor = new Color(12, 12, 18, 220);

        float textWidth = getMediumFont().getWidth(name, fontSize);
        float contentWidth = Math.max(barWidth + gap * 2f, textWidth + gap * 3f);

        float backgroundHeight = fontSize + barHeight + gap * 2f;
        float round = backgroundHeight * 0.3f;
      
        RenderUtil.BLUR_RECT.draw(matrixStack, x, y, contentWidth, backgroundHeight, round, backgroundColor);

        float textX = x + (contentWidth - textWidth) / 2f;
        float textY = y + gap;
        getMediumFont().drawText(matrixStack, name, textX, textY, fontSize, Color.WHITE);
        float barX = x + (contentWidth - barWidth) / 2f;
        float barY = y + fontSize + gap * 1.5f;
        float barRound = barHeight * 0.2f;
      
        RenderUtil.BLUR_RECT.draw(matrixStack, barX, barY, barWidth, barHeight, barRound, new Color(20, 20, 25, 180));

        float progressWidth = barWidth * progress;
        if (progressWidth > 0) {
            RenderUtil.BLUR_RECT.draw(matrixStack, barX, barY, progressWidth, barHeight, barRound, barColor);
        }

        return new float[]{x, y, contentWidth, backgroundHeight};
    }

    private Color getBossBarColor(ClientBossBar.Color color) {
        switch (color) {
            case PINK:
                return new Color(255, 182, 193);
            case BLUE:
                return new Color(100, 149, 237);
            case RED:
                return new Color(255, 69, 69);
            case GREEN:
                return new Color(50, 205, 50);
            case YELLOW:
                return new Color(255, 215, 0);
            case PURPLE:
                return new Color(147, 112, 219);
            case WHITE:
                return new Color(255, 255, 255);
            default:
                return new Color(128, 128, 128);
        }
    }
}
Посмотреть вложение 325033
+rep как раз хотел сделать и вот наткнулся
 
BossBarWidget:
Expand Collapse Copy
package killse.dest.client.ui.widget.overlay;

import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.client.gui.hud.BossBarHud;
import net.minecraft.client.gui.hud.ClientBossBar;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import killse.dest.api.utils.color.UIColors;
import killse.dest.api.utils.render.RenderUtil;
import killse.dest.client.ui.widget.Widget;

import java.awt.*;
import java.util.Map;
import java.util.UUID;

public class BossBarWidget extends Widget {
    private float widgetWidth = 0f;
    private float widgetHeight = 0f;

    public BossBarWidget() {
        super(3f, 50f);
    }

    @Override
    public String getName() {
        return "BossBar";
    }

    @Override
    public void render(MatrixStack matrixStack) {
        float x = getDraggable().getX();
        float y = getDraggable().getY();
        float gap = getGap();

        if (mc.player == null || mc.world == null || mc.inGameHud == null) {
            getDraggable().setWidth(0f);
            getDraggable().setHeight(0f);
            return;
        }

        BossBarHud bossBarHud = mc.inGameHud.getBossBarHud();
        if (bossBarHud == null) {
            getDraggable().setWidth(0f);
            getDraggable().setHeight(0f);
            return;
        }

        Map<UUID, ClientBossBar> bossBars = bossBarHud.bossBars;
        if (bossBars.isEmpty()) {
            getDraggable().setWidth(0f);
            getDraggable().setHeight(0f);
            return;
        }

        float currentY = y;
        float maxWidth = 0f;
        float totalHeight = 0f;

        for (ClientBossBar bossBar : bossBars.values()) {
            float[] barDimensions = renderBossBar(matrixStack, x, currentY, bossBar);
            maxWidth = Math.max(maxWidth, barDimensions[2]);
            totalHeight += barDimensions[3] + gap;
            currentY += barDimensions[3] + gap;
        }

 
        if (totalHeight > 0) {
            totalHeight -= gap;
        }

        widgetWidth = maxWidth;
        widgetHeight = totalHeight;

        getDraggable().setWidth(widgetWidth);
        getDraggable().setHeight(widgetHeight);
    }

    private float[] renderBossBar(MatrixStack matrixStack, float x, float y, ClientBossBar bossBar) {
        float fontSize = scaled(6f);
        float barHeight = scaled(6f);
        float barWidth = scaled(120f);
        float gap = getGap() * 0.8f;
        String name = bossBar.getName().getString();
        float progress = bossBar.getPercent();
        Color barColor = getBossBarColor(bossBar.getColor());
        Color backgroundColor = new Color(12, 12, 18, 220);

        float textWidth = getMediumFont().getWidth(name, fontSize);
        float contentWidth = Math.max(barWidth + gap * 2f, textWidth + gap * 3f);

        float backgroundHeight = fontSize + barHeight + gap * 2f;
        float round = backgroundHeight * 0.3f;
      
        RenderUtil.BLUR_RECT.draw(matrixStack, x, y, contentWidth, backgroundHeight, round, backgroundColor);

        float textX = x + (contentWidth - textWidth) / 2f;
        float textY = y + gap;
        getMediumFont().drawText(matrixStack, name, textX, textY, fontSize, Color.WHITE);
        float barX = x + (contentWidth - barWidth) / 2f;
        float barY = y + fontSize + gap * 1.5f;
        float barRound = barHeight * 0.2f;
      
        RenderUtil.BLUR_RECT.draw(matrixStack, barX, barY, barWidth, barHeight, barRound, new Color(20, 20, 25, 180));

        float progressWidth = barWidth * progress;
        if (progressWidth > 0) {
            RenderUtil.BLUR_RECT.draw(matrixStack, barX, barY, progressWidth, barHeight, barRound, barColor);
        }

        return new float[]{x, y, contentWidth, backgroundHeight};
    }

    private Color getBossBarColor(ClientBossBar.Color color) {
        switch (color) {
            case PINK:
                return new Color(255, 182, 193);
            case BLUE:
                return new Color(100, 149, 237);
            case RED:
                return new Color(255, 69, 69);
            case GREEN:
                return new Color(50, 205, 50);
            case YELLOW:
                return new Color(255, 215, 0);
            case PURPLE:
                return new Color(147, 112, 219);
            case WHITE:
                return new Color(255, 255, 255);
            default:
                return new Color(128, 128, 128);
        }
    }
}
Посмотреть вложение 325033
+rep спастил на зенит рекод, пасиб
 
BossBarWidget:
Expand Collapse Copy
package killse.dest.client.ui.widget.overlay;

import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.client.gui.hud.BossBarHud;
import net.minecraft.client.gui.hud.ClientBossBar;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import killse.dest.api.utils.color.UIColors;
import killse.dest.api.utils.render.RenderUtil;
import killse.dest.client.ui.widget.Widget;

import java.awt.*;
import java.util.Map;
import java.util.UUID;

public class BossBarWidget extends Widget {
    private float widgetWidth = 0f;
    private float widgetHeight = 0f;

    public BossBarWidget() {
        super(3f, 50f);
    }

    @Override
    public String getName() {
        return "BossBar";
    }

    @Override
    public void render(MatrixStack matrixStack) {
        float x = getDraggable().getX();
        float y = getDraggable().getY();
        float gap = getGap();

        if (mc.player == null || mc.world == null || mc.inGameHud == null) {
            getDraggable().setWidth(0f);
            getDraggable().setHeight(0f);
            return;
        }

        BossBarHud bossBarHud = mc.inGameHud.getBossBarHud();
        if (bossBarHud == null) {
            getDraggable().setWidth(0f);
            getDraggable().setHeight(0f);
            return;
        }

        Map<UUID, ClientBossBar> bossBars = bossBarHud.bossBars;
        if (bossBars.isEmpty()) {
            getDraggable().setWidth(0f);
            getDraggable().setHeight(0f);
            return;
        }

        float currentY = y;
        float maxWidth = 0f;
        float totalHeight = 0f;

        for (ClientBossBar bossBar : bossBars.values()) {
            float[] barDimensions = renderBossBar(matrixStack, x, currentY, bossBar);
            maxWidth = Math.max(maxWidth, barDimensions[2]);
            totalHeight += barDimensions[3] + gap;
            currentY += barDimensions[3] + gap;
        }

 
        if (totalHeight > 0) {
            totalHeight -= gap;
        }

        widgetWidth = maxWidth;
        widgetHeight = totalHeight;

        getDraggable().setWidth(widgetWidth);
        getDraggable().setHeight(widgetHeight);
    }

    private float[] renderBossBar(MatrixStack matrixStack, float x, float y, ClientBossBar bossBar) {
        float fontSize = scaled(6f);
        float barHeight = scaled(6f);
        float barWidth = scaled(120f);
        float gap = getGap() * 0.8f;
        String name = bossBar.getName().getString();
        float progress = bossBar.getPercent();
        Color barColor = getBossBarColor(bossBar.getColor());
        Color backgroundColor = new Color(12, 12, 18, 220);

        float textWidth = getMediumFont().getWidth(name, fontSize);
        float contentWidth = Math.max(barWidth + gap * 2f, textWidth + gap * 3f);

        float backgroundHeight = fontSize + barHeight + gap * 2f;
        float round = backgroundHeight * 0.3f;
      
        RenderUtil.BLUR_RECT.draw(matrixStack, x, y, contentWidth, backgroundHeight, round, backgroundColor);

        float textX = x + (contentWidth - textWidth) / 2f;
        float textY = y + gap;
        getMediumFont().drawText(matrixStack, name, textX, textY, fontSize, Color.WHITE);
        float barX = x + (contentWidth - barWidth) / 2f;
        float barY = y + fontSize + gap * 1.5f;
        float barRound = barHeight * 0.2f;
      
        RenderUtil.BLUR_RECT.draw(matrixStack, barX, barY, barWidth, barHeight, barRound, new Color(20, 20, 25, 180));

        float progressWidth = barWidth * progress;
        if (progressWidth > 0) {
            RenderUtil.BLUR_RECT.draw(matrixStack, barX, barY, progressWidth, barHeight, barRound, barColor);
        }

        return new float[]{x, y, contentWidth, backgroundHeight};
    }

    private Color getBossBarColor(ClientBossBar.Color color) {
        switch (color) {
            case PINK:
                return new Color(255, 182, 193);
            case BLUE:
                return new Color(100, 149, 237);
            case RED:
                return new Color(255, 69, 69);
            case GREEN:
                return new Color(50, 205, 50);
            case YELLOW:
                return new Color(255, 215, 0);
            case PURPLE:
                return new Color(147, 112, 219);
            case WHITE:
                return new Color(255, 255, 255);
            default:
                return new Color(128, 128, 128);
        }
    }
}
Посмотреть вложение 325033
/del ебать залупа кривая /del
 
BossBarWidget:
Expand Collapse Copy
package killse.dest.client.ui.widget.overlay;

import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.client.gui.hud.BossBarHud;
import net.minecraft.client.gui.hud.ClientBossBar;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import killse.dest.api.utils.color.UIColors;
import killse.dest.api.utils.render.RenderUtil;
import killse.dest.client.ui.widget.Widget;

import java.awt.*;
import java.util.Map;
import java.util.UUID;

public class BossBarWidget extends Widget {
    private float widgetWidth = 0f;
    private float widgetHeight = 0f;

    public BossBarWidget() {
        super(3f, 50f);
    }

    @Override
    public String getName() {
        return "BossBar";
    }

    @Override
    public void render(MatrixStack matrixStack) {
        float x = getDraggable().getX();
        float y = getDraggable().getY();
        float gap = getGap();

        if (mc.player == null || mc.world == null || mc.inGameHud == null) {
            getDraggable().setWidth(0f);
            getDraggable().setHeight(0f);
            return;
        }

        BossBarHud bossBarHud = mc.inGameHud.getBossBarHud();
        if (bossBarHud == null) {
            getDraggable().setWidth(0f);
            getDraggable().setHeight(0f);
            return;
        }

        Map<UUID, ClientBossBar> bossBars = bossBarHud.bossBars;
        if (bossBars.isEmpty()) {
            getDraggable().setWidth(0f);
            getDraggable().setHeight(0f);
            return;
        }

        float currentY = y;
        float maxWidth = 0f;
        float totalHeight = 0f;

        for (ClientBossBar bossBar : bossBars.values()) {
            float[] barDimensions = renderBossBar(matrixStack, x, currentY, bossBar);
            maxWidth = Math.max(maxWidth, barDimensions[2]);
            totalHeight += barDimensions[3] + gap;
            currentY += barDimensions[3] + gap;
        }

 
        if (totalHeight > 0) {
            totalHeight -= gap;
        }

        widgetWidth = maxWidth;
        widgetHeight = totalHeight;

        getDraggable().setWidth(widgetWidth);
        getDraggable().setHeight(widgetHeight);
    }

    private float[] renderBossBar(MatrixStack matrixStack, float x, float y, ClientBossBar bossBar) {
        float fontSize = scaled(6f);
        float barHeight = scaled(6f);
        float barWidth = scaled(120f);
        float gap = getGap() * 0.8f;
        String name = bossBar.getName().getString();
        float progress = bossBar.getPercent();
        Color barColor = getBossBarColor(bossBar.getColor());
        Color backgroundColor = new Color(12, 12, 18, 220);

        float textWidth = getMediumFont().getWidth(name, fontSize);
        float contentWidth = Math.max(barWidth + gap * 2f, textWidth + gap * 3f);

        float backgroundHeight = fontSize + barHeight + gap * 2f;
        float round = backgroundHeight * 0.3f;
      
        RenderUtil.BLUR_RECT.draw(matrixStack, x, y, contentWidth, backgroundHeight, round, backgroundColor);

        float textX = x + (contentWidth - textWidth) / 2f;
        float textY = y + gap;
        getMediumFont().drawText(matrixStack, name, textX, textY, fontSize, Color.WHITE);
        float barX = x + (contentWidth - barWidth) / 2f;
        float barY = y + fontSize + gap * 1.5f;
        float barRound = barHeight * 0.2f;
      
        RenderUtil.BLUR_RECT.draw(matrixStack, barX, barY, barWidth, barHeight, barRound, new Color(20, 20, 25, 180));

        float progressWidth = barWidth * progress;
        if (progressWidth > 0) {
            RenderUtil.BLUR_RECT.draw(matrixStack, barX, barY, progressWidth, barHeight, barRound, barColor);
        }

        return new float[]{x, y, contentWidth, backgroundHeight};
    }

    private Color getBossBarColor(ClientBossBar.Color color) {
        switch (color) {
            case PINK:
                return new Color(255, 182, 193);
            case BLUE:
                return new Color(100, 149, 237);
            case RED:
                return new Color(255, 69, 69);
            case GREEN:
                return new Color(50, 205, 50);
            case YELLOW:
                return new Color(255, 215, 0);
            case PURPLE:
                return new Color(147, 112, 219);
            case WHITE:
                return new Color(255, 255, 255);
            default:
                return new Color(128, 128, 128);
        }
    }
}
Посмотреть вложение 325033
Чуть доделать и заебца будет
 
BossBarWidget:
Expand Collapse Copy
package killse.dest.client.ui.widget.overlay;

import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.client.gui.hud.BossBarHud;
import net.minecraft.client.gui.hud.ClientBossBar;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import killse.dest.api.utils.color.UIColors;
import killse.dest.api.utils.render.RenderUtil;
import killse.dest.client.ui.widget.Widget;

import java.awt.*;
import java.util.Map;
import java.util.UUID;

public class BossBarWidget extends Widget {
    private float widgetWidth = 0f;
    private float widgetHeight = 0f;

    public BossBarWidget() {
        super(3f, 50f);
    }

    @Override
    public String getName() {
        return "BossBar";
    }

    @Override
    public void render(MatrixStack matrixStack) {
        float x = getDraggable().getX();
        float y = getDraggable().getY();
        float gap = getGap();

        if (mc.player == null || mc.world == null || mc.inGameHud == null) {
            getDraggable().setWidth(0f);
            getDraggable().setHeight(0f);
            return;
        }

        BossBarHud bossBarHud = mc.inGameHud.getBossBarHud();
        if (bossBarHud == null) {
            getDraggable().setWidth(0f);
            getDraggable().setHeight(0f);
            return;
        }

        Map<UUID, ClientBossBar> bossBars = bossBarHud.bossBars;
        if (bossBars.isEmpty()) {
            getDraggable().setWidth(0f);
            getDraggable().setHeight(0f);
            return;
        }

        float currentY = y;
        float maxWidth = 0f;
        float totalHeight = 0f;

        for (ClientBossBar bossBar : bossBars.values()) {
            float[] barDimensions = renderBossBar(matrixStack, x, currentY, bossBar);
            maxWidth = Math.max(maxWidth, barDimensions[2]);
            totalHeight += barDimensions[3] + gap;
            currentY += barDimensions[3] + gap;
        }

 
        if (totalHeight > 0) {
            totalHeight -= gap;
        }

        widgetWidth = maxWidth;
        widgetHeight = totalHeight;

        getDraggable().setWidth(widgetWidth);
        getDraggable().setHeight(widgetHeight);
    }

    private float[] renderBossBar(MatrixStack matrixStack, float x, float y, ClientBossBar bossBar) {
        float fontSize = scaled(6f);
        float barHeight = scaled(6f);
        float barWidth = scaled(120f);
        float gap = getGap() * 0.8f;
        String name = bossBar.getName().getString();
        float progress = bossBar.getPercent();
        Color barColor = getBossBarColor(bossBar.getColor());
        Color backgroundColor = new Color(12, 12, 18, 220);

        float textWidth = getMediumFont().getWidth(name, fontSize);
        float contentWidth = Math.max(barWidth + gap * 2f, textWidth + gap * 3f);

        float backgroundHeight = fontSize + barHeight + gap * 2f;
        float round = backgroundHeight * 0.3f;
      
        RenderUtil.BLUR_RECT.draw(matrixStack, x, y, contentWidth, backgroundHeight, round, backgroundColor);

        float textX = x + (contentWidth - textWidth) / 2f;
        float textY = y + gap;
        getMediumFont().drawText(matrixStack, name, textX, textY, fontSize, Color.WHITE);
        float barX = x + (contentWidth - barWidth) / 2f;
        float barY = y + fontSize + gap * 1.5f;
        float barRound = barHeight * 0.2f;
      
        RenderUtil.BLUR_RECT.draw(matrixStack, barX, barY, barWidth, barHeight, barRound, new Color(20, 20, 25, 180));

        float progressWidth = barWidth * progress;
        if (progressWidth > 0) {
            RenderUtil.BLUR_RECT.draw(matrixStack, barX, barY, progressWidth, barHeight, barRound, barColor);
        }

        return new float[]{x, y, contentWidth, backgroundHeight};
    }

    private Color getBossBarColor(ClientBossBar.Color color) {
        switch (color) {
            case PINK:
                return new Color(255, 182, 193);
            case BLUE:
                return new Color(100, 149, 237);
            case RED:
                return new Color(255, 69, 69);
            case GREEN:
                return new Color(50, 205, 50);
            case YELLOW:
                return new Color(255, 215, 0);
            case PURPLE:
                return new Color(147, 112, 219);
            case WHITE:
                return new Color(255, 255, 255);
            default:
                return new Color(128, 128, 128);
        }
    }
}
Посмотреть вложение 325033
/del
 
Потому что база не хуйня ёбанная. Код чистый и понятный. даже базовый глэк без знаний всё поймёт.
nu kstati pravda noia odno ne ponimaiu pochemu slili evaware tipa est je tot je evaware v2 ot vorkisa pochemu evo neslili sursami
 
nu kstati pravda noia odno ne ponimaiu pochemu slili evaware tipa est je tot je evaware v2 ot vorkisa pochemu evo neslili sursami
Какой бля Евавар в2 от воркиса? Билд Евавара в2 от ремилы. если ты про ту пародию на Евавар от воркиса которую сюда заливали - Это вообще сука не Евавар. это кусок ебучего говна на другхаке
 
Назад
Сверху Снизу