Исходник TargetESP/TargetHUD при наводке | Exp 3.1

Начинающий
Статус
Оффлайн
Регистрация
24 Ноя 2023
Сообщения
12
Реакции[?]
0
Поинты[?]
0
Хотел чото визуальное сделать(без киллки без всего) и сделал такое, для легит игроков один минус - наводится на типов в инвизе, а так можете доделать с использованием киллки(тупо вставить мой код к своему методу)
Попытка залить номер 2 потому что модеры отклонили тему из за того что нет скрина для даже НЕ ВИЗУАЛЬНОЙ работы
SS =
Вставляете код в метод getTarget в TargetESP

TargetESP:
private LivingEntity getTarget(LivingEntity nullTarget) {
        RayTraceResult rayTraceResult = mc.objectMouseOver;
        LivingEntity newTarget = nullTarget;

        if (rayTraceResult != null && rayTraceResult.getType() == RayTraceResult.Type.ENTITY) {
            Entity entityHit = ((EntityRayTraceResult) rayTraceResult).getEntity();
            if (entityHit instanceof LivingEntity) {
                newTarget = (LivingEntity) entityHit;
                if (target != newTarget) {
                    target = newTarget;
                    stopWatch.reset();
                    allow = true;
                }
            }
        }
        else if (target != null && stopWatch.getElapsedTime() <= 3000) {
            double distanceToTarget = mc.player.getDistance(target);
            if (distanceToTarget <= 4) {
                newTarget = target;
            } else {
                target = null;
                allow = false;
            }
        }
        else if (stopWatch.getElapsedTime() > 3000) {
            target = null;
            allow = false;
        }
        else if (mc.currentScreen instanceof ChatScreen) {
            newTarget = mc.player;
            stopWatch.reset();
            allow = true;
        } else {
            target = null;
            allow = false;
        }

        return newTarget;
    }
В ваш таргет-худ в методе getTarget вставляете
TargetHUD:
private LivingEntity getTarget(LivingEntity currentTarget) {
        RayTraceResult rayTraceResult = mc.objectMouseOver;
        LivingEntity target = currentTarget;
      
        if (rayTraceResult != null && rayTraceResult.getType() == RayTraceResult.Type.ENTITY) {
            Entity entityHit = ((EntityRayTraceResult) rayTraceResult).getEntity();
            if (entityHit instanceof LivingEntity) {
                LivingEntity potentialTarget = (LivingEntity) entityHit;
              
                double distanceToTarget = mc.player.getDistance(potentialTarget);
                if (distanceToTarget <= 4.0) {
                    target = potentialTarget;
                    stopWatch.reset();
                    allow = true;
                } else {
                    allow = false;
                }
            }
        } else if (mc.currentScreen instanceof ChatScreen) {
            target = mc.player;
            stopWatch.reset();
            allow = true;
        } else if (stopWatch.isReached(4000)) {
            target = null;
            allow = false;
        }
        return target;
    }
При открытии чата в обоих методах таргет будет установлен на Вас в независимости от наводки, таргет пропадает если вы отходите за 4+ блока или не аимитесь на игрока 3-4 секунды
Я убирал нерабочий функционал скрытия таргета при инвизе у игрока, по этому могут быть баги, жду их под темой если есть
Хелп куда вставлять TargetESP

package im.Qwc.functions.impl.render;

import com.google.common.eventbus.Subscribe;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
import im.Qwc.events.EventDisplay;
import im.Qwc.events.WorldEvent;
import im.Qwc.functions.api.Category;
import im.Qwc.functions.api.Function;
import im.Qwc.functions.api.FunctionRegister;
import im.Qwc.functions.impl.combat.KillAura;
import im.Qwc.functions.settings.impl.ModeSetting;
import im.Qwc.functions.settings.impl.SliderSetting;
import im.Qwc.utils.math.Vector4i;
import im.Qwc.utils.projections.ProjectionUtil;
import im.Qwc.utils.render.ColorUtils;
import im.Qwc.utils.render.DisplayUtils;
import lombok.Getter;
import net.minecraft.client.renderer.WorldVertexBufferUploader;
import net.minecraft.client.renderer.entity.EntityRendererManager;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.entity.LivingEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector2f;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.util.math.vector.Vector3f;

import net.optifine.shaders.Shaders;
import org.lwjgl.opengl.GL11;


import java.awt.*;
import java.util.ArrayList;
import java.util.List;

import static com.mojang.blaze3d.systems.RenderSystem.depthMask;
import static org.lwjgl.opengl.GL11.GL_POINTS;

@FunctionRegister(name = "TargetESP", type = Category.Render)
public class TargetESP extends Function {
private final ModeSetting type = new ModeSetting("Тип", "Дефолт", "Дефолт", "Новая","Круг","Призраки");
public SliderSetting speed = new SliderSetting("Скорость", 2.0F, 0.7F, 9.0F, 1.0F);
public SliderSetting size = new SliderSetting("Размер", 75.0F, 5.0F, 140.0F, 1.0F);
public SliderSetting bright = new SliderSetting("Яркость", 255.0F, 1.0F, 255.0F, 1.0F);
Getter
public static LivingEntity target = null;
private final KillAura killAura;
public TargetESP(KillAura killAura) {
this.killAura = killAura;
addSettings(type);
}
public static long startTime = System.currentTimeMillis();
@Subscribe
private void onWorldEvent(WorldEvent e) {
if (this.type.is("Круг")) {
EntityRendererManager rm = mc.getRenderManager();
if (killAura.isState() && killAura.getTarget() != null) {
double x = killAura.getTarget().lastTickPosX + (killAura.getTarget().getPosX() - killAura.getTarget().lastTickPosX) * (double) e.getPartialTicks() - rm.info.getProjectedView().getX();
double y = killAura.getTarget().lastTickPosY + (killAura.getTarget().getPosY() - killAura.getTarget().lastTickPosY) * (double) e.getPartialTicks() - rm.info.getProjectedView().getY();
double z = killAura.getTarget().lastTickPosZ + (killAura.getTarget().getPosZ() - killAura.getTarget().lastTickPosZ) * (double) e.getPartialTicks() - rm.info.getProjectedView().getZ();
float height = killAura.getTarget().getHeight();
double duration = 1500.0;
double elapsed = (double) System.currentTimeMillis() % duration;
boolean side = elapsed > duration / 2.0;
double progress = elapsed / (duration / 2.0);
progress = side ? --progress : 1.0 - progress;
progress = progress < 0.5 ? 2.0 * progress * progress : 1.0 - Math.pow(-2.0 * progress + 2.0, 2.0) / 2.0;
double eased = (double) (height / 2.0F) * (progress > 0.5 ? 1.0 - progress : progress) * (double) (side ? -1 : 1);
RenderSystem.pushMatrix();
GL11.glDepthMask(false);
GL11.glEnable(2848);
GL11.glHint(3154, 4354);
RenderSystem.disableTexture();
RenderSystem.enableBlend();
RenderSystem.disableAlphaTest();
RenderSystem.shadeModel(7425);
RenderSystem.disableCull();
RenderSystem.lineWidth(1.5F);
RenderSystem.color4f(-1.0F, -1.0F, -1.0F, -1.0F);
buffer.begin(8, DefaultVertexFormats.POSITION_COLOR);
float[] colors = null;

int i;
for (i = 0; i <= 360; ++i) {
colors = DisplayUtils.IntColor.rgb(HUD.getColor(0));
buffer.pos(x + Math.cos(Math.toRadians((double) i)) * (double) this.killAura.getTarget().getWidth() * 0.85, y + (double) height * progress, z + Math.sin(Math.toRadians((double) i)) * (double) this.killAura.getTarget().getWidth() * 0.85).color(colors[0], colors[1], colors[2], 0.5F).endVertex();
buffer.pos(x + Math.cos(Math.toRadians((double) i)) * (double) this.killAura.getTarget().getWidth() * 0.85, y + (double) height * progress + eased * 1.5, z + Math.sin(Math.toRadians((double) i)) * (double) this.killAura.getTarget().getWidth() * 0.85).color(colors[0], colors[1], colors[2], 0.2F).endVertex();
}

buffer.finishDrawing();
WorldVertexBufferUploader.draw(buffer);
RenderSystem.color4f(-1.0F, -1.0F, -1.0F, -1.0F);
buffer.begin(2, DefaultVertexFormats.POSITION_COLOR);
for (i = 0; i <= 360; ++i) {
buffer.pos(x + Math.cos(Math.toRadians((double) i)) * (double) this.killAura.getTarget().getWidth() * 0.85, y + (double) height * progress, z + Math.sin(Math.toRadians((double) i)) * (double) this.killAura.getTarget().getWidth() * 0.85).color(colors[0], colors[1], colors[2], 0.2F).endVertex();
}

buffer.finishDrawing();
WorldVertexBufferUploader.draw(buffer);
RenderSystem.enableCull();
RenderSystem.disableBlend();
RenderSystem.enableTexture();
RenderSystem.enableAlphaTest();
GL11.glDepthMask(true);
GL11.glDisable(2848);
GL11.glHint(3154, 4354);
RenderSystem.shadeModel(7424);
RenderSystem.popMatrix();
} else {
}
}
if (type.is("Призраки")) {
if (killAura.isState() && killAura.getTarget() != null) {
MatrixStack stack = new MatrixStack();
EntityRendererManager rm = mc.getRenderManager();
float c = (float) ((((System.currentTimeMillis() - startTime) / 1500F)) + (Math.sin((((System.currentTimeMillis() - startTime) / 1500F))) / 10f));

double x = killAura.getTarget().lastTickPosX + (killAura.getTarget().getPosX() - killAura.getTarget().lastTickPosX) * (double) e.getPartialTicks() - rm.info.getProjectedView().getX();
double y = killAura.getTarget().lastTickPosY + (killAura.getTarget().getPosY() - killAura.getTarget().lastTickPosY) * (double) e.getPartialTicks() - rm.info.getProjectedView().getY();
double z = killAura.getTarget().lastTickPosZ + (killAura.getTarget().getPosZ() - killAura.getTarget().lastTickPosZ) * (double) e.getPartialTicks() - rm.info.getProjectedView().getZ();
float alpha = Shaders.shaderPackLoaded ? 1f : 0.5f;
alpha *= 0.2F;

float pl = 0;
boolean fa = true;
for (int b = 0; b < 3; b++) {
for (float i = c * 360; i < c * 360 + 90; i += 2) {
float cur = i;
float max = c * 360 + 90;
float dc = MathHelper.normalize(cur, c * 360 - 45, max);
float degrees = i;
int color = ColorUtils.getColor(0);
int color2 = ColorUtils.getColor(90);
float rf = 0.7f;
double radians = Math.toRadians(degrees);
double plY = pl + Math.sin(radians * 1.2f) * 0.1f;
stack.push();
stack.translate(x, y, z);
stack.rotate(mc.getRenderManager().info.getRotation());
GL11.glDepthMask(false);
float q = (!fa ? 0.15f : 0.15f) * (Math.max(fa ? 0.15f : 0.15f, fa ? dc : (1f - -(0.4f - dc)) / 2f) + 0.45f);
float w = q * (1.5f + ((0.5f - -alpha) * 2));
DisplayUtils.drawImage1(stack, new ResourceLocation("Qwc/images/glow.png"), Math.cos(radians) * rf - w / 2f, plY + 1 - 0.7f, Math.sin(radians) * rf - w / 2f, w, w, color, color2, color2, color);
GL11.glEnable(GL11.GL_DEPTH_TEST);
depthMask(true);
stack.pop();
}
c *= -1.025f;
fa = !fa;
pl += 0.45f;
}
}
}else {
}
}


@Subscribe
private void onDisplay(EventDisplay e) {
if (e.getType() != EventDisplay.Type.PRE) {
return;
}
if (killAura.isState() && killAura.getTarget() != null) {
double sin = Math.sin(System.currentTimeMillis() / 1000.0);
float size = 90.0F;

Vector3d interpolated = killAura.getTarget().getPositon(e.getPartialTicks());
Vector2f pos = ProjectionUtil.project(interpolated.x, interpolated.y + killAura.getTarget().getHeight() / 2f, interpolated.z);
GlStateManager.pushMatrix();
GlStateManager.translatef(pos.x, pos.y, 0);
GlStateManager.rotatef((float) sin * 360, 0, 0, 1);
GlStateManager.translatef(-pos.x, -pos.y, 0);
if (type.is("Дефолт")) {
DisplayUtils.drawImage(new ResourceLocation("Qwc/images/target.png"), pos.x - size / 2f, pos.y - size / 2f, size, size, new Vector4i(ColorUtils.setAlpha(HUD.getColor(0, 1), 220), ColorUtils.setAlpha(HUD.getColor(90, 1), 220), ColorUtils.setAlpha(HUD.getColor(180, 1), 220), ColorUtils.setAlpha(HUD.getColor(270, 1), 220)));
}
if (type.is("Новая")) {
DisplayUtils.drawImage(new ResourceLocation("Qwc/images/Quad.png"), pos.x - size / 2f, pos.y - size / 2f, size, size, new Vector4i(ColorUtils.setAlpha(HUD.getColor(0, 1), 220), ColorUtils.setAlpha(HUD.getColor(90, 1), 220), ColorUtils.setAlpha(HUD.getColor(180, 1), 220), ColorUtils.setAlpha(HUD.getColor(270, 1), 220)));
}
GlStateManager.popMatrix();
}
}
}

getTarget


package im.Qwc.ui.display.impl;

import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
import im.Qwc.Exo;
import im.Qwc.events.EventDisplay;
import im.Qwc.functions.api.FunctionRegistry;
import im.Qwc.functions.impl.render.HUD;
import im.Qwc.ui.Particle.Particle;
import im.Qwc.ui.Particle.ParticleManager;
import im.Qwc.ui.display.ElementRenderer;
import im.Qwc.ui.styles.Style;
import im.Qwc.utils.animations.Animation;
import im.Qwc.utils.animations.Direction;
import im.Qwc.utils.animations.impl.EaseBackIn;
import im.Qwc.utils.client.ClientUtil;
import im.Qwc.utils.client.IMinecraft;
import im.Qwc.utils.drag.Dragging;
import im.Qwc.utils.math.MathUtil;
import im.Qwc.utils.math.StopWatch;
import im.Qwc.utils.math.Vector4i;
import im.Qwc.utils.render.*;
import im.Qwc.utils.render.font.Fonts;
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.item.AirItem;
import net.minecraft.item.ItemStack;
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 java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;

public class TargetHUD3 implements ElementRenderer {
private final StopWatch stopWatch;
private final Dragging drag;
private LivingEntity entity;
private boolean allow;
private final Animation animation;
private float healthAnimation;
private float healthAnimation2;
private float absorptionAnimation;
private final ParticleManager particleManager = new ParticleManager();
public void render(final EventDisplay eventDisplay) {
this.entity = this.getTarget(this.entity);
final float rounding = 6.0f;
final boolean out = !this.allow || this.stopWatch.isReached(1000L);
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) {
final String name = this.entity.getName().getString();
final float posX = this.drag.getX();
final float posY = this.drag.getY();
final float headSize = 28.0f;
final float spacing = 5.0f;
final float width = 114.666664f;
final float height = 39.333332f;
this.drag.setWidth(width);
this.drag.setHeight(height);
final float shrinking = 1.5f;

final Score score = TargetInfoRenderer2.mc.world.getScoreboard().getOrCreateScore(this.entity.getScoreboardName(), TargetInfoRenderer2.mc.world.getScoreboard().getObjectiveInDisplaySlot(2));
float hp = this.entity.getHealth();
float maxHp = this.entity.getMaxHealth();

final String header = (TargetInfoRenderer2.mc.ingameGUI.getTabList().header == null) ? " " : TargetInfoRenderer2.mc.ingameGUI.getTabList().header.getString().toLowerCase();
if (TargetInfoRenderer2.mc.getCurrentServerData() != null && TargetInfoRenderer2.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.healthAnimation2 = MathUtil.fast(this.healthAnimation2, MathHelper.clamp(hp / maxHp, 0.0f, 1.0f), 2.0f);
this.absorptionAnimation = MathUtil.fast(this.absorptionAnimation, MathHelper.clamp(this.entity.getAbsorptionAmount() / 16.0f, 0.0f, 1.0f), 10.0f);

final float animationValue = (float)this.animation.getOutput();
final float halfAnimationValueRest = (1.0f - animationValue) / 2.0f;
final float testX = posX + width * halfAnimationValueRest;
final float testY = posY + height * halfAnimationValueRest;
final float testW = width * animationValue;
final float testH = height * animationValue;

GlStateManager.pushMatrix();
final Style style = Exo.getInstance().getStyleManager().getCurrentStyle();

sizeAnimation(posX + width / 2.0f, posY + height / 2.0f, this.animation.getOutput());
FunctionRegistry functionRegistry = Exo.getInstance().getFunctionRegistry();
HUD hud = functionRegistry.getHud();
GlStateManager.pushMatrix();
KawaseBlur.blur.updateBlur(1,1);
KawaseBlur.blur.render(()-> {
DisplayUtils.drawRoundedRect(posX, posY, width, height + 13.0f, rounding, ColorUtils.rgba(21, 21, 21, 200));
});
DisplayUtils.drawRoundedRect(posX, posY, width, height + 13.0f, rounding, ColorUtils.rgba(21, 21, 21, 200));
GlStateManager.popMatrix();
this.particleManager.render();
Stencil.initStencilToWrite();
DisplayUtils.drawRoundedRect(posX + spacing, posY + spacing + 1, headSize, headSize,6, ColorUtils.rgba(255,255,255,255));
Stencil.readStencilBuffer(1);
this.drawTargetHead(this.entity, posX + spacing, posY + spacing + 1.0f, headSize, headSize);
Stencil.uninitStencilBuffer();
Scissor.push();
Scissor.setFromComponentCoordinates(testX, testY, testW - 6.0f, testH);
if (this.entity.hurtTime > 0) {
if (hud.particle.get()) {
this.spawnParticles(this.entity, posX, posY, headSize);
}
}
Fonts.sfMedium.drawText(eventDisplay.getMatrixStack(), this.entity.getName().getString(), posX + headSize + spacing + spacing, posY + spacing + 1.0f, -1, 8.0f);
int healthPercent = (int) ((hp + TargetInfoRenderer2.mc.player.getAbsorptionAmount()) / (maxHp + TargetInfoRenderer2.mc.player.getAbsorptionAmount()) * 100);
//Fonts.sfui.drawText(eventDisplay.getMatrixStack(), "" + ((int) healthPercent + "% "), posX - 23 + headSize + spacing + spacing + ((width - 42.0f) * this.healthAnimation), posY - 3 + height - spacing * 2.0f - 3.0f + spacing + 1.0f, ColorUtils.rgba(255,255,255,255),6.5F);
Scissor.unset();
Scissor.pop();
List<ItemStack> stacks = new ArrayList<>(Arrays.asList(entity.getHeldItemMainhand(), entity.getHeldItemOffhand()));
entity.getArmorInventoryList().forEach(stacks::add);
stacks.removeIf(w -> w.getItem() instanceof AirItem);
drawItemStack(posX + 36, posY + 19, 12);
if(hud.vibor.is("Радужная")) {
Vector4i vector4i3 = new Vector4i(ColorUtils.setAlpha(HUD.getColor(0), 64), ColorUtils.setAlpha(HUD.getColor(90), 64), ColorUtils.setAlpha(HUD.getColor(180), 64), ColorUtils.setAlpha(HUD.getColor(270), 64));
Vector4i vector4i = new Vector4i(HUD.getColor(0), HUD.getColor(90), HUD.getColor(180), HUD.getColor(270));
final Vector4i vector4i2 = new Vector4i(ColorUtils.setAlpha(HUD.getColor(0, 1), 64), ColorUtils.setAlpha(HUD.getColor(0, 1), 64), ColorUtils.setAlpha(HUD.getColor(90, 1), 64), ColorUtils.setAlpha(HUD.getColor(90, 1), 64));
DisplayUtils.drawRoundedRect(posX - 30f + headSize + spacing + spacing, posY + 13f + height - spacing * 2.0f - 3.0f, width - 15.0f, 5.0f, new Vector4f(4.0f, 4.0f, 4.0f, 4.0f), ColorUtils.rgb(32, 32, 32));
//DisplayUtils.drawShadow(posX - 30f + headSize + spacing + spacing, posY + 13f + height - spacing * 2.0f - 3.0f, (width - 15.0f) * this.healthAnimation, 5.0f, 8, HUD.getColor(0,1),HUD.getColor(90,1));
DisplayUtils.drawRoundedRect(posX - 30f + headSize + spacing + spacing, posY + 13f + height - spacing * 2.0f - 3.0f, (width - 15.0f) * this.healthAnimation, 5.0f, new Vector4f(4.0f, 4.0f, 4.0f, 4.0f), vector4i);
DisplayUtils.drawRoundedRect(posX - 30f + headSize + spacing + spacing, posY + 13f + height - spacing * 2.0f - 3.0f, (width - 15.0f) * this.healthAnimation2, 5.0f, new Vector4f(4.0f, 4.0f, 4.0f, 4.0f), vector4i3);
if (!ClientUtil.isConnectedToServer("funtime")) {
DisplayUtils.drawShadow(posX - 30f + headSize + spacing + spacing, posY + 13f + height - spacing * 2.0f - 3.0f, (width - 15.0f) * this.absorptionAnimation, 5.0f, 8, ColorUtils.rgba(236, 154, 17, 255), ColorUtils.rgba(228, 206, 5, 255));
DisplayUtils.drawRoundedRect(posX - 30f + headSize + spacing + spacing, posY + 13f + height - spacing * 2.0f - 3.0f, (width - 15.0f) * this.absorptionAnimation, 5.0f, new Vector4f(4.0f, 4.0f, 4.0f, 4.0f), new Vector4i(ColorUtils.rgba(236, 154, 17, 255), ColorUtils.rgba(236, 154, 17, 255), ColorUtils.rgba(228, 206, 5, 255), ColorUtils.rgba(228, 206, 5, 255)));
}
}else {
Vector4i vector4i3 = new Vector4i(ColorUtils.setAlpha(HUD.getColor(90), 64), ColorUtils.setAlpha(HUD.getColor(90), 64), ColorUtils.setAlpha(HUD.getColor(0), 64), ColorUtils.setAlpha(HUD.getColor(0), 64));
Vector4i vector4i = new Vector4i(HUD.getColor(90), HUD.getColor(90), HUD.getColor(0), HUD.getColor(0));
final Vector4i vector4i2 = new Vector4i(ColorUtils.setAlpha(HUD.getColor(0, 1), 64), ColorUtils.setAlpha(HUD.getColor(0, 1), 64), ColorUtils.setAlpha(HUD.getColor(90, 1), 64), ColorUtils.setAlpha(HUD.getColor(90, 1), 64));
DisplayUtils.drawRoundedRect(posX - 30f + headSize + spacing + spacing, posY + 13f + height - spacing * 2.0f - 3.0f, width - 15.0f, 5.0f, new Vector4f(4.0f, 4.0f, 4.0f, 4.0f), ColorUtils.rgb(32, 32, 32));
//DisplayUtils.drawShadow(posX - 30f + headSize + spacing + spacing, posY + 13f + height - spacing * 2.0f - 3.0f, (width - 15.0f) * this.healthAnimation, 5.0f, 8, HUD.getColor(0,1),HUD.getColor(90,1));
DisplayUtils.drawRoundedRect(posX - 30f + headSize + spacing + spacing, posY + 13f + height - spacing * 2.0f - 3.0f, (width - 15.0f) * this.healthAnimation, 5.0f, new Vector4f(4.0f, 4.0f, 4.0f, 4.0f), vector4i);
DisplayUtils.drawRoundedRect(posX - 30f + headSize + spacing + spacing, posY + 13f + height - spacing * 2.0f - 3.0f, (width - 15.0f) * this.healthAnimation2, 5.0f, new Vector4f(4.0f, 4.0f, 4.0f, 4.0f), vector4i3);
if (!ClientUtil.isConnectedToServer("funtime")) {
DisplayUtils.drawShadow(posX - 30f + headSize + spacing + spacing, posY + 13f + height - spacing * 2.0f - 3.0f, (width - 15.0f) * this.absorptionAnimation, 5.0f, 8, ColorUtils.rgba(236, 154, 17, 255), ColorUtils.rgba(228, 206, 5, 255));
DisplayUtils.drawRoundedRect(posX - 30f + headSize + spacing + spacing, posY + 13f + height - spacing * 2.0f - 3.0f, (width - 15.0f) * this.absorptionAnimation, 5.0f, new Vector4f(4.0f, 4.0f, 4.0f, 4.0f), new Vector4i(ColorUtils.rgba(236, 154, 17, 255), ColorUtils.rgba(236, 154, 17, 255), ColorUtils.rgba(228, 206, 5, 255), ColorUtils.rgba(228, 206, 5, 255)));
}
}

GlStateManager.popMatrix();
}
this.particleManager.update();
}
private void spawnParticles(LivingEntity entity, float posX, float posY, float headSize) {
if (Math.random() < 0.05) {
float velocityX = (float) (Math.random() * 0.2 - 0.1) * 12.5F;
float velocityY = (float) (Math.random() * 0.2 - 0.1) * 12.5F;
float scale = 0.5F;
ResourceLocation particleTexture = new ResourceLocation("Qwc/images/gray.png");
float randomOffsetX = (float) (Math.random() - 0.5) * headSize; // Уменьшено влияние headSize в 2 раза
float randomOffsetY = (float) (Math.random() - 0.5) * headSize; // Уменьшено влияние headSize в 2 раза
for (int i = 0; i <= 360F; i++) {
int color = HUD.getColor(i, 1);
Particle particle = new Particle(posX + headSize / 2 + randomOffsetX, posY + headSize / 2 + randomOffsetY, velocityX, velocityY, scale, particleTexture, 100, color);
particle.setFadeColor(color);
particle.setSliding(true);
this.particleManager.addParticle(particle);
}
}
}
private LivingEntity getTarget(final LivingEntity nullTarget) {
final LivingEntity auraTarget = Exo.getInstance().getFunctionRegistry().getKillAura().getTarget();
LivingEntity target = nullTarget;
if (auraTarget != null) {
this.stopWatch.reset();
this.allow = true;
target = auraTarget;
}
else if (TargetInfoRenderer2.mc.currentScreen instanceof ChatScreen) {
this.stopWatch.reset();
this.allow = true;
target = TargetInfoRenderer2.mc.player;
}
else {
this.allow = false;
}
return target;
}

public void drawTargetHead(final LivingEntity entity, final float x, final float y, final float width, final float height) {
if (entity != null) {
final EntityRenderer<? super LivingEntity> rendererManager = (EntityRenderer<? super LivingEntity>)TargetInfoRenderer2.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(final double width, final double height, final double scale) {
GlStateManager.translated(width, height, 0.0);
GlStateManager.scaled(scale, scale, scale);
GlStateManager.translated(-width, -height, 0.0);
}

public void drawFace(final ResourceLocation res, final float d, final float y, final float u, final float v, final float uWidth, final float vHeight, final float width, final float height, final float tileWidth, final float tileHeight, final LivingEntity target) {
GL11.glPushMatrix();
GL11.glEnable(3042);
TargetInfoRenderer2.mc.getTextureManager().bindTexture(res);
final float hurtPercent = (target.hurtTime - ((target.hurtTime != 0) ? TargetInfoRenderer2.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();
}

public TargetHUD3(final Dragging drag) {
this.stopWatch = new StopWatch();
this.entity = null;
this.animation = new EaseBackIn(400, 1.0, 1.0f);
this.healthAnimation = 0.0f;
this.healthAnimation2 = 0.0f;
this.absorptionAnimation = 0.0f;
this.drag = drag;
}
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 -> drawItemStack(stack,
posX.getAndAccumulate(offset, Float::sum),
y,
true,
true, 0.7f));
}
public static void drawItemStack(ItemStack stack, float x, float y, boolean withoutOverlay, boolean scale, float scaleValue) {
RenderSystem.pushMatrix();
RenderSystem.translatef(x, y, 0);
if (scale) GL11.glScaled(scaleValue, scaleValue, scaleValue);
mc.getItemRenderer().renderItemAndEffectIntoGUI(stack, 0, 0);
if (withoutOverlay) mc.getItemRenderer().renderItemOverlays(mc.fontRenderer, stack, 0, 0);
RenderSystem.popMatrix();
}
}
Если кто может скиньте :roflanEbalo: готовый текст
 
Начинающий
Статус
Оффлайн
Регистрация
23 Сен 2024
Сообщения
37
Реакции[?]
0
Поинты[?]
0
Начинающий
Статус
Онлайн
Регистрация
6 Дек 2023
Сообщения
215
Реакции[?]
0
Поинты[?]
0
Хелп куда вставлять TargetESP

package im.Qwc.functions.impl.render;

import com.google.common.eventbus.Subscribe;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
import im.Qwc.events.EventDisplay;
import im.Qwc.events.WorldEvent;
import im.Qwc.functions.api.Category;
import im.Qwc.functions.api.Function;
import im.Qwc.functions.api.FunctionRegister;
import im.Qwc.functions.impl.combat.KillAura;
import im.Qwc.functions.settings.impl.ModeSetting;
import im.Qwc.functions.settings.impl.SliderSetting;
import im.Qwc.utils.math.Vector4i;
import im.Qwc.utils.projections.ProjectionUtil;
import im.Qwc.utils.render.ColorUtils;
import im.Qwc.utils.render.DisplayUtils;
import lombok.Getter;
import net.minecraft.client.renderer.WorldVertexBufferUploader;
import net.minecraft.client.renderer.entity.EntityRendererManager;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.entity.LivingEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector2f;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.util.math.vector.Vector3f;

import net.optifine.shaders.Shaders;
import org.lwjgl.opengl.GL11;


import java.awt.*;
import java.util.ArrayList;
import java.util.List;

import static com.mojang.blaze3d.systems.RenderSystem.depthMask;
import static org.lwjgl.opengl.GL11.GL_POINTS;

@FunctionRegister(name = "TargetESP", type = Category.Render)
public class TargetESP extends Function {
private final ModeSetting type = new ModeSetting("Тип", "Дефолт", "Дефолт", "Новая","Круг","Призраки");
public SliderSetting speed = new SliderSetting("Скорость", 2.0F, 0.7F, 9.0F, 1.0F);
public SliderSetting size = new SliderSetting("Размер", 75.0F, 5.0F, 140.0F, 1.0F);
public SliderSetting bright = new SliderSetting("Яркость", 255.0F, 1.0F, 255.0F, 1.0F);
Getter
public static LivingEntity target = null;
private final KillAura killAura;
public TargetESP(KillAura killAura) {
this.killAura = killAura;
addSettings(type);
}
public static long startTime = System.currentTimeMillis();
@Subscribe
private void onWorldEvent(WorldEvent e) {
if (this.type.is("Круг")) {
EntityRendererManager rm = mc.getRenderManager();
if (killAura.isState() && killAura.getTarget() != null) {
double x = killAura.getTarget().lastTickPosX + (killAura.getTarget().getPosX() - killAura.getTarget().lastTickPosX) * (double) e.getPartialTicks() - rm.info.getProjectedView().getX();
double y = killAura.getTarget().lastTickPosY + (killAura.getTarget().getPosY() - killAura.getTarget().lastTickPosY) * (double) e.getPartialTicks() - rm.info.getProjectedView().getY();
double z = killAura.getTarget().lastTickPosZ + (killAura.getTarget().getPosZ() - killAura.getTarget().lastTickPosZ) * (double) e.getPartialTicks() - rm.info.getProjectedView().getZ();
float height = killAura.getTarget().getHeight();
double duration = 1500.0;
double elapsed = (double) System.currentTimeMillis() % duration;
boolean side = elapsed > duration / 2.0;
double progress = elapsed / (duration / 2.0);
progress = side ? --progress : 1.0 - progress;
progress = progress < 0.5 ? 2.0 * progress * progress : 1.0 - Math.pow(-2.0 * progress + 2.0, 2.0) / 2.0;
double eased = (double) (height / 2.0F) * (progress > 0.5 ? 1.0 - progress : progress) * (double) (side ? -1 : 1);
RenderSystem.pushMatrix();
GL11.glDepthMask(false);
GL11.glEnable(2848);
GL11.glHint(3154, 4354);
RenderSystem.disableTexture();
RenderSystem.enableBlend();
RenderSystem.disableAlphaTest();
RenderSystem.shadeModel(7425);
RenderSystem.disableCull();
RenderSystem.lineWidth(1.5F);
RenderSystem.color4f(-1.0F, -1.0F, -1.0F, -1.0F);
buffer.begin(8, DefaultVertexFormats.POSITION_COLOR);
float[] colors = null;

int i;
for (i = 0; i <= 360; ++i) {
colors = DisplayUtils.IntColor.rgb(HUD.getColor(0));
buffer.pos(x + Math.cos(Math.toRadians((double) i)) * (double) this.killAura.getTarget().getWidth() * 0.85, y + (double) height * progress, z + Math.sin(Math.toRadians((double) i)) * (double) this.killAura.getTarget().getWidth() * 0.85).color(colors[0], colors[1], colors[2], 0.5F).endVertex();
buffer.pos(x + Math.cos(Math.toRadians((double) i)) * (double) this.killAura.getTarget().getWidth() * 0.85, y + (double) height * progress + eased * 1.5, z + Math.sin(Math.toRadians((double) i)) * (double) this.killAura.getTarget().getWidth() * 0.85).color(colors[0], colors[1], colors[2], 0.2F).endVertex();
}

buffer.finishDrawing();
WorldVertexBufferUploader.draw(buffer);
RenderSystem.color4f(-1.0F, -1.0F, -1.0F, -1.0F);
buffer.begin(2, DefaultVertexFormats.POSITION_COLOR);
for (i = 0; i <= 360; ++i) {
buffer.pos(x + Math.cos(Math.toRadians((double) i)) * (double) this.killAura.getTarget().getWidth() * 0.85, y + (double) height * progress, z + Math.sin(Math.toRadians((double) i)) * (double) this.killAura.getTarget().getWidth() * 0.85).color(colors[0], colors[1], colors[2], 0.2F).endVertex();
}

buffer.finishDrawing();
WorldVertexBufferUploader.draw(buffer);
RenderSystem.enableCull();
RenderSystem.disableBlend();
RenderSystem.enableTexture();
RenderSystem.enableAlphaTest();
GL11.glDepthMask(true);
GL11.glDisable(2848);
GL11.glHint(3154, 4354);
RenderSystem.shadeModel(7424);
RenderSystem.popMatrix();
} else {
}
}
if (type.is("Призраки")) {
if (killAura.isState() && killAura.getTarget() != null) {
MatrixStack stack = new MatrixStack();
EntityRendererManager rm = mc.getRenderManager();
float c = (float) ((((System.currentTimeMillis() - startTime) / 1500F)) + (Math.sin((((System.currentTimeMillis() - startTime) / 1500F))) / 10f));

double x = killAura.getTarget().lastTickPosX + (killAura.getTarget().getPosX() - killAura.getTarget().lastTickPosX) * (double) e.getPartialTicks() - rm.info.getProjectedView().getX();
double y = killAura.getTarget().lastTickPosY + (killAura.getTarget().getPosY() - killAura.getTarget().lastTickPosY) * (double) e.getPartialTicks() - rm.info.getProjectedView().getY();
double z = killAura.getTarget().lastTickPosZ + (killAura.getTarget().getPosZ() - killAura.getTarget().lastTickPosZ) * (double) e.getPartialTicks() - rm.info.getProjectedView().getZ();
float alpha = Shaders.shaderPackLoaded ? 1f : 0.5f;
alpha *= 0.2F;

float pl = 0;
boolean fa = true;
for (int b = 0; b < 3; b++) {
for (float i = c * 360; i < c * 360 + 90; i += 2) {
float cur = i;
float max = c * 360 + 90;
float dc = MathHelper.normalize(cur, c * 360 - 45, max);
float degrees = i;
int color = ColorUtils.getColor(0);
int color2 = ColorUtils.getColor(90);
float rf = 0.7f;
double radians = Math.toRadians(degrees);
double plY = pl + Math.sin(radians * 1.2f) * 0.1f;
stack.push();
stack.translate(x, y, z);
stack.rotate(mc.getRenderManager().info.getRotation());
GL11.glDepthMask(false);
float q = (!fa ? 0.15f : 0.15f) * (Math.max(fa ? 0.15f : 0.15f, fa ? dc : (1f - -(0.4f - dc)) / 2f) + 0.45f);
float w = q * (1.5f + ((0.5f - -alpha) * 2));
DisplayUtils.drawImage1(stack, new ResourceLocation("Qwc/images/glow.png"), Math.cos(radians) * rf - w / 2f, plY + 1 - 0.7f, Math.sin(radians) * rf - w / 2f, w, w, color, color2, color2, color);
GL11.glEnable(GL11.GL_DEPTH_TEST);
depthMask(true);
stack.pop();
}
c *= -1.025f;
fa = !fa;
pl += 0.45f;
}
}
}else {
}
}


@Subscribe
private void onDisplay(EventDisplay e) {
if (e.getType() != EventDisplay.Type.PRE) {
return;
}
if (killAura.isState() && killAura.getTarget() != null) {
double sin = Math.sin(System.currentTimeMillis() / 1000.0);
float size = 90.0F;

Vector3d interpolated = killAura.getTarget().getPositon(e.getPartialTicks());
Vector2f pos = ProjectionUtil.project(interpolated.x, interpolated.y + killAura.getTarget().getHeight() / 2f, interpolated.z);
GlStateManager.pushMatrix();
GlStateManager.translatef(pos.x, pos.y, 0);
GlStateManager.rotatef((float) sin * 360, 0, 0, 1);
GlStateManager.translatef(-pos.x, -pos.y, 0);
if (type.is("Дефолт")) {
DisplayUtils.drawImage(new ResourceLocation("Qwc/images/target.png"), pos.x - size / 2f, pos.y - size / 2f, size, size, new Vector4i(ColorUtils.setAlpha(HUD.getColor(0, 1), 220), ColorUtils.setAlpha(HUD.getColor(90, 1), 220), ColorUtils.setAlpha(HUD.getColor(180, 1), 220), ColorUtils.setAlpha(HUD.getColor(270, 1), 220)));
}
if (type.is("Новая")) {
DisplayUtils.drawImage(new ResourceLocation("Qwc/images/Quad.png"), pos.x - size / 2f, pos.y - size / 2f, size, size, new Vector4i(ColorUtils.setAlpha(HUD.getColor(0, 1), 220), ColorUtils.setAlpha(HUD.getColor(90, 1), 220), ColorUtils.setAlpha(HUD.getColor(180, 1), 220), ColorUtils.setAlpha(HUD.getColor(270, 1), 220)));
}
GlStateManager.popMatrix();
}
}
}

getTarget


package im.Qwc.ui.display.impl;

import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
import im.Qwc.Exo;
import im.Qwc.events.EventDisplay;
import im.Qwc.functions.api.FunctionRegistry;
import im.Qwc.functions.impl.render.HUD;
import im.Qwc.ui.Particle.Particle;
import im.Qwc.ui.Particle.ParticleManager;
import im.Qwc.ui.display.ElementRenderer;
import im.Qwc.ui.styles.Style;
import im.Qwc.utils.animations.Animation;
import im.Qwc.utils.animations.Direction;
import im.Qwc.utils.animations.impl.EaseBackIn;
import im.Qwc.utils.client.ClientUtil;
import im.Qwc.utils.client.IMinecraft;
import im.Qwc.utils.drag.Dragging;
import im.Qwc.utils.math.MathUtil;
import im.Qwc.utils.math.StopWatch;
import im.Qwc.utils.math.Vector4i;
import im.Qwc.utils.render.*;
import im.Qwc.utils.render.font.Fonts;
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.item.AirItem;
import net.minecraft.item.ItemStack;
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 java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;

public class TargetHUD3 implements ElementRenderer {
private final StopWatch stopWatch;
private final Dragging drag;
private LivingEntity entity;
private boolean allow;
private final Animation animation;
private float healthAnimation;
private float healthAnimation2;
private float absorptionAnimation;
private final ParticleManager particleManager = new ParticleManager();
public void render(final EventDisplay eventDisplay) {
this.entity = this.getTarget(this.entity);
final float rounding = 6.0f;
final boolean out = !this.allow || this.stopWatch.isReached(1000L);
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) {
final String name = this.entity.getName().getString();
final float posX = this.drag.getX();
final float posY = this.drag.getY();
final float headSize = 28.0f;
final float spacing = 5.0f;
final float width = 114.666664f;
final float height = 39.333332f;
this.drag.setWidth(width);
this.drag.setHeight(height);
final float shrinking = 1.5f;

final Score score = TargetInfoRenderer2.mc.world.getScoreboard().getOrCreateScore(this.entity.getScoreboardName(), TargetInfoRenderer2.mc.world.getScoreboard().getObjectiveInDisplaySlot(2));
float hp = this.entity.getHealth();
float maxHp = this.entity.getMaxHealth();

final String header = (TargetInfoRenderer2.mc.ingameGUI.getTabList().header == null) ? " " : TargetInfoRenderer2.mc.ingameGUI.getTabList().header.getString().toLowerCase();
if (TargetInfoRenderer2.mc.getCurrentServerData() != null && TargetInfoRenderer2.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.healthAnimation2 = MathUtil.fast(this.healthAnimation2, MathHelper.clamp(hp / maxHp, 0.0f, 1.0f), 2.0f);
this.absorptionAnimation = MathUtil.fast(this.absorptionAnimation, MathHelper.clamp(this.entity.getAbsorptionAmount() / 16.0f, 0.0f, 1.0f), 10.0f);

final float animationValue = (float)this.animation.getOutput();
final float halfAnimationValueRest = (1.0f - animationValue) / 2.0f;
final float testX = posX + width * halfAnimationValueRest;
final float testY = posY + height * halfAnimationValueRest;
final float testW = width * animationValue;
final float testH = height * animationValue;

GlStateManager.pushMatrix();
final Style style = Exo.getInstance().getStyleManager().getCurrentStyle();

sizeAnimation(posX + width / 2.0f, posY + height / 2.0f, this.animation.getOutput());
FunctionRegistry functionRegistry = Exo.getInstance().getFunctionRegistry();
HUD hud = functionRegistry.getHud();
GlStateManager.pushMatrix();
KawaseBlur.blur.updateBlur(1,1);
KawaseBlur.blur.render(()-> {
DisplayUtils.drawRoundedRect(posX, posY, width, height + 13.0f, rounding, ColorUtils.rgba(21, 21, 21, 200));
});
DisplayUtils.drawRoundedRect(posX, posY, width, height + 13.0f, rounding, ColorUtils.rgba(21, 21, 21, 200));
GlStateManager.popMatrix();
this.particleManager.render();
Stencil.initStencilToWrite();
DisplayUtils.drawRoundedRect(posX + spacing, posY + spacing + 1, headSize, headSize,6, ColorUtils.rgba(255,255,255,255));
Stencil.readStencilBuffer(1);
this.drawTargetHead(this.entity, posX + spacing, posY + spacing + 1.0f, headSize, headSize);
Stencil.uninitStencilBuffer();
Scissor.push();
Scissor.setFromComponentCoordinates(testX, testY, testW - 6.0f, testH);
if (this.entity.hurtTime > 0) {
if (hud.particle.get()) {
this.spawnParticles(this.entity, posX, posY, headSize);
}
}
Fonts.sfMedium.drawText(eventDisplay.getMatrixStack(), this.entity.getName().getString(), posX + headSize + spacing + spacing, posY + spacing + 1.0f, -1, 8.0f);
int healthPercent = (int) ((hp + TargetInfoRenderer2.mc.player.getAbsorptionAmount()) / (maxHp + TargetInfoRenderer2.mc.player.getAbsorptionAmount()) * 100);
//Fonts.sfui.drawText(eventDisplay.getMatrixStack(), "" + ((int) healthPercent + "% "), posX - 23 + headSize + spacing + spacing + ((width - 42.0f) * this.healthAnimation), posY - 3 + height - spacing * 2.0f - 3.0f + spacing + 1.0f, ColorUtils.rgba(255,255,255,255),6.5F);
Scissor.unset();
Scissor.pop();
List<ItemStack> stacks = new ArrayList<>(Arrays.asList(entity.getHeldItemMainhand(), entity.getHeldItemOffhand()));
entity.getArmorInventoryList().forEach(stacks::add);
stacks.removeIf(w -> w.getItem() instanceof AirItem);
drawItemStack(posX + 36, posY + 19, 12);
if(hud.vibor.is("Радужная")) {
Vector4i vector4i3 = new Vector4i(ColorUtils.setAlpha(HUD.getColor(0), 64), ColorUtils.setAlpha(HUD.getColor(90), 64), ColorUtils.setAlpha(HUD.getColor(180), 64), ColorUtils.setAlpha(HUD.getColor(270), 64));
Vector4i vector4i = new Vector4i(HUD.getColor(0), HUD.getColor(90), HUD.getColor(180), HUD.getColor(270));
final Vector4i vector4i2 = new Vector4i(ColorUtils.setAlpha(HUD.getColor(0, 1), 64), ColorUtils.setAlpha(HUD.getColor(0, 1), 64), ColorUtils.setAlpha(HUD.getColor(90, 1), 64), ColorUtils.setAlpha(HUD.getColor(90, 1), 64));
DisplayUtils.drawRoundedRect(posX - 30f + headSize + spacing + spacing, posY + 13f + height - spacing * 2.0f - 3.0f, width - 15.0f, 5.0f, new Vector4f(4.0f, 4.0f, 4.0f, 4.0f), ColorUtils.rgb(32, 32, 32));
//DisplayUtils.drawShadow(posX - 30f + headSize + spacing + spacing, posY + 13f + height - spacing * 2.0f - 3.0f, (width - 15.0f) * this.healthAnimation, 5.0f, 8, HUD.getColor(0,1),HUD.getColor(90,1));
DisplayUtils.drawRoundedRect(posX - 30f + headSize + spacing + spacing, posY + 13f + height - spacing * 2.0f - 3.0f, (width - 15.0f) * this.healthAnimation, 5.0f, new Vector4f(4.0f, 4.0f, 4.0f, 4.0f), vector4i);
DisplayUtils.drawRoundedRect(posX - 30f + headSize + spacing + spacing, posY + 13f + height - spacing * 2.0f - 3.0f, (width - 15.0f) * this.healthAnimation2, 5.0f, new Vector4f(4.0f, 4.0f, 4.0f, 4.0f), vector4i3);
if (!ClientUtil.isConnectedToServer("funtime")) {
DisplayUtils.drawShadow(posX - 30f + headSize + spacing + spacing, posY + 13f + height - spacing * 2.0f - 3.0f, (width - 15.0f) * this.absorptionAnimation, 5.0f, 8, ColorUtils.rgba(236, 154, 17, 255), ColorUtils.rgba(228, 206, 5, 255));
DisplayUtils.drawRoundedRect(posX - 30f + headSize + spacing + spacing, posY + 13f + height - spacing * 2.0f - 3.0f, (width - 15.0f) * this.absorptionAnimation, 5.0f, new Vector4f(4.0f, 4.0f, 4.0f, 4.0f), new Vector4i(ColorUtils.rgba(236, 154, 17, 255), ColorUtils.rgba(236, 154, 17, 255), ColorUtils.rgba(228, 206, 5, 255), ColorUtils.rgba(228, 206, 5, 255)));
}
}else {
Vector4i vector4i3 = new Vector4i(ColorUtils.setAlpha(HUD.getColor(90), 64), ColorUtils.setAlpha(HUD.getColor(90), 64), ColorUtils.setAlpha(HUD.getColor(0), 64), ColorUtils.setAlpha(HUD.getColor(0), 64));
Vector4i vector4i = new Vector4i(HUD.getColor(90), HUD.getColor(90), HUD.getColor(0), HUD.getColor(0));
final Vector4i vector4i2 = new Vector4i(ColorUtils.setAlpha(HUD.getColor(0, 1), 64), ColorUtils.setAlpha(HUD.getColor(0, 1), 64), ColorUtils.setAlpha(HUD.getColor(90, 1), 64), ColorUtils.setAlpha(HUD.getColor(90, 1), 64));
DisplayUtils.drawRoundedRect(posX - 30f + headSize + spacing + spacing, posY + 13f + height - spacing * 2.0f - 3.0f, width - 15.0f, 5.0f, new Vector4f(4.0f, 4.0f, 4.0f, 4.0f), ColorUtils.rgb(32, 32, 32));
//DisplayUtils.drawShadow(posX - 30f + headSize + spacing + spacing, posY + 13f + height - spacing * 2.0f - 3.0f, (width - 15.0f) * this.healthAnimation, 5.0f, 8, HUD.getColor(0,1),HUD.getColor(90,1));
DisplayUtils.drawRoundedRect(posX - 30f + headSize + spacing + spacing, posY + 13f + height - spacing * 2.0f - 3.0f, (width - 15.0f) * this.healthAnimation, 5.0f, new Vector4f(4.0f, 4.0f, 4.0f, 4.0f), vector4i);
DisplayUtils.drawRoundedRect(posX - 30f + headSize + spacing + spacing, posY + 13f + height - spacing * 2.0f - 3.0f, (width - 15.0f) * this.healthAnimation2, 5.0f, new Vector4f(4.0f, 4.0f, 4.0f, 4.0f), vector4i3);
if (!ClientUtil.isConnectedToServer("funtime")) {
DisplayUtils.drawShadow(posX - 30f + headSize + spacing + spacing, posY + 13f + height - spacing * 2.0f - 3.0f, (width - 15.0f) * this.absorptionAnimation, 5.0f, 8, ColorUtils.rgba(236, 154, 17, 255), ColorUtils.rgba(228, 206, 5, 255));
DisplayUtils.drawRoundedRect(posX - 30f + headSize + spacing + spacing, posY + 13f + height - spacing * 2.0f - 3.0f, (width - 15.0f) * this.absorptionAnimation, 5.0f, new Vector4f(4.0f, 4.0f, 4.0f, 4.0f), new Vector4i(ColorUtils.rgba(236, 154, 17, 255), ColorUtils.rgba(236, 154, 17, 255), ColorUtils.rgba(228, 206, 5, 255), ColorUtils.rgba(228, 206, 5, 255)));
}
}

GlStateManager.popMatrix();
}
this.particleManager.update();
}
private void spawnParticles(LivingEntity entity, float posX, float posY, float headSize) {
if (Math.random() < 0.05) {
float velocityX = (float) (Math.random() * 0.2 - 0.1) * 12.5F;
float velocityY = (float) (Math.random() * 0.2 - 0.1) * 12.5F;
float scale = 0.5F;
ResourceLocation particleTexture = new ResourceLocation("Qwc/images/gray.png");
float randomOffsetX = (float) (Math.random() - 0.5) * headSize; // Уменьшено влияние headSize в 2 раза
float randomOffsetY = (float) (Math.random() - 0.5) * headSize; // Уменьшено влияние headSize в 2 раза
for (int i = 0; i <= 360F; i++) {
int color = HUD.getColor(i, 1);
Particle particle = new Particle(posX + headSize / 2 + randomOffsetX, posY + headSize / 2 + randomOffsetY, velocityX, velocityY, scale, particleTexture, 100, color);
particle.setFadeColor(color);
particle.setSliding(true);
this.particleManager.addParticle(particle);
}
}
}
private LivingEntity getTarget(final LivingEntity nullTarget) {
final LivingEntity auraTarget = Exo.getInstance().getFunctionRegistry().getKillAura().getTarget();
LivingEntity target = nullTarget;
if (auraTarget != null) {
this.stopWatch.reset();
this.allow = true;
target = auraTarget;
}
else if (TargetInfoRenderer2.mc.currentScreen instanceof ChatScreen) {
this.stopWatch.reset();
this.allow = true;
target = TargetInfoRenderer2.mc.player;
}
else {
this.allow = false;
}
return target;
}

public void drawTargetHead(final LivingEntity entity, final float x, final float y, final float width, final float height) {
if (entity != null) {
final EntityRenderer<? super LivingEntity> rendererManager = (EntityRenderer<? super LivingEntity>)TargetInfoRenderer2.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(final double width, final double height, final double scale) {
GlStateManager.translated(width, height, 0.0);
GlStateManager.scaled(scale, scale, scale);
GlStateManager.translated(-width, -height, 0.0);
}

public void drawFace(final ResourceLocation res, final float d, final float y, final float u, final float v, final float uWidth, final float vHeight, final float width, final float height, final float tileWidth, final float tileHeight, final LivingEntity target) {
GL11.glPushMatrix();
GL11.glEnable(3042);
TargetInfoRenderer2.mc.getTextureManager().bindTexture(res);
final float hurtPercent = (target.hurtTime - ((target.hurtTime != 0) ? TargetInfoRenderer2.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();
}

public TargetHUD3(final Dragging drag) {
this.stopWatch = new StopWatch();
this.entity = null;
this.animation = new EaseBackIn(400, 1.0, 1.0f);
this.healthAnimation = 0.0f;
this.healthAnimation2 = 0.0f;
this.absorptionAnimation = 0.0f;
this.drag = drag;
}
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 -> drawItemStack(stack,
posX.getAndAccumulate(offset, Float::sum),
y,
true,
true, 0.7f));
}
public static void drawItemStack(ItemStack stack, float x, float y, boolean withoutOverlay, boolean scale, float scaleValue) {
RenderSystem.pushMatrix();
RenderSystem.translatef(x, y, 0);
if (scale) GL11.glScaled(scaleValue, scaleValue, scaleValue);
mc.getItemRenderer().renderItemAndEffectIntoGUI(stack, 0, 0);
if (withoutOverlay) mc.getItemRenderer().renderItemOverlays(mc.fontRenderer, stack, 0, 0);
RenderSystem.popMatrix();
}
}
Если кто может скиньте :roflanEbalo: готовый текст
В таргет есп хз как, в таргет худев методе
private LivingEntity getTarget(final LivingEntity nullTarget) {
 
Начинающий
Статус
Оффлайн
Регистрация
10 Июл 2024
Сообщения
131
Реакции[?]
0
Поинты[?]
0
Начинающий
Статус
Оффлайн
Регистрация
12 Фев 2023
Сообщения
26
Реакции[?]
0
Поинты[?]
1K
Хотел чото визуальное сделать(без киллки без всего) и сделал такое, для легит игроков один минус - наводится на типов в инвизе, а так можете доделать с использованием киллки(тупо вставить мой код к своему методу)
Попытка залить номер 2 потому что модеры отклонили тему из за того что нет скрина для даже НЕ ВИЗУАЛЬНОЙ работы
SS =
Вставляете код в метод getTarget в TargetESP

TargetESP:
private LivingEntity getTarget(LivingEntity nullTarget) {
        RayTraceResult rayTraceResult = mc.objectMouseOver;
        LivingEntity newTarget = nullTarget;

        if (rayTraceResult != null && rayTraceResult.getType() == RayTraceResult.Type.ENTITY) {
            Entity entityHit = ((EntityRayTraceResult) rayTraceResult).getEntity();
            if (entityHit instanceof LivingEntity) {
                newTarget = (LivingEntity) entityHit;
                if (target != newTarget) {
                    target = newTarget;
                    stopWatch.reset();
                    allow = true;
                }
            }
        }
        else if (target != null && stopWatch.getElapsedTime() <= 3000) {
            double distanceToTarget = mc.player.getDistance(target);
            if (distanceToTarget <= 4) {
                newTarget = target;
            } else {
                target = null;
                allow = false;
            }
        }
        else if (stopWatch.getElapsedTime() > 3000) {
            target = null;
            allow = false;
        }
        else if (mc.currentScreen instanceof ChatScreen) {
            newTarget = mc.player;
            stopWatch.reset();
            allow = true;
        } else {
            target = null;
            allow = false;
        }

        return newTarget;
    }
В ваш таргет-худ в методе getTarget вставляете
TargetHUD:
private LivingEntity getTarget(LivingEntity currentTarget) {
        RayTraceResult rayTraceResult = mc.objectMouseOver;
        LivingEntity target = currentTarget;
      
        if (rayTraceResult != null && rayTraceResult.getType() == RayTraceResult.Type.ENTITY) {
            Entity entityHit = ((EntityRayTraceResult) rayTraceResult).getEntity();
            if (entityHit instanceof LivingEntity) {
                LivingEntity potentialTarget = (LivingEntity) entityHit;
              
                double distanceToTarget = mc.player.getDistance(potentialTarget);
                if (distanceToTarget <= 4.0) {
                    target = potentialTarget;
                    stopWatch.reset();
                    allow = true;
                } else {
                    allow = false;
                }
            }
        } else if (mc.currentScreen instanceof ChatScreen) {
            target = mc.player;
            stopWatch.reset();
            allow = true;
        } else if (stopWatch.isReached(4000)) {
            target = null;
            allow = false;
        }
        return target;
    }
При открытии чата в обоих методах таргет будет установлен на Вас в независимости от наводки, таргет пропадает если вы отходите за 4+ блока или не аимитесь на игрока 3-4 секунды
Я убирал нерабочий функционал скрытия таргета при инвизе у игрока, по этому могут быть баги, жду их под темой если есть
UPD: В StopWatch вставьте метод

Java:
public long getElapsedTime() {
        return System.currentTimeMillis() - lastMS;
    }
можно легче написать
 
Начинающий
Статус
Онлайн
Регистрация
6 Дек 2023
Сообщения
215
Реакции[?]
0
Поинты[?]
0
Сверху Снизу