Исходник Vega TargetHud Skid

Начинающий
Статус
Оффлайн
Регистрация
29 Мар 2024
Сообщения
44
Реакции[?]
0
Поинты[?]
0
это не отдельная функция, заходишь в нужный тебе худ, где хочешь этот таргет худ ( к примеру HUD2) ищешь строки которые относятся к таргет худу и меняешь их (это если ты на експа 2.0, если 3.1 то ctrl+shift+n и ищешь TargetInfoRenderer и там заменяешь все кроме импортов)
спасибо, у меня получилось
 
Начинающий
Статус
Оффлайн
Регистрация
10 Фев 2023
Сообщения
375
Реакции[?]
0
Поинты[?]
1K
Во первых не градиент. А shadow с градиентом! Никнейм передвинуть в правую сторону чутка, чуть блюра, размер таргет худа меньше зделать не так сильно ну и будет нормально.
ебать ты душный
 
Начинающий
Статус
Оффлайн
Регистрация
14 Июн 2023
Сообщения
82
Реакции[?]
0
Поинты[?]
0
Пожалуйста, авторизуйтесь для просмотра ссылки.

Код:
@FieldDefaults(level = AccessLevel.PRIVATE)
@RequiredArgsConstructor
public class VegaTargetHudRender implements ElementRenderer {
    private final StopWatch stopWatch = new StopWatch();
    private final Dragging drag;
    private LivingEntity entity = null;
    private boolean allow;
    private final Animation animation = new EaseBackIn(132, 1.0, 1.0F);
    private float healthAnimation = 0.0F;
    private float absorptionAnimation = 0.0F;
    private float hurtAnimation = 0.0F;
    private float second = 0.0F;
    private float third = 0.0F;

    public void render(EventDisplay eventDisplay) {
        this.entity = this.getTarget(this.entity);
        float rounding = 6.0F;
        boolean out = !this.allow || this.stopWatch.isReached(420L);
        this.animation.setDuration(out ? 400 : 300);
        this.animation.setDirection(out ? Direction.BACKWARDS : Direction.FORWARDS);
        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 = 36.0F;
            float spacing = 5.0F;
            float width = 111.0F;
            float height = 38.0F;
            this.drag.setWidth(width);
            this.drag.setHeight(height);
            float shrinking = 1.5F;
            Score score = mc.world.getScoreboard().getOrCreateScore(this.entity.getScoreboardName(), mc.world.getScoreboard().getObjectiveInDisplaySlot(2));
            float hp = this.entity.getHealth();
            float maxHp = this.entity.getMaxHealth();
            String header = mc.ingameGUI.getTabList().header == null ? " " : mc.ingameGUI.getTabList().header.getString().toLowerCase();
            if (mc.getCurrentServerData() != null && mc.getCurrentServerData().serverIP.contains("funtime") && (header.contains("анархия") || header.contains("гриферский")) && this.entity instanceof PlayerEntity) {
                hp = (float)score.getScorePoints();
                maxHp = 20.0F;
            }

            this.healthAnimation = MathUtil.fast(this.healthAnimation, MathHelper.clamp(hp / maxHp, 0.0F, 1.0F), 10.0F);
            this.absorptionAnimation = MathUtil.fast(this.absorptionAnimation, MathHelper.clamp(this.entity.getAbsorptionAmount() / maxHp, 0.0F, 1.0F), 10.0F);
            if (mc.getCurrentServerData() != null && mc.getCurrentServerData().serverIP.contains("funtime") && (header.contains("анархия") || header.contains("гриферский")) && this.entity instanceof PlayerEntity) {
                hp = (float)score.getScorePoints();
                maxHp = 20.0F;
            }

            float animationValue = (float)this.animation.getOutput();
            this.hurtAnimation = MathUtil.fast(this.hurtAnimation, this.entity.hurtTime > 0 ? 208.0F : 0.0F, 16.0F);
            this.second = MathUtil.fast(this.second, this.entity.hurtTime > 0 ? 77.0F : 0.0F, 16.0F);
            this.third = MathUtil.fast(this.third, this.entity.hurtTime > 0 ? 77.0F : 0.0F, 16.0F);
            float halfAnimationValueRest = (1.0F - animationValue) / 2.0F;
            GlStateManager.pushMatrix();
            Style style = Darkflow.getInstance().getStyleManager().getCurrentStyle();
            sizeAnimation((double)(posX + width / 2.0F), (double)(posY + height / 2.0F), this.animation.getOutput());
            KawaseBlur.blur.updateBlur(2,1);
            KawaseBlur.blur.render(()->{
                DisplayUtils.drawRoundedRect(posX + 37.0F, posY + 10.6f,  1.5F, 28.7F, new Vector4f(2.0F, 3.0F, 3.0F, 3.0F), (new Color(31, 31, 31, 140)).getRGB());
                DisplayUtils.drawRoundedRect(posX, posY + height / 6.0F, width, height / 1.0F, new Vector4f(9.0F, 10.0F, 9.0F, 9.0F), (new Color(25, 25, 25, 150)).getRGB());
            });
            DisplayUtils.drawRoundedRect(posX + 37.0F, posY + 10.6f,  1.5F, 29.7F, new Vector4f(2.0F, 3.0F, 3.0F, 3.0F), (new Vector4i(style.getFirstColor().getRGB(), style.getFirstColor().getRGB(), style.getSecondColor().getRGB(), style.getSecondColor().getRGB())));
            DisplayUtils.drawRoundedRect(posX, posY + height / 6.1F, width, height / 1.0F, new Vector4f(9.0F, 9.0F, 9.0F, 9.0F), (new Color(31, 30, 30, 150)).getRGB());

            DisplayUtils.drawRoundedRect(posX + 43.0F, posY + height / 1.41F + height / 4.0F - 2.0F, (width - 53.0F) * this.healthAnimation, 5.2F, new Vector4f(2.1F, 3.0F, 3.0F, 3.0F), new Vector4i(style.getFirstColor().getRGB(), style.getFirstColor().getRGB(), style.getSecondColor().getRGB(), style.getSecondColor().getRGB()));
            DisplayUtils.drawRoundedRect(posX + 43.0F, posY + height / 1.41F + height / 4.0F - 2.0F, (width - 53.0F) * this.absorptionAnimation, 5.2F, new Vector4f(2.0F, 2.0F, 2.0F, 2.0F), (new Color(255, 200, 0)).getRGB());
            DisplayUtils.drawRoundedRect(posX + 61.9F, posY + 22.8f,  0.5F, 8.4F, new Vector4f(1F, 1F, 1F, 1f), (new Color(255, 255, 255, 255)).getRGB());
            Scissor.push();
            Scissor.setFromComponentCoordinates((double)posX, (double)posY, (double)width, (double)height);
            Fonts.montserrat.drawText(eventDisplay.getMatrixStack() ,String.valueOf(Math.round(entity.getHealth())) + "HP ",posX + 43,posY + height / 2.3f - 8 + Fonts.sfbold.getHeight(15.4f) + 1,new Color(246, 244, 244).getRGB(),5.8f);
            Fonts.montserrat.drawText(eventDisplay.getMatrixStack(), this.entity.getName().getString(), posX + 44.0F, posY + height / 2.9F - 4.0F, -1, 7.1F);
            Scissor.pop();

            int anim = (int)this.hurtAnimation;
            int anim2 = (int)this.second;
            int anim3 = (int)this.third;
            drawTargetHead(entity,posX + 11.6F - 5.0F, posY + 17.4F - 5.0F, 26.5F, 26.5F);
            drawItemStack(posX + 63,posY + height / 4 - 8 + Fonts.sfbold.getHeight(12f) + 10,7.7f);
            GlStateManager.popMatrix();
        }

    }

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

        return (LivingEntity)target;
    }

        private void drawItemStack(float x, float y, float offset) {
        List<ItemStack> stacks = new ArrayList<>(Arrays.asList(entity.getHeldItemMainhand(), entity.getHeldItemOffhand()));
        entity.getArmorInventoryList().forEach(stacks::add);
        stacks.removeIf(w -> w.getItem() instanceof AirItem);
        Collections.reverse(stacks);
        final AtomicReference<Float> posX = new AtomicReference<>(x);

        stacks.stream()
                .filter(stack -> !stack.isEmpty())
                .forEach(stack -> DisplayUtils.drawItemStack(stack,
                        posX.getAndAccumulate(offset, Float::sum),
                        y,
                        true,
                        true, 0.5f));
    }

    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);
        }

    }

    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) {
        Style style = Darkflow.getInstance().getStyleManager().getCurrentStyle();
        DisplayUtils.drawRoundedRect(x, y, width, height, radius, ColorUtils.rgba(18, 18, 18, alpha));
    }

}
Чет как то не похоже вххвазхзхва
 
Начинающий
Статус
Оффлайн
Регистрация
20 Мар 2024
Сообщения
26
Реакции[?]
0
Поинты[?]
0
Пожалуйста, авторизуйтесь для просмотра ссылки.

Код:
@FieldDefaults(level = AccessLevel.PRIVATE)
@RequiredArgsConstructor
public class VegaTargetHudRender implements ElementRenderer {
    private final StopWatch stopWatch = new StopWatch();
    private final Dragging drag;
    private LivingEntity entity = null;
    private boolean allow;
    private final Animation animation = new EaseBackIn(132, 1.0, 1.0F);
    private float healthAnimation = 0.0F;
    private float absorptionAnimation = 0.0F;
    private float hurtAnimation = 0.0F;
    private float second = 0.0F;
    private float third = 0.0F;

    public void render(EventDisplay eventDisplay) {
        this.entity = this.getTarget(this.entity);
        float rounding = 6.0F;
        boolean out = !this.allow || this.stopWatch.isReached(420L);
        this.animation.setDuration(out ? 400 : 300);
        this.animation.setDirection(out ? Direction.BACKWARDS : Direction.FORWARDS);
        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 = 36.0F;
            float spacing = 5.0F;
            float width = 111.0F;
            float height = 38.0F;
            this.drag.setWidth(width);
            this.drag.setHeight(height);
            float shrinking = 1.5F;
            Score score = mc.world.getScoreboard().getOrCreateScore(this.entity.getScoreboardName(), mc.world.getScoreboard().getObjectiveInDisplaySlot(2));
            float hp = this.entity.getHealth();
            float maxHp = this.entity.getMaxHealth();
            String header = mc.ingameGUI.getTabList().header == null ? " " : mc.ingameGUI.getTabList().header.getString().toLowerCase();
            if (mc.getCurrentServerData() != null && mc.getCurrentServerData().serverIP.contains("funtime") && (header.contains("анархия") || header.contains("гриферский")) && this.entity instanceof PlayerEntity) {
                hp = (float)score.getScorePoints();
                maxHp = 20.0F;
            }

            this.healthAnimation = MathUtil.fast(this.healthAnimation, MathHelper.clamp(hp / maxHp, 0.0F, 1.0F), 10.0F);
            this.absorptionAnimation = MathUtil.fast(this.absorptionAnimation, MathHelper.clamp(this.entity.getAbsorptionAmount() / maxHp, 0.0F, 1.0F), 10.0F);
            if (mc.getCurrentServerData() != null && mc.getCurrentServerData().serverIP.contains("funtime") && (header.contains("анархия") || header.contains("гриферский")) && this.entity instanceof PlayerEntity) {
                hp = (float)score.getScorePoints();
                maxHp = 20.0F;
            }

            float animationValue = (float)this.animation.getOutput();
            this.hurtAnimation = MathUtil.fast(this.hurtAnimation, this.entity.hurtTime > 0 ? 208.0F : 0.0F, 16.0F);
            this.second = MathUtil.fast(this.second, this.entity.hurtTime > 0 ? 77.0F : 0.0F, 16.0F);
            this.third = MathUtil.fast(this.third, this.entity.hurtTime > 0 ? 77.0F : 0.0F, 16.0F);
            float halfAnimationValueRest = (1.0F - animationValue) / 2.0F;
            GlStateManager.pushMatrix();
            Style style = Darkflow.getInstance().getStyleManager().getCurrentStyle();
            sizeAnimation((double)(posX + width / 2.0F), (double)(posY + height / 2.0F), this.animation.getOutput());
            KawaseBlur.blur.updateBlur(2,1);
            KawaseBlur.blur.render(()->{
                DisplayUtils.drawRoundedRect(posX + 37.0F, posY + 10.6f,  1.5F, 28.7F, new Vector4f(2.0F, 3.0F, 3.0F, 3.0F), (new Color(31, 31, 31, 140)).getRGB());
                DisplayUtils.drawRoundedRect(posX, posY + height / 6.0F, width, height / 1.0F, new Vector4f(9.0F, 10.0F, 9.0F, 9.0F), (new Color(25, 25, 25, 150)).getRGB());
            });
            DisplayUtils.drawRoundedRect(posX + 37.0F, posY + 10.6f,  1.5F, 29.7F, new Vector4f(2.0F, 3.0F, 3.0F, 3.0F), (new Vector4i(style.getFirstColor().getRGB(), style.getFirstColor().getRGB(), style.getSecondColor().getRGB(), style.getSecondColor().getRGB())));
            DisplayUtils.drawRoundedRect(posX, posY + height / 6.1F, width, height / 1.0F, new Vector4f(9.0F, 9.0F, 9.0F, 9.0F), (new Color(31, 30, 30, 150)).getRGB());

            DisplayUtils.drawRoundedRect(posX + 43.0F, posY + height / 1.41F + height / 4.0F - 2.0F, (width - 53.0F) * this.healthAnimation, 5.2F, new Vector4f(2.1F, 3.0F, 3.0F, 3.0F), new Vector4i(style.getFirstColor().getRGB(), style.getFirstColor().getRGB(), style.getSecondColor().getRGB(), style.getSecondColor().getRGB()));
            DisplayUtils.drawRoundedRect(posX + 43.0F, posY + height / 1.41F + height / 4.0F - 2.0F, (width - 53.0F) * this.absorptionAnimation, 5.2F, new Vector4f(2.0F, 2.0F, 2.0F, 2.0F), (new Color(255, 200, 0)).getRGB());
            DisplayUtils.drawRoundedRect(posX + 61.9F, posY + 22.8f,  0.5F, 8.4F, new Vector4f(1F, 1F, 1F, 1f), (new Color(255, 255, 255, 255)).getRGB());
            Scissor.push();
            Scissor.setFromComponentCoordinates((double)posX, (double)posY, (double)width, (double)height);
            Fonts.montserrat.drawText(eventDisplay.getMatrixStack() ,String.valueOf(Math.round(entity.getHealth())) + "HP ",posX + 43,posY + height / 2.3f - 8 + Fonts.sfbold.getHeight(15.4f) + 1,new Color(246, 244, 244).getRGB(),5.8f);
            Fonts.montserrat.drawText(eventDisplay.getMatrixStack(), this.entity.getName().getString(), posX + 44.0F, posY + height / 2.9F - 4.0F, -1, 7.1F);
            Scissor.pop();

            int anim = (int)this.hurtAnimation;
            int anim2 = (int)this.second;
            int anim3 = (int)this.third;
            drawTargetHead(entity,posX + 11.6F - 5.0F, posY + 17.4F - 5.0F, 26.5F, 26.5F);
            drawItemStack(posX + 63,posY + height / 4 - 8 + Fonts.sfbold.getHeight(12f) + 10,7.7f);
            GlStateManager.popMatrix();
        }

    }

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

        return (LivingEntity)target;
    }

        private void drawItemStack(float x, float y, float offset) {
        List<ItemStack> stacks = new ArrayList<>(Arrays.asList(entity.getHeldItemMainhand(), entity.getHeldItemOffhand()));
        entity.getArmorInventoryList().forEach(stacks::add);
        stacks.removeIf(w -> w.getItem() instanceof AirItem);
        Collections.reverse(stacks);
        final AtomicReference<Float> posX = new AtomicReference<>(x);

        stacks.stream()
                .filter(stack -> !stack.isEmpty())
                .forEach(stack -> DisplayUtils.drawItemStack(stack,
                        posX.getAndAccumulate(offset, Float::sum),
                        y,
                        true,
                        true, 0.5f));
    }

    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);
        }

    }

    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) {
        Style style = Darkflow.getInstance().getStyleManager().getCurrentStyle();
        DisplayUtils.drawRoundedRect(x, y, width, height, radius, ColorUtils.rgba(18, 18, 18, alpha));
    }

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

Код:
@FieldDefaults(level = AccessLevel.PRIVATE)
@RequiredArgsConstructor
public class VegaTargetHudRender implements ElementRenderer {
    private final StopWatch stopWatch = new StopWatch();
    private final Dragging drag;
    private LivingEntity entity = null;
    private boolean allow;
    private final Animation animation = new EaseBackIn(132, 1.0, 1.0F);
    private float healthAnimation = 0.0F;
    private float absorptionAnimation = 0.0F;
    private float hurtAnimation = 0.0F;
    private float second = 0.0F;
    private float third = 0.0F;

    public void render(EventDisplay eventDisplay) {
        this.entity = this.getTarget(this.entity);
        float rounding = 6.0F;
        boolean out = !this.allow || this.stopWatch.isReached(420L);
        this.animation.setDuration(out ? 400 : 300);
        this.animation.setDirection(out ? Direction.BACKWARDS : Direction.FORWARDS);
        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 = 36.0F;
            float spacing = 5.0F;
            float width = 111.0F;
            float height = 38.0F;
            this.drag.setWidth(width);
            this.drag.setHeight(height);
            float shrinking = 1.5F;
            Score score = mc.world.getScoreboard().getOrCreateScore(this.entity.getScoreboardName(), mc.world.getScoreboard().getObjectiveInDisplaySlot(2));
            float hp = this.entity.getHealth();
            float maxHp = this.entity.getMaxHealth();
            String header = mc.ingameGUI.getTabList().header == null ? " " : mc.ingameGUI.getTabList().header.getString().toLowerCase();
            if (mc.getCurrentServerData() != null && mc.getCurrentServerData().serverIP.contains("funtime") && (header.contains("анархия") || header.contains("гриферский")) && this.entity instanceof PlayerEntity) {
                hp = (float)score.getScorePoints();
                maxHp = 20.0F;
            }

            this.healthAnimation = MathUtil.fast(this.healthAnimation, MathHelper.clamp(hp / maxHp, 0.0F, 1.0F), 10.0F);
            this.absorptionAnimation = MathUtil.fast(this.absorptionAnimation, MathHelper.clamp(this.entity.getAbsorptionAmount() / maxHp, 0.0F, 1.0F), 10.0F);
            if (mc.getCurrentServerData() != null && mc.getCurrentServerData().serverIP.contains("funtime") && (header.contains("анархия") || header.contains("гриферский")) && this.entity instanceof PlayerEntity) {
                hp = (float)score.getScorePoints();
                maxHp = 20.0F;
            }

            float animationValue = (float)this.animation.getOutput();
            this.hurtAnimation = MathUtil.fast(this.hurtAnimation, this.entity.hurtTime > 0 ? 208.0F : 0.0F, 16.0F);
            this.second = MathUtil.fast(this.second, this.entity.hurtTime > 0 ? 77.0F : 0.0F, 16.0F);
            this.third = MathUtil.fast(this.third, this.entity.hurtTime > 0 ? 77.0F : 0.0F, 16.0F);
            float halfAnimationValueRest = (1.0F - animationValue) / 2.0F;
            GlStateManager.pushMatrix();
            Style style = Darkflow.getInstance().getStyleManager().getCurrentStyle();
            sizeAnimation((double)(posX + width / 2.0F), (double)(posY + height / 2.0F), this.animation.getOutput());
            KawaseBlur.blur.updateBlur(2,1);
            KawaseBlur.blur.render(()->{
                DisplayUtils.drawRoundedRect(posX + 37.0F, posY + 10.6f,  1.5F, 28.7F, new Vector4f(2.0F, 3.0F, 3.0F, 3.0F), (new Color(31, 31, 31, 140)).getRGB());
                DisplayUtils.drawRoundedRect(posX, posY + height / 6.0F, width, height / 1.0F, new Vector4f(9.0F, 10.0F, 9.0F, 9.0F), (new Color(25, 25, 25, 150)).getRGB());
            });
            DisplayUtils.drawRoundedRect(posX + 37.0F, posY + 10.6f,  1.5F, 29.7F, new Vector4f(2.0F, 3.0F, 3.0F, 3.0F), (new Vector4i(style.getFirstColor().getRGB(), style.getFirstColor().getRGB(), style.getSecondColor().getRGB(), style.getSecondColor().getRGB())));
            DisplayUtils.drawRoundedRect(posX, posY + height / 6.1F, width, height / 1.0F, new Vector4f(9.0F, 9.0F, 9.0F, 9.0F), (new Color(31, 30, 30, 150)).getRGB());

            DisplayUtils.drawRoundedRect(posX + 43.0F, posY + height / 1.41F + height / 4.0F - 2.0F, (width - 53.0F) * this.healthAnimation, 5.2F, new Vector4f(2.1F, 3.0F, 3.0F, 3.0F), new Vector4i(style.getFirstColor().getRGB(), style.getFirstColor().getRGB(), style.getSecondColor().getRGB(), style.getSecondColor().getRGB()));
            DisplayUtils.drawRoundedRect(posX + 43.0F, posY + height / 1.41F + height / 4.0F - 2.0F, (width - 53.0F) * this.absorptionAnimation, 5.2F, new Vector4f(2.0F, 2.0F, 2.0F, 2.0F), (new Color(255, 200, 0)).getRGB());
            DisplayUtils.drawRoundedRect(posX + 61.9F, posY + 22.8f,  0.5F, 8.4F, new Vector4f(1F, 1F, 1F, 1f), (new Color(255, 255, 255, 255)).getRGB());
            Scissor.push();
            Scissor.setFromComponentCoordinates((double)posX, (double)posY, (double)width, (double)height);
            Fonts.montserrat.drawText(eventDisplay.getMatrixStack() ,String.valueOf(Math.round(entity.getHealth())) + "HP ",posX + 43,posY + height / 2.3f - 8 + Fonts.sfbold.getHeight(15.4f) + 1,new Color(246, 244, 244).getRGB(),5.8f);
            Fonts.montserrat.drawText(eventDisplay.getMatrixStack(), this.entity.getName().getString(), posX + 44.0F, posY + height / 2.9F - 4.0F, -1, 7.1F);
            Scissor.pop();

            int anim = (int)this.hurtAnimation;
            int anim2 = (int)this.second;
            int anim3 = (int)this.third;
            drawTargetHead(entity,posX + 11.6F - 5.0F, posY + 17.4F - 5.0F, 26.5F, 26.5F);
            drawItemStack(posX + 63,posY + height / 4 - 8 + Fonts.sfbold.getHeight(12f) + 10,7.7f);
            GlStateManager.popMatrix();
        }

    }

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

        return (LivingEntity)target;
    }

        private void drawItemStack(float x, float y, float offset) {
        List<ItemStack> stacks = new ArrayList<>(Arrays.asList(entity.getHeldItemMainhand(), entity.getHeldItemOffhand()));
        entity.getArmorInventoryList().forEach(stacks::add);
        stacks.removeIf(w -> w.getItem() instanceof AirItem);
        Collections.reverse(stacks);
        final AtomicReference<Float> posX = new AtomicReference<>(x);

        stacks.stream()
                .filter(stack -> !stack.isEmpty())
                .forEach(stack -> DisplayUtils.drawItemStack(stack,
                        posX.getAndAccumulate(offset, Float::sum),
                        y,
                        true,
                        true, 0.5f));
    }

    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);
        }

    }

    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) {
        Style style = Darkflow.getInstance().getStyleManager().getCurrentStyle();
        DisplayUtils.drawRoundedRect(x, y, width, height, radius, ColorUtils.rgba(18, 18, 18, alpha));
    }

}
запоносил люто
 
Начинающий
Статус
Оффлайн
Регистрация
9 Апр 2023
Сообщения
35
Реакции[?]
0
Поинты[?]
0
Пожалуйста, авторизуйтесь для просмотра ссылки.

Код:
@FieldDefaults(level = AccessLevel.PRIVATE)
@RequiredArgsConstructor
public class VegaTargetHudRender implements ElementRenderer {
    private final StopWatch stopWatch = new StopWatch();
    private final Dragging drag;
    private LivingEntity entity = null;
    private boolean allow;
    private final Animation animation = new EaseBackIn(132, 1.0, 1.0F);
    private float healthAnimation = 0.0F;
    private float absorptionAnimation = 0.0F;
    private float hurtAnimation = 0.0F;
    private float second = 0.0F;
    private float third = 0.0F;

    public void render(EventDisplay eventDisplay) {
        this.entity = this.getTarget(this.entity);
        float rounding = 6.0F;
        boolean out = !this.allow || this.stopWatch.isReached(420L);
        this.animation.setDuration(out ? 400 : 300);
        this.animation.setDirection(out ? Direction.BACKWARDS : Direction.FORWARDS);
        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 = 36.0F;
            float spacing = 5.0F;
            float width = 111.0F;
            float height = 38.0F;
            this.drag.setWidth(width);
            this.drag.setHeight(height);
            float shrinking = 1.5F;
            Score score = mc.world.getScoreboard().getOrCreateScore(this.entity.getScoreboardName(), mc.world.getScoreboard().getObjectiveInDisplaySlot(2));
            float hp = this.entity.getHealth();
            float maxHp = this.entity.getMaxHealth();
            String header = mc.ingameGUI.getTabList().header == null ? " " : mc.ingameGUI.getTabList().header.getString().toLowerCase();
            if (mc.getCurrentServerData() != null && mc.getCurrentServerData().serverIP.contains("funtime") && (header.contains("анархия") || header.contains("гриферский")) && this.entity instanceof PlayerEntity) {
                hp = (float)score.getScorePoints();
                maxHp = 20.0F;
            }

            this.healthAnimation = MathUtil.fast(this.healthAnimation, MathHelper.clamp(hp / maxHp, 0.0F, 1.0F), 10.0F);
            this.absorptionAnimation = MathUtil.fast(this.absorptionAnimation, MathHelper.clamp(this.entity.getAbsorptionAmount() / maxHp, 0.0F, 1.0F), 10.0F);
            if (mc.getCurrentServerData() != null && mc.getCurrentServerData().serverIP.contains("funtime") && (header.contains("анархия") || header.contains("гриферский")) && this.entity instanceof PlayerEntity) {
                hp = (float)score.getScorePoints();
                maxHp = 20.0F;
            }

            float animationValue = (float)this.animation.getOutput();
            this.hurtAnimation = MathUtil.fast(this.hurtAnimation, this.entity.hurtTime > 0 ? 208.0F : 0.0F, 16.0F);
            this.second = MathUtil.fast(this.second, this.entity.hurtTime > 0 ? 77.0F : 0.0F, 16.0F);
            this.third = MathUtil.fast(this.third, this.entity.hurtTime > 0 ? 77.0F : 0.0F, 16.0F);
            float halfAnimationValueRest = (1.0F - animationValue) / 2.0F;
            GlStateManager.pushMatrix();
            Style style = Darkflow.getInstance().getStyleManager().getCurrentStyle();
            sizeAnimation((double)(posX + width / 2.0F), (double)(posY + height / 2.0F), this.animation.getOutput());
            KawaseBlur.blur.updateBlur(2,1);
            KawaseBlur.blur.render(()->{
                DisplayUtils.drawRoundedRect(posX + 37.0F, posY + 10.6f,  1.5F, 28.7F, new Vector4f(2.0F, 3.0F, 3.0F, 3.0F), (new Color(31, 31, 31, 140)).getRGB());
                DisplayUtils.drawRoundedRect(posX, posY + height / 6.0F, width, height / 1.0F, new Vector4f(9.0F, 10.0F, 9.0F, 9.0F), (new Color(25, 25, 25, 150)).getRGB());
            });
            DisplayUtils.drawRoundedRect(posX + 37.0F, posY + 10.6f,  1.5F, 29.7F, new Vector4f(2.0F, 3.0F, 3.0F, 3.0F), (new Vector4i(style.getFirstColor().getRGB(), style.getFirstColor().getRGB(), style.getSecondColor().getRGB(), style.getSecondColor().getRGB())));
            DisplayUtils.drawRoundedRect(posX, posY + height / 6.1F, width, height / 1.0F, new Vector4f(9.0F, 9.0F, 9.0F, 9.0F), (new Color(31, 30, 30, 150)).getRGB());

            DisplayUtils.drawRoundedRect(posX + 43.0F, posY + height / 1.41F + height / 4.0F - 2.0F, (width - 53.0F) * this.healthAnimation, 5.2F, new Vector4f(2.1F, 3.0F, 3.0F, 3.0F), new Vector4i(style.getFirstColor().getRGB(), style.getFirstColor().getRGB(), style.getSecondColor().getRGB(), style.getSecondColor().getRGB()));
            DisplayUtils.drawRoundedRect(posX + 43.0F, posY + height / 1.41F + height / 4.0F - 2.0F, (width - 53.0F) * this.absorptionAnimation, 5.2F, new Vector4f(2.0F, 2.0F, 2.0F, 2.0F), (new Color(255, 200, 0)).getRGB());
            DisplayUtils.drawRoundedRect(posX + 61.9F, posY + 22.8f,  0.5F, 8.4F, new Vector4f(1F, 1F, 1F, 1f), (new Color(255, 255, 255, 255)).getRGB());
            Scissor.push();
            Scissor.setFromComponentCoordinates((double)posX, (double)posY, (double)width, (double)height);
            Fonts.montserrat.drawText(eventDisplay.getMatrixStack() ,String.valueOf(Math.round(entity.getHealth())) + "HP ",posX + 43,posY + height / 2.3f - 8 + Fonts.sfbold.getHeight(15.4f) + 1,new Color(246, 244, 244).getRGB(),5.8f);
            Fonts.montserrat.drawText(eventDisplay.getMatrixStack(), this.entity.getName().getString(), posX + 44.0F, posY + height / 2.9F - 4.0F, -1, 7.1F);
            Scissor.pop();

            int anim = (int)this.hurtAnimation;
            int anim2 = (int)this.second;
            int anim3 = (int)this.third;
            drawTargetHead(entity,posX + 11.6F - 5.0F, posY + 17.4F - 5.0F, 26.5F, 26.5F);
            drawItemStack(posX + 63,posY + height / 4 - 8 + Fonts.sfbold.getHeight(12f) + 10,7.7f);
            GlStateManager.popMatrix();
        }

    }

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

        return (LivingEntity)target;
    }

        private void drawItemStack(float x, float y, float offset) {
        List<ItemStack> stacks = new ArrayList<>(Arrays.asList(entity.getHeldItemMainhand(), entity.getHeldItemOffhand()));
        entity.getArmorInventoryList().forEach(stacks::add);
        stacks.removeIf(w -> w.getItem() instanceof AirItem);
        Collections.reverse(stacks);
        final AtomicReference<Float> posX = new AtomicReference<>(x);

        stacks.stream()
                .filter(stack -> !stack.isEmpty())
                .forEach(stack -> DisplayUtils.drawItemStack(stack,
                        posX.getAndAccumulate(offset, Float::sum),
                        y,
                        true,
                        true, 0.5f));
    }

    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);
        }

    }

    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) {
        Style style = Darkflow.getInstance().getStyleManager().getCurrentStyle();
        DisplayUtils.drawRoundedRect(x, y, width, height, radius, ColorUtils.rgba(18, 18, 18, alpha));
    }

}
ЩОЫАЩШЖПРВФШАРПШОЫОШАПОЫФВЩАЗЪщывфзхащфзхыващхзфывщазхщфыЫЩЗВАЩЗФАЛОШФЩЗВЫАОЩФЫВОАФЫВОАФЫВОАЩШОООООООООООООООООООООООООООООООООООООООООО АХ АХ АХ
 
Сверху Снизу