Исходник Адекватный Hud exp 2.0

Начинающий
Статус
Оффлайн
Регистрация
24 Окт 2021
Сообщения
134
Реакции[?]
1
Поинты[?]
1K

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

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

Спасибо!

Кароч всё как обычно делал Я + ChatGPT
Пытался сделать скид данной темы, но на 2.0. Знаю, не похоже, но всё же.
Пожалуйста, авторизуйтесь для просмотра ссылки.

Java:
package wtf.expensive.modules.impl.render;

import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.platform.GlStateManager;
import net.minecraft.client.MainWindow;
import net.minecraft.client.entity.player.AbstractClientPlayerEntity;
import net.minecraft.client.gui.screen.ChatScreen;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.AirItem;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.EffectInstance;
import net.minecraft.potion.EffectUtils;
import net.minecraft.scoreboard.ScorePlayerTeam;
import net.minecraft.scoreboard.Team;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector4f;
import net.minecraft.util.text.ITextComponent;
import org.joml.Vector4i;
import wtf.expensive.Initilization;
import wtf.expensive.events.Event;
import wtf.expensive.events.impl.player.EventUpdate;
import wtf.expensive.events.impl.render.EventRender;
import wtf.expensive.managment.Managment;
import wtf.expensive.modules.Function;
import wtf.expensive.modules.FunctionAnnotation;
import wtf.expensive.modules.Type;
import wtf.expensive.modules.settings.imp.BooleanOption;
import wtf.expensive.modules.settings.imp.MultiBoxSetting;
import wtf.expensive.modules.settings.imp.SliderSetting;
import wtf.expensive.util.BetterText;
import wtf.expensive.util.ClientUtil;
import wtf.expensive.util.animations.Animation;
import wtf.expensive.util.animations.Direction;
import wtf.expensive.util.animations.impl.EaseBackIn;
import wtf.expensive.util.drag.Dragging;
import wtf.expensive.util.font.Fonts;
import wtf.expensive.util.font.styled.StyledFont;
import wtf.expensive.util.math.MathUtil;
import wtf.expensive.util.misc.HudUtil;
import wtf.expensive.util.render.BloomHelper;
import wtf.expensive.util.render.ColorUtil;
import wtf.expensive.util.render.RenderUtil;
import wtf.expensive.util.render.animation.AnimationMath;

import java.awt.*;
import java.util.*;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
import java.util.regex.Pattern;

import static wtf.expensive.util.render.RenderUtil.Render2D.drawFace;

@FunctionAnnotation(name = "HUD", type = Type.Render)
public class HUD2 extends Function {

public final MultiBoxSetting elements = new MultiBoxSetting("Элементы",
new BooleanOption("Ватермарка", true),
new BooleanOption("Активные функции", true),
new BooleanOption("Координаты", true),
new BooleanOption("Активный таргет", true),
new BooleanOption("Активные стаффы", true),
new BooleanOption("Активные бинды", true),
new BooleanOption("Активные эффекты", true),
new BooleanOption("Уведомления", true)
);

public final BooleanOption shadow = new BooleanOption("Тень", true);

private final SliderSetting offset = new SliderSetting("Отступ", 5, 1, 10, 1);

public HUD2() {
addSettings(elements, shadow, offset);
}

final float round_degree = 3;

final float cWidth = 4;

final Vector4f left_vec = new Vector4f(round_degree, round_degree, 0, 0);
final Vector4f right_vec = new Vector4f(0, 0, round_degree, round_degree);

final int b_color = new Color(0, 0, 0, 128).getRGB();
final int t_color = Color.WHITE.getRGB();

int[] colors = new int[360];

final StyledFont icons = Fonts.icons1[20];
final StyledFont medium = Fonts.msMedium[16];
final StyledFont small = Fonts.msMedium[14];

MainWindow window;

List<Function> functions = new ArrayList<>();

final Dragging keyBinds = Initilization.createDrag(this, "KeyBinds-new", 10, 100);
final Dragging staffList = Initilization.createDrag(this, "StaffList-new", 10, 200);

final Dragging targetHUD = Initilization.createDrag(this, "TargetHUD-new", 10, 300);
final Dragging timerHUD = Initilization.createDrag(this, "TimerHUD-new", 10, 400);

Animation tHudAnimation = new EaseBackIn(400, 1, 1.5f);
PlayerEntity target = null;

private final Pattern namePattern = Pattern.compile("^\\w{3,16}$");
private final Pattern prefixMatches = Pattern.compile(".*(mod|der|adm|help|wne|мод|хелп|помо|адм|владе|отри|таф|taf|curat|курато|dev|раз|supp|сапп|yt|ютуб).*");

private final Map<ITextComponent, String> staffPlayers = new LinkedHashMap<>();

@Override
public void onEvent(Event event) {
if (mc.player == null || mc.world == null) return;

if (event instanceof EventUpdate) {
staffPlayers.clear();

for (ScorePlayerTeam team : mc.world.getScoreboard().getTeams().stream().sorted(Comparator.comparing(Team::getName)).toList()) {
String name = team.getMembershipCollection().toString();
name = name.substring(1, name.length() - 1);
if (namePattern.matcher(name).matches()) {
if (prefixMatches.matcher(team.getPrefix().getString().toLowerCase(Locale.ROOT)).matches() || Managment.STAFF_MANAGER.isStaff(name)) {
staffPlayers.put(team.getPrefix(), name);
}
}
}

if (Managment.FUNCTION_MANAGER.getFunctions().isEmpty() || !functions.isEmpty()) return;
updateFunctions();
}

if (event instanceof EventRender e && e.isRender2D()) {
for (int i = 0; i < colors.length; i++) {
colors[i] = Managment.STYLE_MANAGER.getCurrentStyle().getColor(i);
}

window = e.scaledResolution;

final int offset = this.offset.getValue().intValue();
final MatrixStack matrixStack = e.matrixStack;

if (elements.get(0)) renderWatermark(matrixStack, offset);
if (elements.get(1)) renderFunctions(matrixStack, offset);
if (elements.get(2)) renderCoordinates(matrixStack, offset);
if (elements.get(3)) renderTarget(matrixStack);
if (elements.get(4)) renderStaffList(matrixStack);
if (elements.get(5)) renderKeyBinds(matrixStack);
if (elements.get(6)) renderPotions(matrixStack, offset);
}
}

BetterText betterText = new BetterText(List.of("",
"Лучший из лучших",
"Всегда на высоте",
"Наивысший стандарт качества",
"Лучший выбор",
"Всегда превосходно",
"Надежно и качественно"), 2000);

private void renderWatermark(MatrixStack matrixStack, int offset) {
float staticTextWidth = Fonts.msSemiBold[15].getWidth("Expensive");
float animatedTextWidth = Fonts.msSemiBold[15].getWidth(betterText.output);
float maxWidth = Math.max(staticTextWidth, animatedTextWidth);
float width = Math.max(80, maxWidth + 20);
float height = 28;
float roundDegree = 6.0f;

int backgroundColor = ColorUtil.rgba(0, 0, 0, 150);

RenderUtil.Render2D.drawRoundedRect(offset, offset, width, height, roundDegree, backgroundColor);

if (shadow.get()) {
RenderUtil.Render2D.drawShadow(offset - 1, offset - 1, width + 2, height + 2, 8, RenderUtil.reAlphaInt(b_color, 50));
}

Fonts.msSemiBold[15].drawString(matrixStack, "Expensive", offset + 10, offset + 6f, t_color);
Fonts.msSemiBold[15].drawString(matrixStack, betterText.output, offset + 10, offset + 18f, t_color);
}

private void renderFunctions(MatrixStack matrixStack, int offset) {
float padding = 4;
float dumbOffset = 1.5f;
float height = small.getFontHeight() - dumbOffset + padding;
float roundDegree = 6.0f;

int backgroundColor = ColorUtil.rgba(0, 0, 0, 150);

List<Function> fs = new ArrayList<>();
for (Function f : functions) {
f.animation = AnimationMath.fast(f.animation, f.state ? 1 : 0, 15);
if (f.animation < 0.1) continue;
fs.add(f);
}

float index = 0;
for (Function f : fs) {
float width = small.getWidth(f.name) + (padding * 2);
float r_posX = window.scaledWidth() - offset - width;
float r_posY = offset + (index * height);

RenderUtil.Render2D.drawRoundedRect(r_posX - cWidth, r_posY, width, height, roundDegree, backgroundColor);

if (shadow.get()) {
RenderUtil.Render2D.drawShadow(r_posX - cWidth - 1, r_posY - 1, width + 2, height + 2, 8, RenderUtil.reAlphaInt(b_color, 50));
}

small.drawCenteredString(matrixStack, f.name, r_posX + width / 2 - cWidth, r_posY - dumbOffset + (height / 2), -1);
index += f.animation;
}
}

private void renderPotions(MatrixStack matrixStack, int offset) {
float height = 12;
float posY = window.scaledHeight() - offset - height;
float roundDegree = 6.0f;

int backgroundColor = ColorUtil.rgba(0, 0, 0, 150);

int index = 0;
for (EffectInstance eff : mc.player.getActivePotionEffects().stream().sorted(Comparator.comparing(EffectInstance::getDuration)).toList()) {
String text = I18n.format(eff.getEffectName()) + " " + I18n.format("enchantment.level." + (eff.getAmplifier() + 1)) + " - " + EffectUtils.getPotionDurationString(eff, 1);
float textWidth = small.getWidth(text) + 12;
float posX = window.scaledWidth() - offset - textWidth;

RenderUtil.Render2D.drawRoundedRect(posX, posY - (index * 16), textWidth, height, roundDegree, backgroundColor);

if (shadow.get()) {
RenderUtil.Render2D.drawShadow(posX - 1, posY - (index * 16) - 1, textWidth + 2, height + 2, 8, RenderUtil.reAlphaInt(b_color, 50));
}

small.drawString(matrixStack, text, posX + 4, posY - (index * 16) + 4.5f, t_color);
index++;
}
}

float kbHeight = 0;
float kbWidth = 100;

float kbWidthAnimation = 0, kbHeightAnimation = 0;

private void renderKeyBinds(MatrixStack matrixStack) {
float posX = keyBinds.getX();
float posY = keyBinds.getY();
float roundDegree = 6.0f;

int backgroundColor = ColorUtil.rgba(0, 0, 0, 150);

RenderUtil.Render2D.drawRoundedRect(posX, posY, kbWidthAnimation, kbHeightAnimation, roundDegree, backgroundColor);

if (shadow.get()) {
RenderUtil.Render2D.drawShadow(posX - 1, posY - 1, kbWidthAnimation + 2, kbHeightAnimation + 2, 8, RenderUtil.reAlphaInt(b_color, 50));
}

float titleWidth = Fonts.msSemiBold[15].getWidth("HotKeys");
Fonts.msSemiBold[15].drawCenteredString(matrixStack, "HotKeys", posX + kbWidthAnimation / 2, posY + 6, ColorUtil.rgba(255, 255, 255, 255));

RenderUtil.SmartScissor.push();
RenderUtil.SmartScissor.setFromComponentCoordinates(posX, posY, kbWidthAnimation, kbHeightAnimation);

int i = 0;
for (Function f : Managment.FUNCTION_MANAGER.getFunctions()) {
if (!f.state || f.bind == 0) continue;

String text = ClientUtil.getKey(f.bind);
if (text.length() > 4) {
text = text.substring(0, 4) + "..";
}
String bindText = "[" + text.toUpperCase() + "]";
float bindWidth = small.getWidth(bindText);
String name = f.name;
if (name.length() > 10) {
name = name.substring(0, 10) + "..";
}

kbWidth = Math.max(small.getWidth(bindText + f.bind + 5), 85);

Fonts.msMedium[12].drawString(matrixStack, name, posX + 5, posY + 18 + (i * 10), ColorUtil.rgba(255, 255, 255, 255));
Fonts.msMedium[12].drawString(matrixStack, bindText, posX + kbWidthAnimation - bindWidth - 5, posY + 18.5f + (i * 10), ColorUtil.rgba(255, 255, 255, 255));

i++;
}
RenderUtil.SmartScissor.unset();
RenderUtil.SmartScissor.pop();

kbHeight = 18 + (i * 10);
this.kbHeightAnimation = AnimationMath.fast(this.kbHeightAnimation, kbHeight, 10);
this.kbWidthAnimation = AnimationMath.fast(this.kbWidthAnimation, kbWidth, 10);

keyBinds.setWidth(kbWidth);
keyBinds.setHeight(kbHeight);
}

float slHeight = 0;
float lsWidth = 100;

private void renderStaffList(MatrixStack matrixStack) {
float posX = staffList.getX();
float posY = staffList.getY();
float roundDegree = 6.0f;

int backgroundColor = ColorUtil.rgba(0, 0, 0, 150);

RenderUtil.Render2D.drawRoundedRect(posX, posY, lsWidth, slHeight, roundDegree, backgroundColor);

if (shadow.get()) {
RenderUtil.Render2D.drawShadow(posX - 1, posY - 1, lsWidth + 2, slHeight + 2, 8, RenderUtil.reAlphaInt(b_color, 50));
}

Fonts.msSemiBold[15].drawCenteredString(matrixStack, "StaffList", posX + lsWidth / 2, posY + 6, t_color);

int i = 0;
for (Map.Entry<ITextComponent, String> entry : staffPlayers.entrySet()) {
ITextComponent p = entry.getKey();
String n = entry.getValue();

float len = Math.max(small.getWidth(p.getString() + n + cWidth), 85);

if (len > lsWidth) lsWidth = len;

small.drawString(matrixStack, p, posX + 4, posY + 18 + (i * 10), t_color);
small.drawString(matrixStack, n, posX + small.getWidth(p.getString()) + 4, posY + 18 + (i * 10), t_color);

i++;
}

slHeight = 18 + (i * 10);
staffList.setWidth(lsWidth);
staffList.setHeight(slHeight);
}

float health = 0;

private double scale = 0.0D;

private void renderTarget(MatrixStack matrixStack) {
float posX = targetHUD.getX();
float posY = targetHUD.getY();
float roundDegree = 8.0f;

int backgroundColor = ColorUtil.rgba(0, 0, 0, 150);

float width = 115;
float height = 40;
targetHUD.setWidth(width);
targetHUD.setHeight(height);

this.target = getTarget(this.target);
this.scale = tHudAnimation.getOutput();

if (scale == 0.0F) {
target = null;
}

if (target == null) {
return;
}

String targetName = this.target.getName().getString();
String substring = targetName.substring(0, Math.min(targetName.length(), 10));
this.health = AnimationMath.fast(health, target.getHealth() / target.getMaxHealth(), 5);
this.health = MathHelper.clamp(this.health, 0, 1);
String healthValue = "HP: " + (int) MathUtil.round(this.health * 20 + target.getAbsorptionAmount(), 0.5f);

GlStateManager.pushMatrix();
AnimationMath.sizeAnimation(posX + (width / 2), posY + (height / 2), scale);
RenderUtil.Render2D.drawRoundedRect(posX, posY, width, height, roundDegree, backgroundColor);

if (shadow.get()) {
RenderUtil.Render2D.drawShadow(posX - 1, posY - 1, width + 2, height + 2, 8, RenderUtil.reAlphaInt(b_color, 50));
}

drawFace(posX + 5, posY + 5, 8F, 8F, 8F, 8F, 30, 30, 64F, 64F, (AbstractClientPlayerEntity) target);

medium.drawString(matrixStack, substring, posX + 40, posY + 8, t_color);
Fonts.msSemiBold[13].drawString(matrixStack, healthValue, posX + 40, posY + 20, t_color);

int healthColor = ColorUtil.rgba(100, 149, 237, 255);

RenderUtil.Render2D.drawRoundedCorner(posX + 40, posY + 30.5f, 70 * health, 4.0f, new Vector4f(4, 4, 4, 4), healthColor);
GlStateManager.popMatrix();
}

private void drawItemStack(float x, float y, float offset) {
List<ItemStack> stacks = new ArrayList<>(Arrays.asList(target.getHeldItemMainhand(), target.getHeldItemOffhand()));
target.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 -> HudUtil.drawItemStack(stack,
posX.getAndAccumulate(offset, Float::sum),
y,
true,
true, 0.6f));
}

private float perc;

private void renderTimer(MatrixStack matrixStack) {
float posX = timerHUD.getX();
float posY = timerHUD.getY();
float roundDegree = 6.0f;

int backgroundColor = ColorUtil.rgba(0, 0, 0, 150);

float quotient = Managment.FUNCTION_MANAGER.timerFunction.maxViolation / Managment.FUNCTION_MANAGER.timerFunction.timerAmount.getValue().floatValue();
float minimumValue = Math.min(Managment.FUNCTION_MANAGER.timerFunction.getViolation(), quotient);
perc = AnimationMath.lerp(perc, ((quotient - minimumValue) / quotient), 10);

String text = (int) (perc * 100) + "%";
float width = 100;
timerHUD.setWidth(width);
timerHUD.setHeight(20);

RenderUtil.Render2D.drawRoundedRect(posX, posY, width, 20, roundDegree, backgroundColor);

if (shadow.get()) {
RenderUtil.Render2D.drawShadow(posX - 1, posY - 1, width + 2, 20 + 2, 8, RenderUtil.reAlphaInt(b_color, 50));
}

Fonts.msSemiBold[15].drawCenteredString(matrixStack, "Timer", posX + width / 2, posY + 5, t_color);
Fonts.msSemiBold[15].drawCenteredString(matrixStack, text, posX + width / 2, posY + 15, t_color);

RenderUtil.Render2D.drawRoundedCorner(posX, posY + 20 - 6, width * perc, 6, new Vector4f(0, roundDegree, perc == 1 ? 0 : roundDegree, roundDegree), new Vector4i(getColor(100), getColor(100), getColor(0), getColor(0)));
}

private void renderCoordinates(MatrixStack matrixStack, int offset) {
String[] texts = new String[]{
"Coords: " + (int) mc.player.getPosX() + ", " + (int) mc.player.getPosY() + ", " + (int) mc.player.getPosZ(),
"BPS: " + (String.format("%.2f", Math.hypot(mc.player.getPosX() - mc.player.prevPosX, mc.player.getPosZ() - mc.player.prevPosZ) * 20))
};

float roundDegree = 6.0f;
int backgroundColor = ColorUtil.rgba(0, 0, 0, 150);

float of = 0;
for (String text : texts) {
float textWidth = medium.getWidth(text) + 16;
float height = 16;
float posY = window.scaledHeight() - height - offset - of;

RenderUtil.Render2D.drawRoundedRect(offset, posY, textWidth, height, roundDegree, backgroundColor);

if (shadow.get()) {
RenderUtil.Render2D.drawShadow(offset - 1, posY - 1, textWidth + 2, height + 2, 8, RenderUtil.reAlphaInt(b_color, 50));
}

Fonts.msSemiBold[15].drawCenteredString(matrixStack, text, offset + textWidth / 2, posY + 5.5f, t_color);
of += height + 3;
}
}

private PlayerEntity getTarget(PlayerEntity nullTarget) {
PlayerEntity target = nullTarget;

if (Managment.FUNCTION_MANAGER.auraFunction.getTarget() instanceof PlayerEntity) {
target = (PlayerEntity) Managment.FUNCTION_MANAGER.auraFunction.getTarget();
tHudAnimation.setDirection(Direction.FORWARDS);
} else if (mc.currentScreen instanceof ChatScreen) {
target = mc.player;
tHudAnimation.setDirection(Direction.FORWARDS);
} else {
tHudAnimation.setDirection(Direction.BACKWARDS);
}

return target;
}

private void updateFunctions() {
for (Function function : Managment.FUNCTION_MANAGER.getFunctions()) {
if (function.category == Type.Render) continue;

functions.add(function);
}

functions.sort((f1, f2) -> Float.compare(small.getWidth(f2.name), small.getWidth(f1.name)));
}

private int getColor(int index) {
return colors[index % colors.length];
}
}
 
Начинающий
Статус
Оффлайн
Регистрация
19 Июл 2023
Сообщения
23
Реакции[?]
0
Поинты[?]
0
Кароч всё как обычно делал Я + ChatGPT
Пытался сделать скид данной темы, но на 2.0. Знаю, не похоже, но всё же.
Пожалуйста, авторизуйтесь для просмотра ссылки.

Java:
package wtf.expensive.modules.impl.render;

import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.platform.GlStateManager;
import net.minecraft.client.MainWindow;
import net.minecraft.client.entity.player.AbstractClientPlayerEntity;
import net.minecraft.client.gui.screen.ChatScreen;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.AirItem;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.EffectInstance;
import net.minecraft.potion.EffectUtils;
import net.minecraft.scoreboard.ScorePlayerTeam;
import net.minecraft.scoreboard.Team;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector4f;
import net.minecraft.util.text.ITextComponent;
import org.joml.Vector4i;
import wtf.expensive.Initilization;
import wtf.expensive.events.Event;
import wtf.expensive.events.impl.player.EventUpdate;
import wtf.expensive.events.impl.render.EventRender;
import wtf.expensive.managment.Managment;
import wtf.expensive.modules.Function;
import wtf.expensive.modules.FunctionAnnotation;
import wtf.expensive.modules.Type;
import wtf.expensive.modules.settings.imp.BooleanOption;
import wtf.expensive.modules.settings.imp.MultiBoxSetting;
import wtf.expensive.modules.settings.imp.SliderSetting;
import wtf.expensive.util.BetterText;
import wtf.expensive.util.ClientUtil;
import wtf.expensive.util.animations.Animation;
import wtf.expensive.util.animations.Direction;
import wtf.expensive.util.animations.impl.EaseBackIn;
import wtf.expensive.util.drag.Dragging;
import wtf.expensive.util.font.Fonts;
import wtf.expensive.util.font.styled.StyledFont;
import wtf.expensive.util.math.MathUtil;
import wtf.expensive.util.misc.HudUtil;
import wtf.expensive.util.render.BloomHelper;
import wtf.expensive.util.render.ColorUtil;
import wtf.expensive.util.render.RenderUtil;
import wtf.expensive.util.render.animation.AnimationMath;

import java.awt.*;
import java.util.*;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
import java.util.regex.Pattern;

import static wtf.expensive.util.render.RenderUtil.Render2D.drawFace;

@FunctionAnnotation(name = "HUD", type = Type.Render)
public class HUD2 extends Function {

public final MultiBoxSetting elements = new MultiBoxSetting("Элементы",
new BooleanOption("Ватермарка", true),
new BooleanOption("Активные функции", true),
new BooleanOption("Координаты", true),
new BooleanOption("Активный таргет", true),
new BooleanOption("Активные стаффы", true),
new BooleanOption("Активные бинды", true),
new BooleanOption("Активные эффекты", true),
new BooleanOption("Уведомления", true)
);

public final BooleanOption shadow = new BooleanOption("Тень", true);

private final SliderSetting offset = new SliderSetting("Отступ", 5, 1, 10, 1);

public HUD2() {
addSettings(elements, shadow, offset);
}

final float round_degree = 3;

final float cWidth = 4;

final Vector4f left_vec = new Vector4f(round_degree, round_degree, 0, 0);
final Vector4f right_vec = new Vector4f(0, 0, round_degree, round_degree);

final int b_color = new Color(0, 0, 0, 128).getRGB();
final int t_color = Color.WHITE.getRGB();

int[] colors = new int[360];

final StyledFont icons = Fonts.icons1[20];
final StyledFont medium = Fonts.msMedium[16];
final StyledFont small = Fonts.msMedium[14];

MainWindow window;

List<Function> functions = new ArrayList<>();

final Dragging keyBinds = Initilization.createDrag(this, "KeyBinds-new", 10, 100);
final Dragging staffList = Initilization.createDrag(this, "StaffList-new", 10, 200);

final Dragging targetHUD = Initilization.createDrag(this, "TargetHUD-new", 10, 300);
final Dragging timerHUD = Initilization.createDrag(this, "TimerHUD-new", 10, 400);

Animation tHudAnimation = new EaseBackIn(400, 1, 1.5f);
PlayerEntity target = null;

private final Pattern namePattern = Pattern.compile("^\\w{3,16}$");
private final Pattern prefixMatches = Pattern.compile(".*(mod|der|adm|help|wne|мод|хелп|помо|адм|владе|отри|таф|taf|curat|курато|dev|раз|supp|сапп|yt|ютуб).*");

private final Map<ITextComponent, String> staffPlayers = new LinkedHashMap<>();

@Override
public void onEvent(Event event) {
if (mc.player == null || mc.world == null) return;

if (event instanceof EventUpdate) {
staffPlayers.clear();

for (ScorePlayerTeam team : mc.world.getScoreboard().getTeams().stream().sorted(Comparator.comparing(Team::getName)).toList()) {
String name = team.getMembershipCollection().toString();
name = name.substring(1, name.length() - 1);
if (namePattern.matcher(name).matches()) {
if (prefixMatches.matcher(team.getPrefix().getString().toLowerCase(Locale.ROOT)).matches() || Managment.STAFF_MANAGER.isStaff(name)) {
staffPlayers.put(team.getPrefix(), name);
}
}
}

if (Managment.FUNCTION_MANAGER.getFunctions().isEmpty() || !functions.isEmpty()) return;
updateFunctions();
}

if (event instanceof EventRender e && e.isRender2D()) {
for (int i = 0; i < colors.length; i++) {
colors[i] = Managment.STYLE_MANAGER.getCurrentStyle().getColor(i);
}

window = e.scaledResolution;

final int offset = this.offset.getValue().intValue();
final MatrixStack matrixStack = e.matrixStack;

if (elements.get(0)) renderWatermark(matrixStack, offset);
if (elements.get(1)) renderFunctions(matrixStack, offset);
if (elements.get(2)) renderCoordinates(matrixStack, offset);
if (elements.get(3)) renderTarget(matrixStack);
if (elements.get(4)) renderStaffList(matrixStack);
if (elements.get(5)) renderKeyBinds(matrixStack);
if (elements.get(6)) renderPotions(matrixStack, offset);
}
}

BetterText betterText = new BetterText(List.of("",
"Лучший из лучших",
"Всегда на высоте",
"Наивысший стандарт качества",
"Лучший выбор",
"Всегда превосходно",
"Надежно и качественно"), 2000);

private void renderWatermark(MatrixStack matrixStack, int offset) {
float staticTextWidth = Fonts.msSemiBold[15].getWidth("Expensive");
float animatedTextWidth = Fonts.msSemiBold[15].getWidth(betterText.output);
float maxWidth = Math.max(staticTextWidth, animatedTextWidth);
float width = Math.max(80, maxWidth + 20);
float height = 28;
float roundDegree = 6.0f;

int backgroundColor = ColorUtil.rgba(0, 0, 0, 150);

RenderUtil.Render2D.drawRoundedRect(offset, offset, width, height, roundDegree, backgroundColor);

if (shadow.get()) {
RenderUtil.Render2D.drawShadow(offset - 1, offset - 1, width + 2, height + 2, 8, RenderUtil.reAlphaInt(b_color, 50));
}

Fonts.msSemiBold[15].drawString(matrixStack, "Expensive", offset + 10, offset + 6f, t_color);
Fonts.msSemiBold[15].drawString(matrixStack, betterText.output, offset + 10, offset + 18f, t_color);
}

private void renderFunctions(MatrixStack matrixStack, int offset) {
float padding = 4;
float dumbOffset = 1.5f;
float height = small.getFontHeight() - dumbOffset + padding;
float roundDegree = 6.0f;

int backgroundColor = ColorUtil.rgba(0, 0, 0, 150);

List<Function> fs = new ArrayList<>();
for (Function f : functions) {
f.animation = AnimationMath.fast(f.animation, f.state ? 1 : 0, 15);
if (f.animation < 0.1) continue;
fs.add(f);
}

float index = 0;
for (Function f : fs) {
float width = small.getWidth(f.name) + (padding * 2);
float r_posX = window.scaledWidth() - offset - width;
float r_posY = offset + (index * height);

RenderUtil.Render2D.drawRoundedRect(r_posX - cWidth, r_posY, width, height, roundDegree, backgroundColor);

if (shadow.get()) {
RenderUtil.Render2D.drawShadow(r_posX - cWidth - 1, r_posY - 1, width + 2, height + 2, 8, RenderUtil.reAlphaInt(b_color, 50));
}

small.drawCenteredString(matrixStack, f.name, r_posX + width / 2 - cWidth, r_posY - dumbOffset + (height / 2), -1);
index += f.animation;
}
}

private void renderPotions(MatrixStack matrixStack, int offset) {
float height = 12;
float posY = window.scaledHeight() - offset - height;
float roundDegree = 6.0f;

int backgroundColor = ColorUtil.rgba(0, 0, 0, 150);

int index = 0;
for (EffectInstance eff : mc.player.getActivePotionEffects().stream().sorted(Comparator.comparing(EffectInstance::getDuration)).toList()) {
String text = I18n.format(eff.getEffectName()) + " " + I18n.format("enchantment.level." + (eff.getAmplifier() + 1)) + " - " + EffectUtils.getPotionDurationString(eff, 1);
float textWidth = small.getWidth(text) + 12;
float posX = window.scaledWidth() - offset - textWidth;

RenderUtil.Render2D.drawRoundedRect(posX, posY - (index * 16), textWidth, height, roundDegree, backgroundColor);

if (shadow.get()) {
RenderUtil.Render2D.drawShadow(posX - 1, posY - (index * 16) - 1, textWidth + 2, height + 2, 8, RenderUtil.reAlphaInt(b_color, 50));
}

small.drawString(matrixStack, text, posX + 4, posY - (index * 16) + 4.5f, t_color);
index++;
}
}

float kbHeight = 0;
float kbWidth = 100;

float kbWidthAnimation = 0, kbHeightAnimation = 0;

private void renderKeyBinds(MatrixStack matrixStack) {
float posX = keyBinds.getX();
float posY = keyBinds.getY();
float roundDegree = 6.0f;

int backgroundColor = ColorUtil.rgba(0, 0, 0, 150);

RenderUtil.Render2D.drawRoundedRect(posX, posY, kbWidthAnimation, kbHeightAnimation, roundDegree, backgroundColor);

if (shadow.get()) {
RenderUtil.Render2D.drawShadow(posX - 1, posY - 1, kbWidthAnimation + 2, kbHeightAnimation + 2, 8, RenderUtil.reAlphaInt(b_color, 50));
}

float titleWidth = Fonts.msSemiBold[15].getWidth("HotKeys");
Fonts.msSemiBold[15].drawCenteredString(matrixStack, "HotKeys", posX + kbWidthAnimation / 2, posY + 6, ColorUtil.rgba(255, 255, 255, 255));

RenderUtil.SmartScissor.push();
RenderUtil.SmartScissor.setFromComponentCoordinates(posX, posY, kbWidthAnimation, kbHeightAnimation);

int i = 0;
for (Function f : Managment.FUNCTION_MANAGER.getFunctions()) {
if (!f.state || f.bind == 0) continue;

String text = ClientUtil.getKey(f.bind);
if (text.length() > 4) {
text = text.substring(0, 4) + "..";
}
String bindText = "[" + text.toUpperCase() + "]";
float bindWidth = small.getWidth(bindText);
String name = f.name;
if (name.length() > 10) {
name = name.substring(0, 10) + "..";
}

kbWidth = Math.max(small.getWidth(bindText + f.bind + 5), 85);

Fonts.msMedium[12].drawString(matrixStack, name, posX + 5, posY + 18 + (i * 10), ColorUtil.rgba(255, 255, 255, 255));
Fonts.msMedium[12].drawString(matrixStack, bindText, posX + kbWidthAnimation - bindWidth - 5, posY + 18.5f + (i * 10), ColorUtil.rgba(255, 255, 255, 255));

i++;
}
RenderUtil.SmartScissor.unset();
RenderUtil.SmartScissor.pop();

kbHeight = 18 + (i * 10);
this.kbHeightAnimation = AnimationMath.fast(this.kbHeightAnimation, kbHeight, 10);
this.kbWidthAnimation = AnimationMath.fast(this.kbWidthAnimation, kbWidth, 10);

keyBinds.setWidth(kbWidth);
keyBinds.setHeight(kbHeight);
}

float slHeight = 0;
float lsWidth = 100;

private void renderStaffList(MatrixStack matrixStack) {
float posX = staffList.getX();
float posY = staffList.getY();
float roundDegree = 6.0f;

int backgroundColor = ColorUtil.rgba(0, 0, 0, 150);

RenderUtil.Render2D.drawRoundedRect(posX, posY, lsWidth, slHeight, roundDegree, backgroundColor);

if (shadow.get()) {
RenderUtil.Render2D.drawShadow(posX - 1, posY - 1, lsWidth + 2, slHeight + 2, 8, RenderUtil.reAlphaInt(b_color, 50));
}

Fonts.msSemiBold[15].drawCenteredString(matrixStack, "StaffList", posX + lsWidth / 2, posY + 6, t_color);

int i = 0;
for (Map.Entry<ITextComponent, String> entry : staffPlayers.entrySet()) {
ITextComponent p = entry.getKey();
String n = entry.getValue();

float len = Math.max(small.getWidth(p.getString() + n + cWidth), 85);

if (len > lsWidth) lsWidth = len;

small.drawString(matrixStack, p, posX + 4, posY + 18 + (i * 10), t_color);
small.drawString(matrixStack, n, posX + small.getWidth(p.getString()) + 4, posY + 18 + (i * 10), t_color);

i++;
}

slHeight = 18 + (i * 10);
staffList.setWidth(lsWidth);
staffList.setHeight(slHeight);
}

float health = 0;

private double scale = 0.0D;

private void renderTarget(MatrixStack matrixStack) {
float posX = targetHUD.getX();
float posY = targetHUD.getY();
float roundDegree = 8.0f;

int backgroundColor = ColorUtil.rgba(0, 0, 0, 150);

float width = 115;
float height = 40;
targetHUD.setWidth(width);
targetHUD.setHeight(height);

this.target = getTarget(this.target);
this.scale = tHudAnimation.getOutput();

if (scale == 0.0F) {
target = null;
}

if (target == null) {
return;
}

String targetName = this.target.getName().getString();
String substring = targetName.substring(0, Math.min(targetName.length(), 10));
this.health = AnimationMath.fast(health, target.getHealth() / target.getMaxHealth(), 5);
this.health = MathHelper.clamp(this.health, 0, 1);
String healthValue = "HP: " + (int) MathUtil.round(this.health * 20 + target.getAbsorptionAmount(), 0.5f);

GlStateManager.pushMatrix();
AnimationMath.sizeAnimation(posX + (width / 2), posY + (height / 2), scale);
RenderUtil.Render2D.drawRoundedRect(posX, posY, width, height, roundDegree, backgroundColor);

if (shadow.get()) {
RenderUtil.Render2D.drawShadow(posX - 1, posY - 1, width + 2, height + 2, 8, RenderUtil.reAlphaInt(b_color, 50));
}

drawFace(posX + 5, posY + 5, 8F, 8F, 8F, 8F, 30, 30, 64F, 64F, (AbstractClientPlayerEntity) target);

medium.drawString(matrixStack, substring, posX + 40, posY + 8, t_color);
Fonts.msSemiBold[13].drawString(matrixStack, healthValue, posX + 40, posY + 20, t_color);

int healthColor = ColorUtil.rgba(100, 149, 237, 255);

RenderUtil.Render2D.drawRoundedCorner(posX + 40, posY + 30.5f, 70 * health, 4.0f, new Vector4f(4, 4, 4, 4), healthColor);
GlStateManager.popMatrix();
}

private void drawItemStack(float x, float y, float offset) {
List<ItemStack> stacks = new ArrayList<>(Arrays.asList(target.getHeldItemMainhand(), target.getHeldItemOffhand()));
target.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 -> HudUtil.drawItemStack(stack,
posX.getAndAccumulate(offset, Float::sum),
y,
true,
true, 0.6f));
}

private float perc;

private void renderTimer(MatrixStack matrixStack) {
float posX = timerHUD.getX();
float posY = timerHUD.getY();
float roundDegree = 6.0f;

int backgroundColor = ColorUtil.rgba(0, 0, 0, 150);

float quotient = Managment.FUNCTION_MANAGER.timerFunction.maxViolation / Managment.FUNCTION_MANAGER.timerFunction.timerAmount.getValue().floatValue();
float minimumValue = Math.min(Managment.FUNCTION_MANAGER.timerFunction.getViolation(), quotient);
perc = AnimationMath.lerp(perc, ((quotient - minimumValue) / quotient), 10);

String text = (int) (perc * 100) + "%";
float width = 100;
timerHUD.setWidth(width);
timerHUD.setHeight(20);

RenderUtil.Render2D.drawRoundedRect(posX, posY, width, 20, roundDegree, backgroundColor);

if (shadow.get()) {
RenderUtil.Render2D.drawShadow(posX - 1, posY - 1, width + 2, 20 + 2, 8, RenderUtil.reAlphaInt(b_color, 50));
}

Fonts.msSemiBold[15].drawCenteredString(matrixStack, "Timer", posX + width / 2, posY + 5, t_color);
Fonts.msSemiBold[15].drawCenteredString(matrixStack, text, posX + width / 2, posY + 15, t_color);

RenderUtil.Render2D.drawRoundedCorner(posX, posY + 20 - 6, width * perc, 6, new Vector4f(0, roundDegree, perc == 1 ? 0 : roundDegree, roundDegree), new Vector4i(getColor(100), getColor(100), getColor(0), getColor(0)));
}

private void renderCoordinates(MatrixStack matrixStack, int offset) {
String[] texts = new String[]{
"Coords: " + (int) mc.player.getPosX() + ", " + (int) mc.player.getPosY() + ", " + (int) mc.player.getPosZ(),
"BPS: " + (String.format("%.2f", Math.hypot(mc.player.getPosX() - mc.player.prevPosX, mc.player.getPosZ() - mc.player.prevPosZ) * 20))
};

float roundDegree = 6.0f;
int backgroundColor = ColorUtil.rgba(0, 0, 0, 150);

float of = 0;
for (String text : texts) {
float textWidth = medium.getWidth(text) + 16;
float height = 16;
float posY = window.scaledHeight() - height - offset - of;

RenderUtil.Render2D.drawRoundedRect(offset, posY, textWidth, height, roundDegree, backgroundColor);

if (shadow.get()) {
RenderUtil.Render2D.drawShadow(offset - 1, posY - 1, textWidth + 2, height + 2, 8, RenderUtil.reAlphaInt(b_color, 50));
}

Fonts.msSemiBold[15].drawCenteredString(matrixStack, text, offset + textWidth / 2, posY + 5.5f, t_color);
of += height + 3;
}
}

private PlayerEntity getTarget(PlayerEntity nullTarget) {
PlayerEntity target = nullTarget;

if (Managment.FUNCTION_MANAGER.auraFunction.getTarget() instanceof PlayerEntity) {
target = (PlayerEntity) Managment.FUNCTION_MANAGER.auraFunction.getTarget();
tHudAnimation.setDirection(Direction.FORWARDS);
} else if (mc.currentScreen instanceof ChatScreen) {
target = mc.player;
tHudAnimation.setDirection(Direction.FORWARDS);
} else {
tHudAnimation.setDirection(Direction.BACKWARDS);
}

return target;
}

private void updateFunctions() {
for (Function function : Managment.FUNCTION_MANAGER.getFunctions()) {
if (function.category == Type.Render) continue;

functions.add(function);
}

functions.sort((f1, f2) -> Float.compare(small.getWidth(f2.name), small.getWidth(f1.name)));
}

private int getColor(int index) {
return colors[index % colors.length];
}
}
Ну впринципе похоже молодец не прям вырви глаз
 
Начинающий
Статус
Оффлайн
Регистрация
10 Июл 2022
Сообщения
144
Реакции[?]
4
Поинты[?]
0
Немного поменять round / radius и будет красиво, очень рад что это не через Vector4f
 
Эксперт
Статус
Оффлайн
Регистрация
29 Мар 2021
Сообщения
1,595
Реакции[?]
602
Поинты[?]
43K
а в чём отличие вот от этих

...

тем
 
Начинающий
Статус
Оффлайн
Регистрация
26 Дек 2023
Сообщения
135
Реакции[?]
0
Поинты[?]
0
а в чём отличие вот от этих

...

тем
ну типо перенес на 2.0
 
Forge Api ;-;
Начинающий
Статус
Оффлайн
Регистрация
3 Май 2023
Сообщения
765
Реакции[?]
18
Поинты[?]
13K
Виталя закошмарил чат жпт, чтобы отрендерить 1 рект
 
Забаненный
Статус
Оффлайн
Регистрация
10 Май 2023
Сообщения
827
Реакции[?]
9
Поинты[?]
3K
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Кароч всё как обычно делал Я + ChatGPT
Пытался сделать скид данной темы, но на 2.0. Знаю, не похоже, но всё же.
Пожалуйста, авторизуйтесь для просмотра ссылки.

Java:
package wtf.expensive.modules.impl.render;

import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.platform.GlStateManager;
import net.minecraft.client.MainWindow;
import net.minecraft.client.entity.player.AbstractClientPlayerEntity;
import net.minecraft.client.gui.screen.ChatScreen;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.AirItem;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.EffectInstance;
import net.minecraft.potion.EffectUtils;
import net.minecraft.scoreboard.ScorePlayerTeam;
import net.minecraft.scoreboard.Team;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector4f;
import net.minecraft.util.text.ITextComponent;
import org.joml.Vector4i;
import wtf.expensive.Initilization;
import wtf.expensive.events.Event;
import wtf.expensive.events.impl.player.EventUpdate;
import wtf.expensive.events.impl.render.EventRender;
import wtf.expensive.managment.Managment;
import wtf.expensive.modules.Function;
import wtf.expensive.modules.FunctionAnnotation;
import wtf.expensive.modules.Type;
import wtf.expensive.modules.settings.imp.BooleanOption;
import wtf.expensive.modules.settings.imp.MultiBoxSetting;
import wtf.expensive.modules.settings.imp.SliderSetting;
import wtf.expensive.util.BetterText;
import wtf.expensive.util.ClientUtil;
import wtf.expensive.util.animations.Animation;
import wtf.expensive.util.animations.Direction;
import wtf.expensive.util.animations.impl.EaseBackIn;
import wtf.expensive.util.drag.Dragging;
import wtf.expensive.util.font.Fonts;
import wtf.expensive.util.font.styled.StyledFont;
import wtf.expensive.util.math.MathUtil;
import wtf.expensive.util.misc.HudUtil;
import wtf.expensive.util.render.BloomHelper;
import wtf.expensive.util.render.ColorUtil;
import wtf.expensive.util.render.RenderUtil;
import wtf.expensive.util.render.animation.AnimationMath;

import java.awt.*;
import java.util.*;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
import java.util.regex.Pattern;

import static wtf.expensive.util.render.RenderUtil.Render2D.drawFace;

@FunctionAnnotation(name = "HUD", type = Type.Render)
public class HUD2 extends Function {

public final MultiBoxSetting elements = new MultiBoxSetting("Элементы",
new BooleanOption("Ватермарка", true),
new BooleanOption("Активные функции", true),
new BooleanOption("Координаты", true),
new BooleanOption("Активный таргет", true),
new BooleanOption("Активные стаффы", true),
new BooleanOption("Активные бинды", true),
new BooleanOption("Активные эффекты", true),
new BooleanOption("Уведомления", true)
);

public final BooleanOption shadow = new BooleanOption("Тень", true);

private final SliderSetting offset = new SliderSetting("Отступ", 5, 1, 10, 1);

public HUD2() {
addSettings(elements, shadow, offset);
}

final float round_degree = 3;

final float cWidth = 4;

final Vector4f left_vec = new Vector4f(round_degree, round_degree, 0, 0);
final Vector4f right_vec = new Vector4f(0, 0, round_degree, round_degree);

final int b_color = new Color(0, 0, 0, 128).getRGB();
final int t_color = Color.WHITE.getRGB();

int[] colors = new int[360];

final StyledFont icons = Fonts.icons1[20];
final StyledFont medium = Fonts.msMedium[16];
final StyledFont small = Fonts.msMedium[14];

MainWindow window;

List<Function> functions = new ArrayList<>();

final Dragging keyBinds = Initilization.createDrag(this, "KeyBinds-new", 10, 100);
final Dragging staffList = Initilization.createDrag(this, "StaffList-new", 10, 200);

final Dragging targetHUD = Initilization.createDrag(this, "TargetHUD-new", 10, 300);
final Dragging timerHUD = Initilization.createDrag(this, "TimerHUD-new", 10, 400);

Animation tHudAnimation = new EaseBackIn(400, 1, 1.5f);
PlayerEntity target = null;

private final Pattern namePattern = Pattern.compile("^\\w{3,16}$");
private final Pattern prefixMatches = Pattern.compile(".*(mod|der|adm|help|wne|мод|хелп|помо|адм|владе|отри|таф|taf|curat|курато|dev|раз|supp|сапп|yt|ютуб).*");

private final Map<ITextComponent, String> staffPlayers = new LinkedHashMap<>();

@Override
public void onEvent(Event event) {
if (mc.player == null || mc.world == null) return;

if (event instanceof EventUpdate) {
staffPlayers.clear();

for (ScorePlayerTeam team : mc.world.getScoreboard().getTeams().stream().sorted(Comparator.comparing(Team::getName)).toList()) {
String name = team.getMembershipCollection().toString();
name = name.substring(1, name.length() - 1);
if (namePattern.matcher(name).matches()) {
if (prefixMatches.matcher(team.getPrefix().getString().toLowerCase(Locale.ROOT)).matches() || Managment.STAFF_MANAGER.isStaff(name)) {
staffPlayers.put(team.getPrefix(), name);
}
}
}

if (Managment.FUNCTION_MANAGER.getFunctions().isEmpty() || !functions.isEmpty()) return;
updateFunctions();
}

if (event instanceof EventRender e && e.isRender2D()) {
for (int i = 0; i < colors.length; i++) {
colors[i] = Managment.STYLE_MANAGER.getCurrentStyle().getColor(i);
}

window = e.scaledResolution;

final int offset = this.offset.getValue().intValue();
final MatrixStack matrixStack = e.matrixStack;

if (elements.get(0)) renderWatermark(matrixStack, offset);
if (elements.get(1)) renderFunctions(matrixStack, offset);
if (elements.get(2)) renderCoordinates(matrixStack, offset);
if (elements.get(3)) renderTarget(matrixStack);
if (elements.get(4)) renderStaffList(matrixStack);
if (elements.get(5)) renderKeyBinds(matrixStack);
if (elements.get(6)) renderPotions(matrixStack, offset);
}
}

BetterText betterText = new BetterText(List.of("",
"Лучший из лучших",
"Всегда на высоте",
"Наивысший стандарт качества",
"Лучший выбор",
"Всегда превосходно",
"Надежно и качественно"), 2000);

private void renderWatermark(MatrixStack matrixStack, int offset) {
float staticTextWidth = Fonts.msSemiBold[15].getWidth("Expensive");
float animatedTextWidth = Fonts.msSemiBold[15].getWidth(betterText.output);
float maxWidth = Math.max(staticTextWidth, animatedTextWidth);
float width = Math.max(80, maxWidth + 20);
float height = 28;
float roundDegree = 6.0f;

int backgroundColor = ColorUtil.rgba(0, 0, 0, 150);

RenderUtil.Render2D.drawRoundedRect(offset, offset, width, height, roundDegree, backgroundColor);

if (shadow.get()) {
RenderUtil.Render2D.drawShadow(offset - 1, offset - 1, width + 2, height + 2, 8, RenderUtil.reAlphaInt(b_color, 50));
}

Fonts.msSemiBold[15].drawString(matrixStack, "Expensive", offset + 10, offset + 6f, t_color);
Fonts.msSemiBold[15].drawString(matrixStack, betterText.output, offset + 10, offset + 18f, t_color);
}

private void renderFunctions(MatrixStack matrixStack, int offset) {
float padding = 4;
float dumbOffset = 1.5f;
float height = small.getFontHeight() - dumbOffset + padding;
float roundDegree = 6.0f;

int backgroundColor = ColorUtil.rgba(0, 0, 0, 150);

List<Function> fs = new ArrayList<>();
for (Function f : functions) {
f.animation = AnimationMath.fast(f.animation, f.state ? 1 : 0, 15);
if (f.animation < 0.1) continue;
fs.add(f);
}

float index = 0;
for (Function f : fs) {
float width = small.getWidth(f.name) + (padding * 2);
float r_posX = window.scaledWidth() - offset - width;
float r_posY = offset + (index * height);

RenderUtil.Render2D.drawRoundedRect(r_posX - cWidth, r_posY, width, height, roundDegree, backgroundColor);

if (shadow.get()) {
RenderUtil.Render2D.drawShadow(r_posX - cWidth - 1, r_posY - 1, width + 2, height + 2, 8, RenderUtil.reAlphaInt(b_color, 50));
}

small.drawCenteredString(matrixStack, f.name, r_posX + width / 2 - cWidth, r_posY - dumbOffset + (height / 2), -1);
index += f.animation;
}
}

private void renderPotions(MatrixStack matrixStack, int offset) {
float height = 12;
float posY = window.scaledHeight() - offset - height;
float roundDegree = 6.0f;

int backgroundColor = ColorUtil.rgba(0, 0, 0, 150);

int index = 0;
for (EffectInstance eff : mc.player.getActivePotionEffects().stream().sorted(Comparator.comparing(EffectInstance::getDuration)).toList()) {
String text = I18n.format(eff.getEffectName()) + " " + I18n.format("enchantment.level." + (eff.getAmplifier() + 1)) + " - " + EffectUtils.getPotionDurationString(eff, 1);
float textWidth = small.getWidth(text) + 12;
float posX = window.scaledWidth() - offset - textWidth;

RenderUtil.Render2D.drawRoundedRect(posX, posY - (index * 16), textWidth, height, roundDegree, backgroundColor);

if (shadow.get()) {
RenderUtil.Render2D.drawShadow(posX - 1, posY - (index * 16) - 1, textWidth + 2, height + 2, 8, RenderUtil.reAlphaInt(b_color, 50));
}

small.drawString(matrixStack, text, posX + 4, posY - (index * 16) + 4.5f, t_color);
index++;
}
}

float kbHeight = 0;
float kbWidth = 100;

float kbWidthAnimation = 0, kbHeightAnimation = 0;

private void renderKeyBinds(MatrixStack matrixStack) {
float posX = keyBinds.getX();
float posY = keyBinds.getY();
float roundDegree = 6.0f;

int backgroundColor = ColorUtil.rgba(0, 0, 0, 150);

RenderUtil.Render2D.drawRoundedRect(posX, posY, kbWidthAnimation, kbHeightAnimation, roundDegree, backgroundColor);

if (shadow.get()) {
RenderUtil.Render2D.drawShadow(posX - 1, posY - 1, kbWidthAnimation + 2, kbHeightAnimation + 2, 8, RenderUtil.reAlphaInt(b_color, 50));
}

float titleWidth = Fonts.msSemiBold[15].getWidth("HotKeys");
Fonts.msSemiBold[15].drawCenteredString(matrixStack, "HotKeys", posX + kbWidthAnimation / 2, posY + 6, ColorUtil.rgba(255, 255, 255, 255));

RenderUtil.SmartScissor.push();
RenderUtil.SmartScissor.setFromComponentCoordinates(posX, posY, kbWidthAnimation, kbHeightAnimation);

int i = 0;
for (Function f : Managment.FUNCTION_MANAGER.getFunctions()) {
if (!f.state || f.bind == 0) continue;

String text = ClientUtil.getKey(f.bind);
if (text.length() > 4) {
text = text.substring(0, 4) + "..";
}
String bindText = "[" + text.toUpperCase() + "]";
float bindWidth = small.getWidth(bindText);
String name = f.name;
if (name.length() > 10) {
name = name.substring(0, 10) + "..";
}

kbWidth = Math.max(small.getWidth(bindText + f.bind + 5), 85);

Fonts.msMedium[12].drawString(matrixStack, name, posX + 5, posY + 18 + (i * 10), ColorUtil.rgba(255, 255, 255, 255));
Fonts.msMedium[12].drawString(matrixStack, bindText, posX + kbWidthAnimation - bindWidth - 5, posY + 18.5f + (i * 10), ColorUtil.rgba(255, 255, 255, 255));

i++;
}
RenderUtil.SmartScissor.unset();
RenderUtil.SmartScissor.pop();

kbHeight = 18 + (i * 10);
this.kbHeightAnimation = AnimationMath.fast(this.kbHeightAnimation, kbHeight, 10);
this.kbWidthAnimation = AnimationMath.fast(this.kbWidthAnimation, kbWidth, 10);

keyBinds.setWidth(kbWidth);
keyBinds.setHeight(kbHeight);
}

float slHeight = 0;
float lsWidth = 100;

private void renderStaffList(MatrixStack matrixStack) {
float posX = staffList.getX();
float posY = staffList.getY();
float roundDegree = 6.0f;

int backgroundColor = ColorUtil.rgba(0, 0, 0, 150);

RenderUtil.Render2D.drawRoundedRect(posX, posY, lsWidth, slHeight, roundDegree, backgroundColor);

if (shadow.get()) {
RenderUtil.Render2D.drawShadow(posX - 1, posY - 1, lsWidth + 2, slHeight + 2, 8, RenderUtil.reAlphaInt(b_color, 50));
}

Fonts.msSemiBold[15].drawCenteredString(matrixStack, "StaffList", posX + lsWidth / 2, posY + 6, t_color);

int i = 0;
for (Map.Entry<ITextComponent, String> entry : staffPlayers.entrySet()) {
ITextComponent p = entry.getKey();
String n = entry.getValue();

float len = Math.max(small.getWidth(p.getString() + n + cWidth), 85);

if (len > lsWidth) lsWidth = len;

small.drawString(matrixStack, p, posX + 4, posY + 18 + (i * 10), t_color);
small.drawString(matrixStack, n, posX + small.getWidth(p.getString()) + 4, posY + 18 + (i * 10), t_color);

i++;
}

slHeight = 18 + (i * 10);
staffList.setWidth(lsWidth);
staffList.setHeight(slHeight);
}

float health = 0;

private double scale = 0.0D;

private void renderTarget(MatrixStack matrixStack) {
float posX = targetHUD.getX();
float posY = targetHUD.getY();
float roundDegree = 8.0f;

int backgroundColor = ColorUtil.rgba(0, 0, 0, 150);

float width = 115;
float height = 40;
targetHUD.setWidth(width);
targetHUD.setHeight(height);

this.target = getTarget(this.target);
this.scale = tHudAnimation.getOutput();

if (scale == 0.0F) {
target = null;
}

if (target == null) {
return;
}

String targetName = this.target.getName().getString();
String substring = targetName.substring(0, Math.min(targetName.length(), 10));
this.health = AnimationMath.fast(health, target.getHealth() / target.getMaxHealth(), 5);
this.health = MathHelper.clamp(this.health, 0, 1);
String healthValue = "HP: " + (int) MathUtil.round(this.health * 20 + target.getAbsorptionAmount(), 0.5f);

GlStateManager.pushMatrix();
AnimationMath.sizeAnimation(posX + (width / 2), posY + (height / 2), scale);
RenderUtil.Render2D.drawRoundedRect(posX, posY, width, height, roundDegree, backgroundColor);

if (shadow.get()) {
RenderUtil.Render2D.drawShadow(posX - 1, posY - 1, width + 2, height + 2, 8, RenderUtil.reAlphaInt(b_color, 50));
}

drawFace(posX + 5, posY + 5, 8F, 8F, 8F, 8F, 30, 30, 64F, 64F, (AbstractClientPlayerEntity) target);

medium.drawString(matrixStack, substring, posX + 40, posY + 8, t_color);
Fonts.msSemiBold[13].drawString(matrixStack, healthValue, posX + 40, posY + 20, t_color);

int healthColor = ColorUtil.rgba(100, 149, 237, 255);

RenderUtil.Render2D.drawRoundedCorner(posX + 40, posY + 30.5f, 70 * health, 4.0f, new Vector4f(4, 4, 4, 4), healthColor);
GlStateManager.popMatrix();
}

private void drawItemStack(float x, float y, float offset) {
List<ItemStack> stacks = new ArrayList<>(Arrays.asList(target.getHeldItemMainhand(), target.getHeldItemOffhand()));
target.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 -> HudUtil.drawItemStack(stack,
posX.getAndAccumulate(offset, Float::sum),
y,
true,
true, 0.6f));
}

private float perc;

private void renderTimer(MatrixStack matrixStack) {
float posX = timerHUD.getX();
float posY = timerHUD.getY();
float roundDegree = 6.0f;

int backgroundColor = ColorUtil.rgba(0, 0, 0, 150);

float quotient = Managment.FUNCTION_MANAGER.timerFunction.maxViolation / Managment.FUNCTION_MANAGER.timerFunction.timerAmount.getValue().floatValue();
float minimumValue = Math.min(Managment.FUNCTION_MANAGER.timerFunction.getViolation(), quotient);
perc = AnimationMath.lerp(perc, ((quotient - minimumValue) / quotient), 10);

String text = (int) (perc * 100) + "%";
float width = 100;
timerHUD.setWidth(width);
timerHUD.setHeight(20);

RenderUtil.Render2D.drawRoundedRect(posX, posY, width, 20, roundDegree, backgroundColor);

if (shadow.get()) {
RenderUtil.Render2D.drawShadow(posX - 1, posY - 1, width + 2, 20 + 2, 8, RenderUtil.reAlphaInt(b_color, 50));
}

Fonts.msSemiBold[15].drawCenteredString(matrixStack, "Timer", posX + width / 2, posY + 5, t_color);
Fonts.msSemiBold[15].drawCenteredString(matrixStack, text, posX + width / 2, posY + 15, t_color);

RenderUtil.Render2D.drawRoundedCorner(posX, posY + 20 - 6, width * perc, 6, new Vector4f(0, roundDegree, perc == 1 ? 0 : roundDegree, roundDegree), new Vector4i(getColor(100), getColor(100), getColor(0), getColor(0)));
}

private void renderCoordinates(MatrixStack matrixStack, int offset) {
String[] texts = new String[]{
"Coords: " + (int) mc.player.getPosX() + ", " + (int) mc.player.getPosY() + ", " + (int) mc.player.getPosZ(),
"BPS: " + (String.format("%.2f", Math.hypot(mc.player.getPosX() - mc.player.prevPosX, mc.player.getPosZ() - mc.player.prevPosZ) * 20))
};

float roundDegree = 6.0f;
int backgroundColor = ColorUtil.rgba(0, 0, 0, 150);

float of = 0;
for (String text : texts) {
float textWidth = medium.getWidth(text) + 16;
float height = 16;
float posY = window.scaledHeight() - height - offset - of;

RenderUtil.Render2D.drawRoundedRect(offset, posY, textWidth, height, roundDegree, backgroundColor);

if (shadow.get()) {
RenderUtil.Render2D.drawShadow(offset - 1, posY - 1, textWidth + 2, height + 2, 8, RenderUtil.reAlphaInt(b_color, 50));
}

Fonts.msSemiBold[15].drawCenteredString(matrixStack, text, offset + textWidth / 2, posY + 5.5f, t_color);
of += height + 3;
}
}

private PlayerEntity getTarget(PlayerEntity nullTarget) {
PlayerEntity target = nullTarget;

if (Managment.FUNCTION_MANAGER.auraFunction.getTarget() instanceof PlayerEntity) {
target = (PlayerEntity) Managment.FUNCTION_MANAGER.auraFunction.getTarget();
tHudAnimation.setDirection(Direction.FORWARDS);
} else if (mc.currentScreen instanceof ChatScreen) {
target = mc.player;
tHudAnimation.setDirection(Direction.FORWARDS);
} else {
tHudAnimation.setDirection(Direction.BACKWARDS);
}

return target;
}

private void updateFunctions() {
for (Function function : Managment.FUNCTION_MANAGER.getFunctions()) {
if (function.category == Type.Render) continue;

functions.add(function);
}

functions.sort((f1, f2) -> Float.compare(small.getWidth(f2.name), small.getWidth(f1.name)));
}

private int getColor(int index) {
return colors[index % colors.length];
}
}
зачем я нажал кнопку сс?
 
Начинающий
Статус
Оффлайн
Регистрация
24 Окт 2021
Сообщения
134
Реакции[?]
1
Поинты[?]
1K
Сверху Снизу