Визуальная часть TargetHUD Upgrade | Expensive 3.1/EvaWare

Read Only
Read Only
Статус
Онлайн
Регистрация
23 Сен 2024
Сообщения
255
Реакции
0
Выберите загрузчик игры
  1. Прочие моды

Перед прочтением основного контента ниже, пожалуйста, обратите внимание на обновление внутри секции Майна на нашем форуме. У нас появились:

  • бесплатные читы для Майнкрафт — любое использование на свой страх и риск;
  • маркетплейс Майнкрафт — абсолютно любая коммерция, связанная с игрой, за исключением продажи читов (аккаунты, предоставления услуг, поиск кодеров читов и так далее);
  • приватные читы для Minecraft — в этом разделе только платные хаки для игры, покупайте группу "Продавец" и выставляйте на продажу свой софт;
  • обсуждения и гайды — всё тот же раздел с вопросами, но теперь модернизированный: поиск нужных хаков, пати с игроками-читерами и другая полезная информация.

Спасибо!

SS: Прикрепил снизу
DW:Ниже

код TargetHUD'а:
Expand Collapse Copy
/*
 * Decompiled with CFR 0.153-SNAPSHOT (d6f6758-dirty).
 */
package vesence.dlc.ui.hud.elements;

import com.mojang.blaze3d.platform.GlStateManager;
import net.minecraft.client.gui.AbstractGui;
import vesence.dlc.VesenceDLC;
import vesence.dlc.events.EventDisplay;
import vesence.dlc.modules.impl.render.Theme;
import vesence.dlc.ui.hud.hudRender;
import vesence.dlc.utils.animations.Animation;
import vesence.dlc.utils.animations.Direction;
import vesence.dlc.utils.animations.impl.EaseBackIn;
import vesence.dlc.utils.animations.impl.EaseInOutQuad;
import vesence.dlc.utils.animations.impl.ElasticAnimation;
import vesence.dlc.utils.client.ClientUtil;
import vesence.dlc.utils.client.IMinecraft;
import vesence.dlc.utils.drag.Dragging;
import vesence.dlc.utils.math.MathUtil;
import vesence.dlc.utils.math.StopWatch;
import vesence.dlc.utils.math.Vector4i;
import vesence.dlc.utils.render.KawaseBlur;
import vesence.dlc.utils.render.ColorUtils;
import vesence.dlc.utils.render.font.Fonts;
import vesence.dlc.utils.render.Scissor;
import vesence.dlc.utils.render.DisplayUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screen.ChatScreen;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.entity.LivingEntity;
import net.minecraft.scoreboard.Score;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector4f;
import org.lwjgl.opengl.GL11;

public class targetHudRender
        implements hudRender {
    private final StopWatch stopWatch = new StopWatch();
    private final Dragging drag;
    private LivingEntity entity = null;
    private boolean allow;
    private final Animation animation = new EaseInOutQuad(350,1);
    private float healthAnimation = 0.0f;
    private float absorptionAnimation = 0.0f;
    private float posX;
    private float posY;
    private final Vector4f ROUNDING_VECTOR = new Vector4f(6.0f, 6.0f, 6.0f, 6.0f);

    [USER=1367676]@override[/USER]
    public void render(EventDisplay eventDisplay) {
        this.entity = this.getTarget(this.entity);
        float rounding = 5.0f;
        boolean out = !this.allow || this.stopWatch.isReached(1000L);
        this.animation.setDuration(out ? 300 : 300);
        this.animation.setDirection(out ? Direction.BACKWARDS : Direction.FORWARDS);
        FloatFormatter formatter = new FloatFormatter();
        if (this.animation.getOutput() == 0.0) {
            this.entity = null;
        }
        if (this.entity != null) {
            String name = this.entity.getName().getString();
            float posX = this.drag.getX();
            float posY = this.drag.getY();
            float headSize = 28.0f;
            float spacing = 5.0f;
            float width = 100.666664f;
            float height = 45.333332f;
            this.drag.setWidth(width);
            this.drag.setHeight(height);
            float shrinking = 1.5f;
            Score score = Minecraft.world.getScoreboard().getOrCreateScore(this.entity.getScoreboardName(), Minecraft.world.getScoreboard().getObjectiveInDisplaySlot(2));
            float hp = this.entity.getHealth();
            float maxHp = this.entity.getMaxHealth();
            String header = targetHudRender.mc.ingameGUI.getTabList().header == null ? " " : targetHudRender.mc.ingameGUI.getTabList().header.getString().toLowerCase();
            this.healthAnimation = MathUtil.fast(this.healthAnimation, MathHelper.clamp(hp / maxHp, 0.0F, 1.0F), 5.0F);
            this.absorptionAnimation = MathUtil.fast(this.absorptionAnimation, MathHelper.clamp(this.entity.getAbsorptionAmount() / maxHp, 0.0f, 1.0f), 125.0f);
            float animationValue = (float) this.animation.getOutput();
            float halfAnimationValueRest = (1.0F - animationValue) / 2.0F;
            float testX = posX + width * halfAnimationValueRest;
            float testY = posY + height * halfAnimationValueRest;
            float testW = width * animationValue;
            float testH = height * animationValue;
            int windowWidth = ClientUtil.calc(mc.getMainWindow().getScaledWidth());
            float finalHp;
            if (ClientUtil.isConnectedToServer("funtime")) {
                finalHp = formatter.format(hp);
            } else if (ClientUtil.isConnectedToServer("mc.reallyworld.ru")) {
                finalHp = formatter.format(hp);
            } else if (ClientUtil.isConnectedToServer("play.saturn-x.space")) {
                finalHp = formatter.format(hp);
            } else {
                finalHp = formatter.format(hp + this.entity.getAbsorptionAmount());
            }

            String ownDivider = "";
            String ownStatus = "";
            Minecraft var42 = mc;
            if (this.entity != Minecraft.player) {
                ownDivider = "  ";
                double targetCheck = MathUtil.entity(this.entity, true, true, false, (double) 1.0F, false);
                Minecraft var41 = mc;
                double playerCheck = MathUtil.entity(Minecraft.player, true, true, false, (double) 1.0F, false);
                if (targetCheck > playerCheck) {
                    ownStatus = "";
                } else if (targetCheck < playerCheck) {
                    ownStatus = "";
                } else if (targetCheck == playerCheck) {
                    ownStatus = "";
                } else {
                    ownStatus = "";
                }
            } else {
                ownDivider = "";
                ownStatus = "";
            }
            GlStateManager.pushMatrix();
            targetHudRender.sizeAnimation(posX + width / 2.0f, posY + height / 2.0f, this.animation.getOutput());
            this.drawStyledRect(posX, posY, width, height, rounding, 255);
            this.drawTargetHead(this.entity, posX - 1 + 5.5F, posY + 5, headSize + 0.5F, headSize + 0.5F);
            Scissor.push();
            Scissor.setFromComponentCoordinates(testX, testY, testW - 6.0f, testH);
            Fonts.sfsemibolt.drawText(eventDisplay.getMatrixStack(), this.entity.getName().getString(), posX + 26.0f + spacing + spacing, posY + spacing, ColorUtils.rgb(255, 255, 255), 9, 0.1f);
            Object healthText = hp > 100.0f ? "\u041d\u0435\u0438\u0437\u0432\u0435\u0441\u043d\u043e" : "Health: " + finalHp;
            Scissor.unset();
            Scissor.pop();
            DisplayUtils.drawRoundedRect(posX + 26.0f + spacing + spacing, posY + height - spacing * 2.0f - 7.0f, (width - 40) * this.healthAnimation, 5.0f, new Vector4f(3, 3, 3, 3), new Vector4i(Theme.getColor(0),Theme.getColor(0), Theme.getColor(0), Theme.getColor(0)));
            DisplayUtils.drawRoundedRect(posX + 26.0f + spacing + spacing, posY + height - spacing * 2.0f - 7.0f, (width - 40) * this.healthAnimation, 5.0f, new Vector4f(3, 3, 3, 3), new Vector4i(ColorUtils.rgba(0,0,0,165),ColorUtils.rgba(0,0,0, 165), Theme.getColor(0), Theme.getColor(0)));
            Fonts.sfsemibolt.drawText(eventDisplay.getMatrixStack(), (String)healthText, posX + 27.0f + spacing + spacing, posY + 4 + spacing + spacing + spacing, ColorUtils.rgb(255, 255, 255), 7, 0.1f);

            GlStateManager.popMatrix();
        }
    }

    private LivingEntity getTarget(LivingEntity nullTarget) {
        LivingEntity auraTarget = VesenceDLC.getInstance().getFunctionRegistry().getKillAura().getTarget();
        LivingEntity target = nullTarget;
        if (auraTarget != null) {
            this.stopWatch.reset();
            this.allow = true;
            target = auraTarget;
        } else if (targetHudRender.mc.currentScreen instanceof ChatScreen) {
            this.stopWatch.reset();
            this.allow = true;
            target = Minecraft.player;
        } else {
            this.allow = false;
        }
        return target;
    }

    public void drawTargetHead(LivingEntity entity, float x, float y, float width, float height) {
        if (entity != null) {
            EntityRenderer<? super LivingEntity> rendererManager = mc.getRenderManager().getRenderer(entity);
            this.drawFace(rendererManager.getEntityTexture(entity), x, y, 8.0F, 8.0F, 8.0F, 8.0F, width, height, 64.0F, 64.0F, entity);
            this.drawFace(rendererManager.getEntityTexture(entity), x, y, 104.0F, 8.0F, 8.0F, 8.0F, width, height, 64.0F, 64.0F, entity);
        }

    }

    public static void sizeAnimation(double width, double height, double scale) {
        GlStateManager.translated(width, height, 0.0);
        GlStateManager.scaled(scale, scale, scale);
        GlStateManager.translated(-width, -height, 0.0);
    }

    public void drawFace(ResourceLocation res, float d, float y, float u, float v, float uWidth, float vHeight, float width, float height, float tileWidth, float tileHeight, LivingEntity target) {
        GL11.glPushMatrix();
        GL11.glEnable(3042);
        mc.getTextureManager().bindTexture(res);
        float hurtPercent = ((float)target.hurtTime - (target.hurtTime != 0 ? mc.timer.renderPartialTicks : 0.0F)) / 10.0F;
        GL11.glColor4f(1.0F, 1.0F - hurtPercent, 1.0F - hurtPercent, 1.0F);
        AbstractGui.drawScaledCustomSizeModalRect(d, y, u, v, uWidth, vHeight, width, height, tileWidth, tileHeight);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        GL11.glPopMatrix();
    }

    private void drawStyledRect(float x, float y, float width, float height, float radius, int alpha) {
        DisplayUtils.drawRoundedRect(x, y, width, height - 8, 3, ColorUtils.setAlpha(Theme.getColor(0), 50));
        DisplayUtils.drawRoundedRect(x, y, width, height - 8, 3, ColorUtils.rgba(15, 15, 15, 210));
    }

    public targetHudRender(Dragging drag) {
        this.drag = drag;
    }

    public class FloatFormatter {
        public float format(float value) {
            float multiplier = (float)Math.pow(10.0, 1.0);
            return (float)Math.round(value * multiplier) / multiplier;
        }
    }
}
Вроде пойдёт у полоски есть затемнение, даже если тема будет одного цвета, затемнение на полоске всё равно будет!
 

Вложения

  • 1745930296858.png
    1745930296858.png
    42.2 KB · Просмотры: 535
SS: Прикрепил снизу
DW:Ниже

код TargetHUD'а'а:
Expand Collapse Copy
/*
* Decompiled with CFR 0.153-SNAPSHOT (d6f6758-dirty).
*/
package vesence.dlc.ui.hud.elements;

import com.mojang.blaze3d.platform.GlStateManager;
import net.minecraft.client.gui.AbstractGui;
import vesence.dlc.VesenceDLC;
import vesence.dlc.events.EventDisplay;
import vesence.dlc.modules.impl.render.Theme;
import vesence.dlc.ui.hud.hudRender;
import vesence.dlc.utils.animations.Animation;
import vesence.dlc.utils.animations.Direction;
import vesence.dlc.utils.animations.impl.EaseBackIn;
import vesence.dlc.utils.animations.impl.EaseInOutQuad;
import vesence.dlc.utils.animations.impl.ElasticAnimation;
import vesence.dlc.utils.client.ClientUtil;
import vesence.dlc.utils.client.IMinecraft;
import vesence.dlc.utils.drag.Dragging;
import vesence.dlc.utils.math.MathUtil;
import vesence.dlc.utils.math.StopWatch;
import vesence.dlc.utils.math.Vector4i;
import vesence.dlc.utils.render.KawaseBlur;
import vesence.dlc.utils.render.ColorUtils;
import vesence.dlc.utils.render.font.Fonts;
import vesence.dlc.utils.render.Scissor;
import vesence.dlc.utils.render.DisplayUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screen.ChatScreen;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.entity.LivingEntity;
import net.minecraft.scoreboard.Score;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector4f;
import org.lwjgl.opengl.GL11;

public class targetHudRender
        implements hudRender {
    private final StopWatch stopWatch = new StopWatch();
    private final Dragging drag;
    private LivingEntity entity = null;
    private boolean allow;
    private final Animation animation = new EaseInOutQuad(350,1);
    private float healthAnimation = 0.0f;
    private float absorptionAnimation = 0.0f;
    private float posX;
    private float posY;
    private final Vector4f ROUNDING_VECTOR = new Vector4f(6.0f, 6.0f, 6.0f, 6.0f);

    [USER=1367676]@override[/USER]
    public void render(EventDisplay eventDisplay) {
        this.entity = this.getTarget(this.entity);
        float rounding = 5.0f;
        boolean out = !this.allow || this.stopWatch.isReached(1000L);
        this.animation.setDuration(out ? 300 : 300);
        this.animation.setDirection(out ? Direction.BACKWARDS : Direction.FORWARDS);
        FloatFormatter formatter = new FloatFormatter();
        if (this.animation.getOutput() == 0.0) {
            this.entity = null;
        }
        if (this.entity != null) {
            String name = this.entity.getName().getString();
            float posX = this.drag.getX();
            float posY = this.drag.getY();
            float headSize = 28.0f;
            float spacing = 5.0f;
            float width = 100.666664f;
            float height = 45.333332f;
            this.drag.setWidth(width);
            this.drag.setHeight(height);
            float shrinking = 1.5f;
            Score score = Minecraft.world.getScoreboard().getOrCreateScore(this.entity.getScoreboardName(), Minecraft.world.getScoreboard().getObjectiveInDisplaySlot(2));
            float hp = this.entity.getHealth();
            float maxHp = this.entity.getMaxHealth();
            String header = targetHudRender.mc.ingameGUI.getTabList().header == null ? " " : targetHudRender.mc.ingameGUI.getTabList().header.getString().toLowerCase();
            this.healthAnimation = MathUtil.fast(this.healthAnimation, MathHelper.clamp(hp / maxHp, 0.0F, 1.0F), 5.0F);
            this.absorptionAnimation = MathUtil.fast(this.absorptionAnimation, MathHelper.clamp(this.entity.getAbsorptionAmount() / maxHp, 0.0f, 1.0f), 125.0f);
            float animationValue = (float) this.animation.getOutput();
            float halfAnimationValueRest = (1.0F - animationValue) / 2.0F;
            float testX = posX + width * halfAnimationValueRest;
            float testY = posY + height * halfAnimationValueRest;
            float testW = width * animationValue;
            float testH = height * animationValue;
            int windowWidth = ClientUtil.calc(mc.getMainWindow().getScaledWidth());
            float finalHp;
            if (ClientUtil.isConnectedToServer("funtime")) {
                finalHp = formatter.format(hp);
            } else if (ClientUtil.isConnectedToServer("mc.reallyworld.ru")) {
                finalHp = formatter.format(hp);
            } else if (ClientUtil.isConnectedToServer("play.saturn-x.space")) {
                finalHp = formatter.format(hp);
            } else {
                finalHp = formatter.format(hp + this.entity.getAbsorptionAmount());
            }

            String ownDivider = "";
            String ownStatus = "";
            Minecraft var42 = mc;
            if (this.entity != Minecraft.player) {
                ownDivider = "  ";
                double targetCheck = MathUtil.entity(this.entity, true, true, false, (double) 1.0F, false);
                Minecraft var41 = mc;
                double playerCheck = MathUtil.entity(Minecraft.player, true, true, false, (double) 1.0F, false);
                if (targetCheck > playerCheck) {
                    ownStatus = "";
                } else if (targetCheck < playerCheck) {
                    ownStatus = "";
                } else if (targetCheck == playerCheck) {
                    ownStatus = "";
                } else {
                    ownStatus = "";
                }
            } else {
                ownDivider = "";
                ownStatus = "";
            }
            GlStateManager.pushMatrix();
            targetHudRender.sizeAnimation(posX + width / 2.0f, posY + height / 2.0f, this.animation.getOutput());
            this.drawStyledRect(posX, posY, width, height, rounding, 255);
            this.drawTargetHead(this.entity, posX - 1 + 5.5F, posY + 5, headSize + 0.5F, headSize + 0.5F);
            Scissor.push();
            Scissor.setFromComponentCoordinates(testX, testY, testW - 6.0f, testH);
            Fonts.sfsemibolt.drawText(eventDisplay.getMatrixStack(), this.entity.getName().getString(), posX + 26.0f + spacing + spacing, posY + spacing, ColorUtils.rgb(255, 255, 255), 9, 0.1f);
            Object healthText = hp > 100.0f ? "\u041d\u0435\u0438\u0437\u0432\u0435\u0441\u043d\u043e" : "Health: " + finalHp;
            Scissor.unset();
            Scissor.pop();
            DisplayUtils.drawRoundedRect(posX + 26.0f + spacing + spacing, posY + height - spacing * 2.0f - 7.0f, (width - 40) * this.healthAnimation, 5.0f, new Vector4f(3, 3, 3, 3), new Vector4i(Theme.getColor(0),Theme.getColor(0), Theme.getColor(0), Theme.getColor(0)));
            DisplayUtils.drawRoundedRect(posX + 26.0f + spacing + spacing, posY + height - spacing * 2.0f - 7.0f, (width - 40) * this.healthAnimation, 5.0f, new Vector4f(3, 3, 3, 3), new Vector4i(ColorUtils.rgba(0,0,0,165),ColorUtils.rgba(0,0,0, 165), Theme.getColor(0), Theme.getColor(0)));
            Fonts.sfsemibolt.drawText(eventDisplay.getMatrixStack(), (String)healthText, posX + 27.0f + spacing + spacing, posY + 4 + spacing + spacing + spacing, ColorUtils.rgb(255, 255, 255), 7, 0.1f);

            GlStateManager.popMatrix();
        }
    }

    private LivingEntity getTarget(LivingEntity nullTarget) {
        LivingEntity auraTarget = VesenceDLC.getInstance().getFunctionRegistry().getKillAura().getTarget();
        LivingEntity target = nullTarget;
        if (auraTarget != null) {
            this.stopWatch.reset();
            this.allow = true;
            target = auraTarget;
        } else if (targetHudRender.mc.currentScreen instanceof ChatScreen) {
            this.stopWatch.reset();
            this.allow = true;
            target = Minecraft.player;
        } else {
            this.allow = false;
        }
        return target;
    }

    public void drawTargetHead(LivingEntity entity, float x, float y, float width, float height) {
        if (entity != null) {
            EntityRenderer<? super LivingEntity> rendererManager = mc.getRenderManager().getRenderer(entity);
            this.drawFace(rendererManager.getEntityTexture(entity), x, y, 8.0F, 8.0F, 8.0F, 8.0F, width, height, 64.0F, 64.0F, entity);
            this.drawFace(rendererManager.getEntityTexture(entity), x, y, 104.0F, 8.0F, 8.0F, 8.0F, width, height, 64.0F, 64.0F, entity);
        }

    }

    public static void sizeAnimation(double width, double height, double scale) {
        GlStateManager.translated(width, height, 0.0);
        GlStateManager.scaled(scale, scale, scale);
        GlStateManager.translated(-width, -height, 0.0);
    }

    public void drawFace(ResourceLocation res, float d, float y, float u, float v, float uWidth, float vHeight, float width, float height, float tileWidth, float tileHeight, LivingEntity target) {
        GL11.glPushMatrix();
        GL11.glEnable(3042);
        mc.getTextureManager().bindTexture(res);
        float hurtPercent = ((float)target.hurtTime - (target.hurtTime != 0 ? mc.timer.renderPartialTicks : 0.0F)) / 10.0F;
        GL11.glColor4f(1.0F, 1.0F - hurtPercent, 1.0F - hurtPercent, 1.0F);
        AbstractGui.drawScaledCustomSizeModalRect(d, y, u, v, uWidth, vHeight, width, height, tileWidth, tileHeight);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        GL11.glPopMatrix();
    }

    private void drawStyledRect(float x, float y, float width, float height, float radius, int alpha) {
        DisplayUtils.drawRoundedRect(x, y, width, height - 8, 3, ColorUtils.setAlpha(Theme.getColor(0), 50));
        DisplayUtils.drawRoundedRect(x, y, width, height - 8, 3, ColorUtils.rgba(15, 15, 15, 210));
    }

    public targetHudRender(Dragging drag) {
        this.drag = drag;
    }

    public class FloatFormatter {
        public float format(float value) {
            float multiplier = (float)Math.pow(10.0, 1.0);
            return (float)Math.round(value * multiplier) / multiplier;
        }
    }
}
Вроде пойдёт у полоски есть затемнение, даже если тема будет одного цвета, затемнение на полоске всё равно будет!
броню сверху и золотые сердечки и можно пастить
 
SS: Прикрепил снизу
DW:Ниже

код TargetHUD'а'а:
Expand Collapse Copy
/*
* Decompiled with CFR 0.153-SNAPSHOT (d6f6758-dirty).
*/
package vesence.dlc.ui.hud.elements;

import com.mojang.blaze3d.platform.GlStateManager;
import net.minecraft.client.gui.AbstractGui;
import vesence.dlc.VesenceDLC;
import vesence.dlc.events.EventDisplay;
import vesence.dlc.modules.impl.render.Theme;
import vesence.dlc.ui.hud.hudRender;
import vesence.dlc.utils.animations.Animation;
import vesence.dlc.utils.animations.Direction;
import vesence.dlc.utils.animations.impl.EaseBackIn;
import vesence.dlc.utils.animations.impl.EaseInOutQuad;
import vesence.dlc.utils.animations.impl.ElasticAnimation;
import vesence.dlc.utils.client.ClientUtil;
import vesence.dlc.utils.client.IMinecraft;
import vesence.dlc.utils.drag.Dragging;
import vesence.dlc.utils.math.MathUtil;
import vesence.dlc.utils.math.StopWatch;
import vesence.dlc.utils.math.Vector4i;
import vesence.dlc.utils.render.KawaseBlur;
import vesence.dlc.utils.render.ColorUtils;
import vesence.dlc.utils.render.font.Fonts;
import vesence.dlc.utils.render.Scissor;
import vesence.dlc.utils.render.DisplayUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screen.ChatScreen;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.entity.LivingEntity;
import net.minecraft.scoreboard.Score;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector4f;
import org.lwjgl.opengl.GL11;

public class targetHudRender
        implements hudRender {
    private final StopWatch stopWatch = new StopWatch();
    private final Dragging drag;
    private LivingEntity entity = null;
    private boolean allow;
    private final Animation animation = new EaseInOutQuad(350,1);
    private float healthAnimation = 0.0f;
    private float absorptionAnimation = 0.0f;
    private float posX;
    private float posY;
    private final Vector4f ROUNDING_VECTOR = new Vector4f(6.0f, 6.0f, 6.0f, 6.0f);

    [USER=1367676]@override[/USER]
    public void render(EventDisplay eventDisplay) {
        this.entity = this.getTarget(this.entity);
        float rounding = 5.0f;
        boolean out = !this.allow || this.stopWatch.isReached(1000L);
        this.animation.setDuration(out ? 300 : 300);
        this.animation.setDirection(out ? Direction.BACKWARDS : Direction.FORWARDS);
        FloatFormatter formatter = new FloatFormatter();
        if (this.animation.getOutput() == 0.0) {
            this.entity = null;
        }
        if (this.entity != null) {
            String name = this.entity.getName().getString();
            float posX = this.drag.getX();
            float posY = this.drag.getY();
            float headSize = 28.0f;
            float spacing = 5.0f;
            float width = 100.666664f;
            float height = 45.333332f;
            this.drag.setWidth(width);
            this.drag.setHeight(height);
            float shrinking = 1.5f;
            Score score = Minecraft.world.getScoreboard().getOrCreateScore(this.entity.getScoreboardName(), Minecraft.world.getScoreboard().getObjectiveInDisplaySlot(2));
            float hp = this.entity.getHealth();
            float maxHp = this.entity.getMaxHealth();
            String header = targetHudRender.mc.ingameGUI.getTabList().header == null ? " " : targetHudRender.mc.ingameGUI.getTabList().header.getString().toLowerCase();
            this.healthAnimation = MathUtil.fast(this.healthAnimation, MathHelper.clamp(hp / maxHp, 0.0F, 1.0F), 5.0F);
            this.absorptionAnimation = MathUtil.fast(this.absorptionAnimation, MathHelper.clamp(this.entity.getAbsorptionAmount() / maxHp, 0.0f, 1.0f), 125.0f);
            float animationValue = (float) this.animation.getOutput();
            float halfAnimationValueRest = (1.0F - animationValue) / 2.0F;
            float testX = posX + width * halfAnimationValueRest;
            float testY = posY + height * halfAnimationValueRest;
            float testW = width * animationValue;
            float testH = height * animationValue;
            int windowWidth = ClientUtil.calc(mc.getMainWindow().getScaledWidth());
            float finalHp;
            if (ClientUtil.isConnectedToServer("funtime")) {
                finalHp = formatter.format(hp);
            } else if (ClientUtil.isConnectedToServer("mc.reallyworld.ru")) {
                finalHp = formatter.format(hp);
            } else if (ClientUtil.isConnectedToServer("play.saturn-x.space")) {
                finalHp = formatter.format(hp);
            } else {
                finalHp = formatter.format(hp + this.entity.getAbsorptionAmount());
            }

            String ownDivider = "";
            String ownStatus = "";
            Minecraft var42 = mc;
            if (this.entity != Minecraft.player) {
                ownDivider = "  ";
                double targetCheck = MathUtil.entity(this.entity, true, true, false, (double) 1.0F, false);
                Minecraft var41 = mc;
                double playerCheck = MathUtil.entity(Minecraft.player, true, true, false, (double) 1.0F, false);
                if (targetCheck > playerCheck) {
                    ownStatus = "";
                } else if (targetCheck < playerCheck) {
                    ownStatus = "";
                } else if (targetCheck == playerCheck) {
                    ownStatus = "";
                } else {
                    ownStatus = "";
                }
            } else {
                ownDivider = "";
                ownStatus = "";
            }
            GlStateManager.pushMatrix();
            targetHudRender.sizeAnimation(posX + width / 2.0f, posY + height / 2.0f, this.animation.getOutput());
            this.drawStyledRect(posX, posY, width, height, rounding, 255);
            this.drawTargetHead(this.entity, posX - 1 + 5.5F, posY + 5, headSize + 0.5F, headSize + 0.5F);
            Scissor.push();
            Scissor.setFromComponentCoordinates(testX, testY, testW - 6.0f, testH);
            Fonts.sfsemibolt.drawText(eventDisplay.getMatrixStack(), this.entity.getName().getString(), posX + 26.0f + spacing + spacing, posY + spacing, ColorUtils.rgb(255, 255, 255), 9, 0.1f);
            Object healthText = hp > 100.0f ? "\u041d\u0435\u0438\u0437\u0432\u0435\u0441\u043d\u043e" : "Health: " + finalHp;
            Scissor.unset();
            Scissor.pop();
            DisplayUtils.drawRoundedRect(posX + 26.0f + spacing + spacing, posY + height - spacing * 2.0f - 7.0f, (width - 40) * this.healthAnimation, 5.0f, new Vector4f(3, 3, 3, 3), new Vector4i(Theme.getColor(0),Theme.getColor(0), Theme.getColor(0), Theme.getColor(0)));
            DisplayUtils.drawRoundedRect(posX + 26.0f + spacing + spacing, posY + height - spacing * 2.0f - 7.0f, (width - 40) * this.healthAnimation, 5.0f, new Vector4f(3, 3, 3, 3), new Vector4i(ColorUtils.rgba(0,0,0,165),ColorUtils.rgba(0,0,0, 165), Theme.getColor(0), Theme.getColor(0)));
            Fonts.sfsemibolt.drawText(eventDisplay.getMatrixStack(), (String)healthText, posX + 27.0f + spacing + spacing, posY + 4 + spacing + spacing + spacing, ColorUtils.rgb(255, 255, 255), 7, 0.1f);

            GlStateManager.popMatrix();
        }
    }

    private LivingEntity getTarget(LivingEntity nullTarget) {
        LivingEntity auraTarget = VesenceDLC.getInstance().getFunctionRegistry().getKillAura().getTarget();
        LivingEntity target = nullTarget;
        if (auraTarget != null) {
            this.stopWatch.reset();
            this.allow = true;
            target = auraTarget;
        } else if (targetHudRender.mc.currentScreen instanceof ChatScreen) {
            this.stopWatch.reset();
            this.allow = true;
            target = Minecraft.player;
        } else {
            this.allow = false;
        }
        return target;
    }

    public void drawTargetHead(LivingEntity entity, float x, float y, float width, float height) {
        if (entity != null) {
            EntityRenderer<? super LivingEntity> rendererManager = mc.getRenderManager().getRenderer(entity);
            this.drawFace(rendererManager.getEntityTexture(entity), x, y, 8.0F, 8.0F, 8.0F, 8.0F, width, height, 64.0F, 64.0F, entity);
            this.drawFace(rendererManager.getEntityTexture(entity), x, y, 104.0F, 8.0F, 8.0F, 8.0F, width, height, 64.0F, 64.0F, entity);
        }

    }

    public static void sizeAnimation(double width, double height, double scale) {
        GlStateManager.translated(width, height, 0.0);
        GlStateManager.scaled(scale, scale, scale);
        GlStateManager.translated(-width, -height, 0.0);
    }

    public void drawFace(ResourceLocation res, float d, float y, float u, float v, float uWidth, float vHeight, float width, float height, float tileWidth, float tileHeight, LivingEntity target) {
        GL11.glPushMatrix();
        GL11.glEnable(3042);
        mc.getTextureManager().bindTexture(res);
        float hurtPercent = ((float)target.hurtTime - (target.hurtTime != 0 ? mc.timer.renderPartialTicks : 0.0F)) / 10.0F;
        GL11.glColor4f(1.0F, 1.0F - hurtPercent, 1.0F - hurtPercent, 1.0F);
        AbstractGui.drawScaledCustomSizeModalRect(d, y, u, v, uWidth, vHeight, width, height, tileWidth, tileHeight);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        GL11.glPopMatrix();
    }

    private void drawStyledRect(float x, float y, float width, float height, float radius, int alpha) {
        DisplayUtils.drawRoundedRect(x, y, width, height - 8, 3, ColorUtils.setAlpha(Theme.getColor(0), 50));
        DisplayUtils.drawRoundedRect(x, y, width, height - 8, 3, ColorUtils.rgba(15, 15, 15, 210));
    }

    public targetHudRender(Dragging drag) {
        this.drag = drag;
    }

    public class FloatFormatter {
        public float format(float value) {
            float multiplier = (float)Math.pow(10.0, 1.0);
            return (float)Math.round(value * multiplier) / multiplier;
        }
    }
}
Вроде пойдёт у полоски есть затемнение, даже если тема будет одного цвета, затемнение на полоске всё равно будет!
кайф мне нрав :seemsgood:
 
относительно неплохо, голову бы относительно бы скруглить относительно шейдером или относительно маской.
 
хзхз слишком простой
hudas client почти такая же
 
Последнее редактирование:
SS: Прикрепил снизу
DW:Ниже

код TargetHUD'а'а:
Expand Collapse Copy
/*
* Decompiled with CFR 0.153-SNAPSHOT (d6f6758-dirty).
*/
package vesence.dlc.ui.hud.elements;

import com.mojang.blaze3d.platform.GlStateManager;
import net.minecraft.client.gui.AbstractGui;
import vesence.dlc.VesenceDLC;
import vesence.dlc.events.EventDisplay;
import vesence.dlc.modules.impl.render.Theme;
import vesence.dlc.ui.hud.hudRender;
import vesence.dlc.utils.animations.Animation;
import vesence.dlc.utils.animations.Direction;
import vesence.dlc.utils.animations.impl.EaseBackIn;
import vesence.dlc.utils.animations.impl.EaseInOutQuad;
import vesence.dlc.utils.animations.impl.ElasticAnimation;
import vesence.dlc.utils.client.ClientUtil;
import vesence.dlc.utils.client.IMinecraft;
import vesence.dlc.utils.drag.Dragging;
import vesence.dlc.utils.math.MathUtil;
import vesence.dlc.utils.math.StopWatch;
import vesence.dlc.utils.math.Vector4i;
import vesence.dlc.utils.render.KawaseBlur;
import vesence.dlc.utils.render.ColorUtils;
import vesence.dlc.utils.render.font.Fonts;
import vesence.dlc.utils.render.Scissor;
import vesence.dlc.utils.render.DisplayUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screen.ChatScreen;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.entity.LivingEntity;
import net.minecraft.scoreboard.Score;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector4f;
import org.lwjgl.opengl.GL11;

public class targetHudRender
        implements hudRender {
    private final StopWatch stopWatch = new StopWatch();
    private final Dragging drag;
    private LivingEntity entity = null;
    private boolean allow;
    private final Animation animation = new EaseInOutQuad(350,1);
    private float healthAnimation = 0.0f;
    private float absorptionAnimation = 0.0f;
    private float posX;
    private float posY;
    private final Vector4f ROUNDING_VECTOR = new Vector4f(6.0f, 6.0f, 6.0f, 6.0f);

    [USER=1367676]@override[/USER]
    public void render(EventDisplay eventDisplay) {
        this.entity = this.getTarget(this.entity);
        float rounding = 5.0f;
        boolean out = !this.allow || this.stopWatch.isReached(1000L);
        this.animation.setDuration(out ? 300 : 300);
        this.animation.setDirection(out ? Direction.BACKWARDS : Direction.FORWARDS);
        FloatFormatter formatter = new FloatFormatter();
        if (this.animation.getOutput() == 0.0) {
            this.entity = null;
        }
        if (this.entity != null) {
            String name = this.entity.getName().getString();
            float posX = this.drag.getX();
            float posY = this.drag.getY();
            float headSize = 28.0f;
            float spacing = 5.0f;
            float width = 100.666664f;
            float height = 45.333332f;
            this.drag.setWidth(width);
            this.drag.setHeight(height);
            float shrinking = 1.5f;
            Score score = Minecraft.world.getScoreboard().getOrCreateScore(this.entity.getScoreboardName(), Minecraft.world.getScoreboard().getObjectiveInDisplaySlot(2));
            float hp = this.entity.getHealth();
            float maxHp = this.entity.getMaxHealth();
            String header = targetHudRender.mc.ingameGUI.getTabList().header == null ? " " : targetHudRender.mc.ingameGUI.getTabList().header.getString().toLowerCase();
            this.healthAnimation = MathUtil.fast(this.healthAnimation, MathHelper.clamp(hp / maxHp, 0.0F, 1.0F), 5.0F);
            this.absorptionAnimation = MathUtil.fast(this.absorptionAnimation, MathHelper.clamp(this.entity.getAbsorptionAmount() / maxHp, 0.0f, 1.0f), 125.0f);
            float animationValue = (float) this.animation.getOutput();
            float halfAnimationValueRest = (1.0F - animationValue) / 2.0F;
            float testX = posX + width * halfAnimationValueRest;
            float testY = posY + height * halfAnimationValueRest;
            float testW = width * animationValue;
            float testH = height * animationValue;
            int windowWidth = ClientUtil.calc(mc.getMainWindow().getScaledWidth());
            float finalHp;
            if (ClientUtil.isConnectedToServer("funtime")) {
                finalHp = formatter.format(hp);
            } else if (ClientUtil.isConnectedToServer("mc.reallyworld.ru")) {
                finalHp = formatter.format(hp);
            } else if (ClientUtil.isConnectedToServer("play.saturn-x.space")) {
                finalHp = formatter.format(hp);
            } else {
                finalHp = formatter.format(hp + this.entity.getAbsorptionAmount());
            }

            String ownDivider = "";
            String ownStatus = "";
            Minecraft var42 = mc;
            if (this.entity != Minecraft.player) {
                ownDivider = "  ";
                double targetCheck = MathUtil.entity(this.entity, true, true, false, (double) 1.0F, false);
                Minecraft var41 = mc;
                double playerCheck = MathUtil.entity(Minecraft.player, true, true, false, (double) 1.0F, false);
                if (targetCheck > playerCheck) {
                    ownStatus = "";
                } else if (targetCheck < playerCheck) {
                    ownStatus = "";
                } else if (targetCheck == playerCheck) {
                    ownStatus = "";
                } else {
                    ownStatus = "";
                }
            } else {
                ownDivider = "";
                ownStatus = "";
            }
            GlStateManager.pushMatrix();
            targetHudRender.sizeAnimation(posX + width / 2.0f, posY + height / 2.0f, this.animation.getOutput());
            this.drawStyledRect(posX, posY, width, height, rounding, 255);
            this.drawTargetHead(this.entity, posX - 1 + 5.5F, posY + 5, headSize + 0.5F, headSize + 0.5F);
            Scissor.push();
            Scissor.setFromComponentCoordinates(testX, testY, testW - 6.0f, testH);
            Fonts.sfsemibolt.drawText(eventDisplay.getMatrixStack(), this.entity.getName().getString(), posX + 26.0f + spacing + spacing, posY + spacing, ColorUtils.rgb(255, 255, 255), 9, 0.1f);
            Object healthText = hp > 100.0f ? "\u041d\u0435\u0438\u0437\u0432\u0435\u0441\u043d\u043e" : "Health: " + finalHp;
            Scissor.unset();
            Scissor.pop();
            DisplayUtils.drawRoundedRect(posX + 26.0f + spacing + spacing, posY + height - spacing * 2.0f - 7.0f, (width - 40) * this.healthAnimation, 5.0f, new Vector4f(3, 3, 3, 3), new Vector4i(Theme.getColor(0),Theme.getColor(0), Theme.getColor(0), Theme.getColor(0)));
            DisplayUtils.drawRoundedRect(posX + 26.0f + spacing + spacing, posY + height - spacing * 2.0f - 7.0f, (width - 40) * this.healthAnimation, 5.0f, new Vector4f(3, 3, 3, 3), new Vector4i(ColorUtils.rgba(0,0,0,165),ColorUtils.rgba(0,0,0, 165), Theme.getColor(0), Theme.getColor(0)));
            Fonts.sfsemibolt.drawText(eventDisplay.getMatrixStack(), (String)healthText, posX + 27.0f + spacing + spacing, posY + 4 + spacing + spacing + spacing, ColorUtils.rgb(255, 255, 255), 7, 0.1f);

            GlStateManager.popMatrix();
        }
    }

    private LivingEntity getTarget(LivingEntity nullTarget) {
        LivingEntity auraTarget = VesenceDLC.getInstance().getFunctionRegistry().getKillAura().getTarget();
        LivingEntity target = nullTarget;
        if (auraTarget != null) {
            this.stopWatch.reset();
            this.allow = true;
            target = auraTarget;
        } else if (targetHudRender.mc.currentScreen instanceof ChatScreen) {
            this.stopWatch.reset();
            this.allow = true;
            target = Minecraft.player;
        } else {
            this.allow = false;
        }
        return target;
    }

    public void drawTargetHead(LivingEntity entity, float x, float y, float width, float height) {
        if (entity != null) {
            EntityRenderer<? super LivingEntity> rendererManager = mc.getRenderManager().getRenderer(entity);
            this.drawFace(rendererManager.getEntityTexture(entity), x, y, 8.0F, 8.0F, 8.0F, 8.0F, width, height, 64.0F, 64.0F, entity);
            this.drawFace(rendererManager.getEntityTexture(entity), x, y, 104.0F, 8.0F, 8.0F, 8.0F, width, height, 64.0F, 64.0F, entity);
        }

    }

    public static void sizeAnimation(double width, double height, double scale) {
        GlStateManager.translated(width, height, 0.0);
        GlStateManager.scaled(scale, scale, scale);
        GlStateManager.translated(-width, -height, 0.0);
    }

    public void drawFace(ResourceLocation res, float d, float y, float u, float v, float uWidth, float vHeight, float width, float height, float tileWidth, float tileHeight, LivingEntity target) {
        GL11.glPushMatrix();
        GL11.glEnable(3042);
        mc.getTextureManager().bindTexture(res);
        float hurtPercent = ((float)target.hurtTime - (target.hurtTime != 0 ? mc.timer.renderPartialTicks : 0.0F)) / 10.0F;
        GL11.glColor4f(1.0F, 1.0F - hurtPercent, 1.0F - hurtPercent, 1.0F);
        AbstractGui.drawScaledCustomSizeModalRect(d, y, u, v, uWidth, vHeight, width, height, tileWidth, tileHeight);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        GL11.glPopMatrix();
    }

    private void drawStyledRect(float x, float y, float width, float height, float radius, int alpha) {
        DisplayUtils.drawRoundedRect(x, y, width, height - 8, 3, ColorUtils.setAlpha(Theme.getColor(0), 50));
        DisplayUtils.drawRoundedRect(x, y, width, height - 8, 3, ColorUtils.rgba(15, 15, 15, 210));
    }

    public targetHudRender(Dragging drag) {
        this.drag = drag;
    }

    public class FloatFormatter {
        public float format(float value) {
            float multiplier = (float)Math.pow(10.0, 1.0);
            return (float)Math.round(value * multiplier) / multiplier;
        }
    }
}
Вроде пойдёт у полоски есть затемнение, даже если тема будет одного цвета, затемнение на полоске всё равно будет!
ну дефолтный таргет худ.

закругление бошки - нет
внешне красиво - да
закругление хп - вектор
итог: 6/10
 
Назад
Сверху Снизу