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

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

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

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

Спасибо!

Салют югейм, сливаю вам TargetHUD похожий на Nursultan (noad), есть закругление бошки и фикс хп под фт, сразу скажу
Закругление бошки там с какой то темы взял
SS: Прикреплён снизу
TargetHUD нурика: Прикреплён снизу (взял с ролика академика)
Код TargetHUD'а
targethud:
Expand Collapse Copy
package vesence.dlc.ui.hud.elements;

import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.entity.player.AbstractClientPlayerEntity;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.merchant.IMerchant;
import vesence.dlc.MainVesence;
import vesence.dlc.events.EventDisplay;
import vesence.dlc.modules.api.ModuleRegistry;
import vesence.dlc.modules.impl.render.InterFace;
import vesence.dlc.modules.impl.render.Theme;
import vesence.dlc.ui.hud.hudRender;
import vesence.dlc.ui.styles.Style;
import vesence.dlc.utils.animations.Animation;
import vesence.dlc.utils.animations.Direction;
import vesence.dlc.utils.animations.impl.EaseInOutQuad;
import vesence.dlc.utils.animations.impl.SmoothStepAnimation;
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.*;
import vesence.dlc.utils.render.font.Fonts;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.experimental.FieldDefaults;
import net.minecraft.client.gui.AbstractGui;
import net.minecraft.client.gui.screen.ChatScreen;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
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;

import static vesence.dlc.utils.shader.ShaderUtil.head;

@FieldDefaults(level = AccessLevel.PRIVATE)
@RequiredArgsConstructor
public class targetHudRender implements hudRender {
    final StopWatch stopWatch = new StopWatch();
    final Dragging drag;
    LivingEntity entity = null;
    boolean allow;
    final Animation animation = new SmoothStepAnimation(400, 1);
    float healthAnimation = 0.0f;
    float absorptionAnimation = 0.0f;

    [USER=1367676]@override[/USER]
    public void render(EventDisplay eventDisplay) {
        entity = getTarget(entity);

        float rounding = 6;
        boolean out = !allow || stopWatch.isReached(1000);
        animation.setDuration(out ? 400 : 300);
        animation.setDirection(out ? Direction.BACKWARDS : Direction.FORWARDS);

        if (animation.getOutput() == 0.0f) {
            entity = null;
        }

        if (entity != null) {
            String name = entity.getName().getString();

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

            float headSize = 28;
            float spacing = 5;

            float width = 160 / 1.5f;
            float height = 59 / 1.5f;
            drag.setWidth(width);
            drag.setHeight(height);
            float shrinking = 1.5f;
            Score score = mc.world.getScoreboard().getOrCreateScore(entity.getScoreboardName(), mc.world.getScoreboard().getObjectiveInDisplaySlot(2));


            float hp = entity.getHealth();
            float maxHp = 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("гриферский")) && entity instanceof PlayerEntity) {
                hp = score.getScorePoints();
                maxHp = 20;
            }
            healthAnimation = MathUtil.fast(healthAnimation, MathHelper.clamp(hp / maxHp, 0, 1), 10);
            absorptionAnimation = MathUtil.fast(absorptionAnimation, MathHelper.clamp(entity.getAbsorptionAmount() / maxHp, 0, 1), 10);


            if (mc.getCurrentServerData() != null && mc.getCurrentServerData().serverIP.contains("funtime")
                    && (header.contains("анархия") || header.contains("гриферский")) && entity instanceof PlayerEntity) {
                hp = score.getScorePoints();
                maxHp = 20;
            }


            float animationValue = (float) animation.getOutput();

            float halfAnimationValueRest = (1 - animationValue) / 2f;

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

            GlStateManager.pushMatrix();

            sizeAnimation(posX + (width / 2), posY + (height / 2), animation.getOutput());
            drawStyledRect(posX, posY, width, height);
            float hurtPercent = (entity.hurtTime - (entity.hurtTime != 0 ? mc.timer.renderPartialTicks : 0.0f)) / 10.0f;
            String rs = EntityType.getKey(((Entity) entity).getType()).getPath();
            ResourceLocation skin = entity instanceof AbstractClientPlayerEntity e ? (e).getLocationSkin() : new ResourceLocation("textures/entity/" + rs + ".png");
            drawHead(skin, posX + 1, posY + 2, headSize + 4, headSize + 4, 3, 1, hurtPercent);
            Scissor.push();
            Scissor.setFromComponentCoordinates(testX, testY, testW - 6, testH);
            Fonts.font123.drawText(eventDisplay.getMatrixStack(), entity.getName().getString(), posX - 0.5f + headSize + spacing + spacing, posY - 1 + spacing + 1, -1, 9);
            Fonts.font123.drawText(eventDisplay.getMatrixStack(), "HP: " + ((int) hp + (int) mc.player.getAbsorptionAmount()), posX  + headSize + spacing + spacing,
                    posY + 1 + spacing + 1 + spacing + spacing, ColorUtils.rgba(255, 255, 255, 255), 8);
            Scissor.unset();
            Scissor.pop();

            DisplayUtils.drawRoundedRect(posX  + headSize + spacing + spacing, posY + 2 + height - spacing * 2 - 3, (width - 42) * healthAnimation, 6, new Vector4f(3, 3, 3, 3), Theme.getColor(0));
            DisplayUtils.drawRoundedRect(posX + headSize + spacing + spacing, posY + 2 + height - spacing * 2 - 3, (width - 42) * healthAnimation, 6, new Vector4f(3, 3, 3, 3), new Vector4i(ColorUtils.rgba(0, 0, 0, 165), ColorUtils.rgba(0, 0, 0, 165), ColorUtils.rgba(0, 0, 0, 0), ColorUtils.rgba(0, 0, 0, 0)));

            GlStateManager.popMatrix();
        }
    }


    private LivingEntity getTarget(LivingEntity nullTarget) {
        LivingEntity auraTarget = MainVesence.getInstance().getFunctionRegistry().getKillAura().getTarget();
        LivingEntity target = nullTarget;
        if (auraTarget != null) {
            stopWatch.reset();
            allow = true;
            target = auraTarget;
        } else if (mc.currentScreen instanceof ChatScreen) {
            stopWatch.reset();
            allow = true;
            target = mc.player;
        } else {
            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);
            drawFace(rendererManager.getEntityTexture(entity), x, y, 8F, 8F, 8F, 8F, width, height, 64F, 64F, entity);
        }
    }

    public static void sizeAnimation(double width, double height, double scale) {
        GlStateManager.translated(width, height, 0);
        GlStateManager.scaled(scale, scale, scale);
        GlStateManager.translated(-width, -height, 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(GL11.GL_BLEND);
        mc.getTextureManager().bindTexture(res);
        float hurtPercent = (target.hurtTime - (target.hurtTime != 0 ? mc.timer.renderPartialTicks : 0.0f)) / 10.0f;
        GL11.glColor4f(1, 1 - hurtPercent, 1 - hurtPercent, 1);
        AbstractGui.drawScaledCustomSizeModalRect(d, y, u, v, uWidth, vHeight, width, height, tileWidth, tileHeight);
        GL11.glColor4f(1, 1, 1, 1);
        GL11.glPopMatrix();
    }

    public static void drawHead(ResourceLocation skin, float x, float y, float width, float height, float radius, float alpha, float hurtPercent) {
        mc.getTextureManager().bindTexture(skin); // биндим текстуру головы игрока
        RenderSystem.pushMatrix();
        RenderSystem.enableBlend();
        head.attach();
        head.setUniformf("size", width, height);
        head.setUniformf("radius", radius);
        head.setUniformf("hurt_time", hurtPercent);
        head.setUniformf("alpha", alpha);

        head.setUniformf("startX", 4);
        head.setUniformf("startY", 4);

        head.setUniformf("endX", 8);
        head.setUniformf("endY", 8);

        head.setUniformf("texXSize", 32);
        head.setUniformf("texYSize", 32);
        head.drawQuads(x + 2, y + 2, width, height);
        head.detach();
        RenderSystem.disableBlend();
        RenderSystem.popMatrix();
    }

    private void drawStyledRect(float x, float y, float width, float height) {
        ModuleRegistry moduleRegistry = MainVesence.getInstance().getFunctionRegistry();
        InterFace interFace = moduleRegistry.getInterFace();
        if(interFace.blur.get()) {
            GaussianBlur.startBlur();
            DisplayUtils.drawRoundedRect(x, y, width, height, 5, ColorUtils.rgba(0, 0, 0, 0));
            GaussianBlur.endBlur(5,2);
            DisplayUtils.drawRoundedRect(x, y, width, height, 5, ColorUtils.rgba(0, 0, 0, 155));
        } else {
            DisplayUtils.drawRoundedRect(x, y, width, height, 5, ColorUtils.rgba(0, 0, 0, 155));
        }
    }
}
Блюр спастите от куда-нибудь, моё дело дать а как вы пастить будете я не ебу, и не надо мне писать /del импорты не 3.1
Также тут присутствует FixHP под FunTime
 

Вложения

  • 1747071414807.png
    1747071414807.png
    21.6 KB · Просмотры: 624
  • 1747071527398.png
    1747071527398.png
    17.5 KB · Просмотры: 583
Салют югейм, сливаю вам TargetHUD похожий на Nursultan (noad), есть закругление бошки и фикс хп под фт, сразу скажу
Закругление бошки там с какой то темы взял
SS: Прикреплён снизу
TargetHUD нурика: Прикреплён снизу (взял с ролика академика)
Код TargetHUD'а
targethud:
Expand Collapse Copy
package vesence.dlc.ui.hud.elements;

import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.entity.player.AbstractClientPlayerEntity;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.merchant.IMerchant;
import vesence.dlc.MainVesence;
import vesence.dlc.events.EventDisplay;
import vesence.dlc.modules.api.ModuleRegistry;
import vesence.dlc.modules.impl.render.InterFace;
import vesence.dlc.modules.impl.render.Theme;
import vesence.dlc.ui.hud.hudRender;
import vesence.dlc.ui.styles.Style;
import vesence.dlc.utils.animations.Animation;
import vesence.dlc.utils.animations.Direction;
import vesence.dlc.utils.animations.impl.EaseInOutQuad;
import vesence.dlc.utils.animations.impl.SmoothStepAnimation;
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.*;
import vesence.dlc.utils.render.font.Fonts;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.experimental.FieldDefaults;
import net.minecraft.client.gui.AbstractGui;
import net.minecraft.client.gui.screen.ChatScreen;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
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;

import static vesence.dlc.utils.shader.ShaderUtil.head;

@FieldDefaults(level = AccessLevel.PRIVATE)
@RequiredArgsConstructor
public class targetHudRender implements hudRender {
    final StopWatch stopWatch = new StopWatch();
    final Dragging drag;
    LivingEntity entity = null;
    boolean allow;
    final Animation animation = new SmoothStepAnimation(400, 1);
    float healthAnimation = 0.0f;
    float absorptionAnimation = 0.0f;

    [USER=1367676]@override[/USER]
    public void render(EventDisplay eventDisplay) {
        entity = getTarget(entity);

        float rounding = 6;
        boolean out = !allow || stopWatch.isReached(1000);
        animation.setDuration(out ? 400 : 300);
        animation.setDirection(out ? Direction.BACKWARDS : Direction.FORWARDS);

        if (animation.getOutput() == 0.0f) {
            entity = null;
        }

        if (entity != null) {
            String name = entity.getName().getString();

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

            float headSize = 28;
            float spacing = 5;

            float width = 160 / 1.5f;
            float height = 59 / 1.5f;
            drag.setWidth(width);
            drag.setHeight(height);
            float shrinking = 1.5f;
            Score score = mc.world.getScoreboard().getOrCreateScore(entity.getScoreboardName(), mc.world.getScoreboard().getObjectiveInDisplaySlot(2));


            float hp = entity.getHealth();
            float maxHp = 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("гриферский")) && entity instanceof PlayerEntity) {
                hp = score.getScorePoints();
                maxHp = 20;
            }
            healthAnimation = MathUtil.fast(healthAnimation, MathHelper.clamp(hp / maxHp, 0, 1), 10);
            absorptionAnimation = MathUtil.fast(absorptionAnimation, MathHelper.clamp(entity.getAbsorptionAmount() / maxHp, 0, 1), 10);


            if (mc.getCurrentServerData() != null && mc.getCurrentServerData().serverIP.contains("funtime")
                    && (header.contains("анархия") || header.contains("гриферский")) && entity instanceof PlayerEntity) {
                hp = score.getScorePoints();
                maxHp = 20;
            }


            float animationValue = (float) animation.getOutput();

            float halfAnimationValueRest = (1 - animationValue) / 2f;

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

            GlStateManager.pushMatrix();

            sizeAnimation(posX + (width / 2), posY + (height / 2), animation.getOutput());
            drawStyledRect(posX, posY, width, height);
            float hurtPercent = (entity.hurtTime - (entity.hurtTime != 0 ? mc.timer.renderPartialTicks : 0.0f)) / 10.0f;
            String rs = EntityType.getKey(((Entity) entity).getType()).getPath();
            ResourceLocation skin = entity instanceof AbstractClientPlayerEntity e ? (e).getLocationSkin() : new ResourceLocation("textures/entity/" + rs + ".png");
            drawHead(skin, posX + 1, posY + 2, headSize + 4, headSize + 4, 3, 1, hurtPercent);
            Scissor.push();
            Scissor.setFromComponentCoordinates(testX, testY, testW - 6, testH);
            Fonts.font123.drawText(eventDisplay.getMatrixStack(), entity.getName().getString(), posX - 0.5f + headSize + spacing + spacing, posY - 1 + spacing + 1, -1, 9);
            Fonts.font123.drawText(eventDisplay.getMatrixStack(), "HP: " + ((int) hp + (int) mc.player.getAbsorptionAmount()), posX  + headSize + spacing + spacing,
                    posY + 1 + spacing + 1 + spacing + spacing, ColorUtils.rgba(255, 255, 255, 255), 8);
            Scissor.unset();
            Scissor.pop();

            DisplayUtils.drawRoundedRect(posX  + headSize + spacing + spacing, posY + 2 + height - spacing * 2 - 3, (width - 42) * healthAnimation, 6, new Vector4f(3, 3, 3, 3), Theme.getColor(0));
            DisplayUtils.drawRoundedRect(posX + headSize + spacing + spacing, posY + 2 + height - spacing * 2 - 3, (width - 42) * healthAnimation, 6, new Vector4f(3, 3, 3, 3), new Vector4i(ColorUtils.rgba(0, 0, 0, 165), ColorUtils.rgba(0, 0, 0, 165), ColorUtils.rgba(0, 0, 0, 0), ColorUtils.rgba(0, 0, 0, 0)));

            GlStateManager.popMatrix();
        }
    }


    private LivingEntity getTarget(LivingEntity nullTarget) {
        LivingEntity auraTarget = MainVesence.getInstance().getFunctionRegistry().getKillAura().getTarget();
        LivingEntity target = nullTarget;
        if (auraTarget != null) {
            stopWatch.reset();
            allow = true;
            target = auraTarget;
        } else if (mc.currentScreen instanceof ChatScreen) {
            stopWatch.reset();
            allow = true;
            target = mc.player;
        } else {
            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);
            drawFace(rendererManager.getEntityTexture(entity), x, y, 8F, 8F, 8F, 8F, width, height, 64F, 64F, entity);
        }
    }

    public static void sizeAnimation(double width, double height, double scale) {
        GlStateManager.translated(width, height, 0);
        GlStateManager.scaled(scale, scale, scale);
        GlStateManager.translated(-width, -height, 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(GL11.GL_BLEND);
        mc.getTextureManager().bindTexture(res);
        float hurtPercent = (target.hurtTime - (target.hurtTime != 0 ? mc.timer.renderPartialTicks : 0.0f)) / 10.0f;
        GL11.glColor4f(1, 1 - hurtPercent, 1 - hurtPercent, 1);
        AbstractGui.drawScaledCustomSizeModalRect(d, y, u, v, uWidth, vHeight, width, height, tileWidth, tileHeight);
        GL11.glColor4f(1, 1, 1, 1);
        GL11.glPopMatrix();
    }

    public static void drawHead(ResourceLocation skin, float x, float y, float width, float height, float radius, float alpha, float hurtPercent) {
        mc.getTextureManager().bindTexture(skin); // биндим текстуру головы игрока
        RenderSystem.pushMatrix();
        RenderSystem.enableBlend();
        head.attach();
        head.setUniformf("size", width, height);
        head.setUniformf("radius", radius);
        head.setUniformf("hurt_time", hurtPercent);
        head.setUniformf("alpha", alpha);

        head.setUniformf("startX", 4);
        head.setUniformf("startY", 4);

        head.setUniformf("endX", 8);
        head.setUniformf("endY", 8);

        head.setUniformf("texXSize", 32);
        head.setUniformf("texYSize", 32);
        head.drawQuads(x + 2, y + 2, width, height);
        head.detach();
        RenderSystem.disableBlend();
        RenderSystem.popMatrix();
    }

    private void drawStyledRect(float x, float y, float width, float height) {
        ModuleRegistry moduleRegistry = MainVesence.getInstance().getFunctionRegistry();
        InterFace interFace = moduleRegistry.getInterFace();
        if(interFace.blur.get()) {
            GaussianBlur.startBlur();
            DisplayUtils.drawRoundedRect(x, y, width, height, 5, ColorUtils.rgba(0, 0, 0, 0));
            GaussianBlur.endBlur(5,2);
            DisplayUtils.drawRoundedRect(x, y, width, height, 5, ColorUtils.rgba(0, 0, 0, 155));
        } else {
            DisplayUtils.drawRoundedRect(x, y, width, height, 5, ColorUtils.rgba(0, 0, 0, 155));
        }
    }
}
Блюр спастите от куда-нибудь, моё дело дать а как вы пастить будете я не ебу, и не надо мне писать /del импорты не 3.1
Также тут присутствует FixHP под FunTime
кайф
 
в дике лучше
 
пока что лучший скид на нурик
 
вы уже заебали с нуриком
но красиво
 
Салют югейм, сливаю вам TargetHUD похожий на Nursultan (noad), есть закругление бошки и фикс хп под фт, сразу скажу
Закругление бошки там с какой то темы взял
SS: Прикреплён снизу
TargetHUD нурика: Прикреплён снизу (взял с ролика академика)
Код TargetHUD'а
targethud:
Expand Collapse Copy
package vesence.dlc.ui.hud.elements;

import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.entity.player.AbstractClientPlayerEntity;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.merchant.IMerchant;
import vesence.dlc.MainVesence;
import vesence.dlc.events.EventDisplay;
import vesence.dlc.modules.api.ModuleRegistry;
import vesence.dlc.modules.impl.render.InterFace;
import vesence.dlc.modules.impl.render.Theme;
import vesence.dlc.ui.hud.hudRender;
import vesence.dlc.ui.styles.Style;
import vesence.dlc.utils.animations.Animation;
import vesence.dlc.utils.animations.Direction;
import vesence.dlc.utils.animations.impl.EaseInOutQuad;
import vesence.dlc.utils.animations.impl.SmoothStepAnimation;
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.*;
import vesence.dlc.utils.render.font.Fonts;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.experimental.FieldDefaults;
import net.minecraft.client.gui.AbstractGui;
import net.minecraft.client.gui.screen.ChatScreen;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
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;

import static vesence.dlc.utils.shader.ShaderUtil.head;

@FieldDefaults(level = AccessLevel.PRIVATE)
@RequiredArgsConstructor
public class targetHudRender implements hudRender {
    final StopWatch stopWatch = new StopWatch();
    final Dragging drag;
    LivingEntity entity = null;
    boolean allow;
    final Animation animation = new SmoothStepAnimation(400, 1);
    float healthAnimation = 0.0f;
    float absorptionAnimation = 0.0f;

    [USER=1367676]@override[/USER]
    public void render(EventDisplay eventDisplay) {
        entity = getTarget(entity);

        float rounding = 6;
        boolean out = !allow || stopWatch.isReached(1000);
        animation.setDuration(out ? 400 : 300);
        animation.setDirection(out ? Direction.BACKWARDS : Direction.FORWARDS);

        if (animation.getOutput() == 0.0f) {
            entity = null;
        }

        if (entity != null) {
            String name = entity.getName().getString();

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

            float headSize = 28;
            float spacing = 5;

            float width = 160 / 1.5f;
            float height = 59 / 1.5f;
            drag.setWidth(width);
            drag.setHeight(height);
            float shrinking = 1.5f;
            Score score = mc.world.getScoreboard().getOrCreateScore(entity.getScoreboardName(), mc.world.getScoreboard().getObjectiveInDisplaySlot(2));


            float hp = entity.getHealth();
            float maxHp = 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("гриферский")) && entity instanceof PlayerEntity) {
                hp = score.getScorePoints();
                maxHp = 20;
            }
            healthAnimation = MathUtil.fast(healthAnimation, MathHelper.clamp(hp / maxHp, 0, 1), 10);
            absorptionAnimation = MathUtil.fast(absorptionAnimation, MathHelper.clamp(entity.getAbsorptionAmount() / maxHp, 0, 1), 10);


            if (mc.getCurrentServerData() != null && mc.getCurrentServerData().serverIP.contains("funtime")
                    && (header.contains("анархия") || header.contains("гриферский")) && entity instanceof PlayerEntity) {
                hp = score.getScorePoints();
                maxHp = 20;
            }


            float animationValue = (float) animation.getOutput();

            float halfAnimationValueRest = (1 - animationValue) / 2f;

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

            GlStateManager.pushMatrix();

            sizeAnimation(posX + (width / 2), posY + (height / 2), animation.getOutput());
            drawStyledRect(posX, posY, width, height);
            float hurtPercent = (entity.hurtTime - (entity.hurtTime != 0 ? mc.timer.renderPartialTicks : 0.0f)) / 10.0f;
            String rs = EntityType.getKey(((Entity) entity).getType()).getPath();
            ResourceLocation skin = entity instanceof AbstractClientPlayerEntity e ? (e).getLocationSkin() : new ResourceLocation("textures/entity/" + rs + ".png");
            drawHead(skin, posX + 1, posY + 2, headSize + 4, headSize + 4, 3, 1, hurtPercent);
            Scissor.push();
            Scissor.setFromComponentCoordinates(testX, testY, testW - 6, testH);
            Fonts.font123.drawText(eventDisplay.getMatrixStack(), entity.getName().getString(), posX - 0.5f + headSize + spacing + spacing, posY - 1 + spacing + 1, -1, 9);
            Fonts.font123.drawText(eventDisplay.getMatrixStack(), "HP: " + ((int) hp + (int) mc.player.getAbsorptionAmount()), posX  + headSize + spacing + spacing,
                    posY + 1 + spacing + 1 + spacing + spacing, ColorUtils.rgba(255, 255, 255, 255), 8);
            Scissor.unset();
            Scissor.pop();

            DisplayUtils.drawRoundedRect(posX  + headSize + spacing + spacing, posY + 2 + height - spacing * 2 - 3, (width - 42) * healthAnimation, 6, new Vector4f(3, 3, 3, 3), Theme.getColor(0));
            DisplayUtils.drawRoundedRect(posX + headSize + spacing + spacing, posY + 2 + height - spacing * 2 - 3, (width - 42) * healthAnimation, 6, new Vector4f(3, 3, 3, 3), new Vector4i(ColorUtils.rgba(0, 0, 0, 165), ColorUtils.rgba(0, 0, 0, 165), ColorUtils.rgba(0, 0, 0, 0), ColorUtils.rgba(0, 0, 0, 0)));

            GlStateManager.popMatrix();
        }
    }


    private LivingEntity getTarget(LivingEntity nullTarget) {
        LivingEntity auraTarget = MainVesence.getInstance().getFunctionRegistry().getKillAura().getTarget();
        LivingEntity target = nullTarget;
        if (auraTarget != null) {
            stopWatch.reset();
            allow = true;
            target = auraTarget;
        } else if (mc.currentScreen instanceof ChatScreen) {
            stopWatch.reset();
            allow = true;
            target = mc.player;
        } else {
            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);
            drawFace(rendererManager.getEntityTexture(entity), x, y, 8F, 8F, 8F, 8F, width, height, 64F, 64F, entity);
        }
    }

    public static void sizeAnimation(double width, double height, double scale) {
        GlStateManager.translated(width, height, 0);
        GlStateManager.scaled(scale, scale, scale);
        GlStateManager.translated(-width, -height, 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(GL11.GL_BLEND);
        mc.getTextureManager().bindTexture(res);
        float hurtPercent = (target.hurtTime - (target.hurtTime != 0 ? mc.timer.renderPartialTicks : 0.0f)) / 10.0f;
        GL11.glColor4f(1, 1 - hurtPercent, 1 - hurtPercent, 1);
        AbstractGui.drawScaledCustomSizeModalRect(d, y, u, v, uWidth, vHeight, width, height, tileWidth, tileHeight);
        GL11.glColor4f(1, 1, 1, 1);
        GL11.glPopMatrix();
    }

    public static void drawHead(ResourceLocation skin, float x, float y, float width, float height, float radius, float alpha, float hurtPercent) {
        mc.getTextureManager().bindTexture(skin); // биндим текстуру головы игрока
        RenderSystem.pushMatrix();
        RenderSystem.enableBlend();
        head.attach();
        head.setUniformf("size", width, height);
        head.setUniformf("radius", radius);
        head.setUniformf("hurt_time", hurtPercent);
        head.setUniformf("alpha", alpha);

        head.setUniformf("startX", 4);
        head.setUniformf("startY", 4);

        head.setUniformf("endX", 8);
        head.setUniformf("endY", 8);

        head.setUniformf("texXSize", 32);
        head.setUniformf("texYSize", 32);
        head.drawQuads(x + 2, y + 2, width, height);
        head.detach();
        RenderSystem.disableBlend();
        RenderSystem.popMatrix();
    }

    private void drawStyledRect(float x, float y, float width, float height) {
        ModuleRegistry moduleRegistry = MainVesence.getInstance().getFunctionRegistry();
        InterFace interFace = moduleRegistry.getInterFace();
        if(interFace.blur.get()) {
            GaussianBlur.startBlur();
            DisplayUtils.drawRoundedRect(x, y, width, height, 5, ColorUtils.rgba(0, 0, 0, 0));
            GaussianBlur.endBlur(5,2);
            DisplayUtils.drawRoundedRect(x, y, width, height, 5, ColorUtils.rgba(0, 0, 0, 155));
        } else {
            DisplayUtils.drawRoundedRect(x, y, width, height, 5, ColorUtils.rgba(0, 0, 0, 155));
        }
    }
}
Блюр спастите от куда-нибудь, моё дело дать а как вы пастить будете я не ебу, и не надо мне писать /del импорты не 3.1
Также тут присутствует FixHP под FunTime
похоже, +rep. Жду когда оффи оценит оценит
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Нахуй 10 одинаковых тем делать
 
Назад
Сверху Снизу