-
Автор темы
- #1
Перед прочтением основного контента ниже, пожалуйста, обратите внимание на обновление внутри секции Майна на нашем форуме. У нас появились:
- бесплатные читы для Майнкрафт — любое использование на свой страх и риск;
- маркетплейс Майнкрафт — абсолютно любая коммерция, связанная с игрой, за исключением продажи читов (аккаунты, предоставления услуг, поиск кодеров читов и так далее);
- приватные читы для Minecraft — в этом разделе только платные хаки для игры, покупайте группу "Продавец" и выставляйте на продажу свой софт;
- обсуждения и гайды — всё тот же раздел с вопросами, но теперь модернизированный: поиск нужных хаков, пати с игроками-читерами и другая полезная информация.
Спасибо!
КОД:
Код:
@FunctionAnnotation(name="Hud", type=Type.Display)
public class Hud
extends Function {
public static MultiBoxSetting elements = new MultiBoxSetting("Elements",
new BooleanOption("Active Target", true),
new BooleanOption("Timer Indicator", true),
new BooleanOption("Logo", true),
new BooleanOption("Coordinates", true),
new BooleanOption("Speed", true),
new BooleanOption("Effects", true),
new BooleanOption("Active Binds", true),
new BooleanOption("Active Staff", true),
new BooleanOption("Armor", true),
new BooleanOption("Cooldown", true));
private final SliderSetting offsetEffects = new SliderSetting("\u0420\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432", 24.0f, 23.0f, 26.0f, 0.1f).setVisible(() -> elements.get(5));
final Dragging TargetHUD = Initilization.createDrag(this, "TargetHUD7317", mc.getMainWindow().scaledWidth() / 2, (float)mc.getMainWindow().scaledHeight() / 2.0f);
final Dragging TimerHUD = Initilization.createDrag(this, "TimerHUD7317", mc.getMainWindow().scaledWidth() / 2, (float)mc.getMainWindow().scaledHeight() / 2.0f);
final Dragging Logo = Initilization.createDrag(this, "Logo7317", mc.getMainWindow().scaledWidth() / 2, (float)mc.getMainWindow().scaledHeight() / 2.0f);
final Dragging Coords = Initilization.createDrag(this, "Coords7317", mc.getMainWindow().scaledWidth() / 2, (float)mc.getMainWindow().scaledHeight() / 2.0f);
final Dragging BPS = Initilization.createDrag(this, "BPS7317", mc.getMainWindow().scaledWidth() / 2, (float)mc.getMainWindow().scaledHeight() / 2.0f);
final Dragging Effects = Initilization.createDrag(this, "Effects7317", mc.getMainWindow().scaledWidth() / 2, (float)mc.getMainWindow().scaledHeight() / 2.0f);
final Dragging KeyBinds = Initilization.createDrag(this, "KeyBinds7317", mc.getMainWindow().scaledWidth() / 2, (float)mc.getMainWindow().scaledHeight() / 2.0f);
final Dragging StaffActive = Initilization.createDrag(this, "StaffActive7317", mc.getMainWindow().scaledWidth() / 2, (float)mc.getMainWindow().scaledHeight() / 2.0f);
final Dragging Cooldown = Initilization.createDrag(this, "Cooldown7317", mc.getMainWindow().scaledWidth() / 2, (float)mc.getMainWindow().scaledHeight() / 2.0f);
int activeStaff = 0;
private final Pattern namePattern = Pattern.compile("^\\w{3,16}$");
int activeBind = 0;
float heightAnimation = 0.0f;
private float perc;
private final Animation targetHudAnimation = new EaseBackIn(270, 1.0, 1.5f);
private double scale = 0.0;
private LivingEntity target = null;
float health = 0.0f;
float absorpation = 0.0f;
public Hud() {
this.addSettings(elements, this.offsetEffects);
}
@Override
public void onEvent(Event event) {
if (event instanceof EventRender) {
EventRender eventRender = (EventRender)event;
MatrixStack stack = eventRender.matrixStack;
if (elements.get(0)) {
this.TargetHUD(stack);
}
if (elements.get(1)) {
this.TimerHUD(stack);
}
if (elements.get(2)) {
this.Logo(stack);
}
if (elements.get(3)) {
this.Coords(stack);
}
if (elements.get(4)) {
this.BPS(stack);
}
if (elements.get(5)) {
this.Effects(stack);
}
if (elements.get(6)) {
this.KeyBinds(stack);
}
if (elements.get(7)) {
this.StaffActive(stack);
}
if (elements.get(8)) {
this.ArmorHUD(stack, eventRender);
}
}
}
public void ArmorHUD(MatrixStack stack, EventRender eventRender) {
int off;
int count = 0;
for (int i = 0; i < Hud.mc.player.inventory.getSizeInventory(); ++i) {
ItemStack s = Hud.mc.player.inventory.getStackInSlot(i);
if (s.getItem() != Items.TOTEM_OF_UNDYING) continue;
++count;
}
float xPos = (float)eventRender.scaledResolution.scaledWidth() / 2.0f;
float yPos = eventRender.scaledResolution.scaledHeight();
boolean totemInInv = Hud.mc.player.inventory.mainInventory.stream().map(ItemStack::getItem).toList().contains(Items.TOTEM_OF_UNDYING);
int n = off = totemInInv ? 5 : 0;
if (Hud.mc.player.isCreative()) {
yPos += 17.0f;
}
for (ItemStack s : Hud.mc.player.inventory.armorInventory) {
ESPFunction.drawItemStack(s, xPos - (float)off + 74.0f * ((float)Hud.mc.gameSettings.guiScale / 2.0f), yPos - 56.0f * ((float)Hud.mc.gameSettings.guiScale / 2.0f), null, false);
off += 15;
}
if (totemInInv) {
ESPFunction.drawItemStack(new ItemStack(Items.TOTEM_OF_UNDYING), xPos - (float)off + 73.0f * ((float)Hud.mc.gameSettings.guiScale / 2.0f), yPos - 56.0f * ((float)Hud.mc.gameSettings.guiScale / 2.0f), String.valueOf(count), false);
}
}
public void StaffActive(MatrixStack stack) {
float x = this.StaffActive.getX();
float y = this.StaffActive.getY();
float offset = 9.0f;
float height2 = 20.5f;
float width2 = 100.0f;
height2 += offset * (float)this.activeStaff - 4.0f;
float xStaff = x + 26.0f;
if (this.activeStaff == 0) {
height2 -= 1.5f;
width2 -= 25.0f;
xStaff -= 12.5f;
}
RenderUtil.Render2D.drawRoundedCorner(x, y, width2, height2, 3, new Color(0, 0, 0, 195).getRGB());
StyledFont small1 = Fonts.msSemiBold[15];
small1.drawString(stack, "Staff Active", (double)xStaff, (double)(y + 6.0f), new Color(255, 255, 255, 255).getRGB());
int i = 0;
for (ScorePlayerTeam team : Hud.mc.world.getScoreboard().getTeams().stream().sorted(Comparator.comparing(Team::getName)).toList()) {
String name = team.getMembershipCollection().toString();
if (!this.namePattern.matcher(name = name.substring(1, name.length() - 1)).matches()) continue;
boolean vanish = true;
boolean near = false;
boolean active = false;
for (AbstractClientPlayerEntity player : Hud.mc.world.getPlayers()) {
if (!player.getNameClear().equals(name)) continue;
near = true;
}
for (NetworkPlayerInfo info : mc.getConnection().getPlayerInfoMap()) {
if (!info.getGameProfile().getName().equals(name)) continue;
vanish = false;
if (near) continue;
active = true;
}
if (!vanish && !Managment.STAFF_MANAGER.isStaff(name)) continue;
String Name2 = name.substring(0, Math.min(name.length(), 10));
StyledFont small = Fonts.msSemiBold[13];
StyledFont small2 = Fonts.msSemiBold[14];
float yText = y + 17.0f;
small2.drawString(stack, Name2, (double)(x + 4.0f), (double)yText, new Color(255, 255, 255, 255).getRGB());
if (vanish) {
small.drawString(stack, "Spectator", (double)(x + 63.5f), (double)yText, new Color(231, 52, 52, 255).getRGB());
} else if (active) {
small.drawString(stack, "Online", (double)(x + 74f), (double)yText, new Color(116, 236, 114, 255).getRGB());
} else if (near) {
small.drawString(stack, "Near", (double)(x + 80.8f), (double)yText, new Color(255, 251, 0, 255).getRGB());
}
y += offset;
++i;
}
this.activeStaff = i;
this.StaffActive.setWidth(width2);
this.StaffActive.setHeight(height2);
}
public void KeyBinds(MatrixStack stack) {
float x = this.KeyBinds.getX();
float y = this.KeyBinds.getY();
float offset = 9.5f;
float height2 = 21.0f;
float width2 = 75.0f;
height2 += offset * (float)this.activeBind - 5.0f;
if (this.activeBind == 0) {
height2 -= 1.0f;
}
RenderUtil.Render2D.drawRoundedCorner(x, y, width2, this.heightAnimation, 3, new Color(0, 0, 0, 195).getRGB());
StyledFont small1 = Fonts.msSemiBold[15];
small1.drawString(stack, "Key Binds", (x + 18.0f), (y + 6.0f), new Color(255, 255, 255, 255).getRGB());
int i = 0;
for (Function f : Managment.FUNCTION_MANAGER.getFunctions()) {
String text;
if (f.bind == 0 || !f.state || (text = ClientUtil.getKey(f.bind)) == null) continue;
StyledFont small = Fonts.msSemiBold[13];
String bindText = text.toUpperCase();
float yText = y + 17.0f;
RenderUtil.SmartScissor.push();
RenderUtil.SmartScissor.setFromComponentCoordinates(x, y, width2, this.heightAnimation);
small.drawString(stack, f.name, (x + 4.0f), yText, new Color(255, 255, 255, 255).getRGB());
small.drawString(stack, "On", (x + 62.0f), yText, new Color(255, 255, 255, 255).getRGB());
RenderUtil.SmartScissor.unset();
RenderUtil.SmartScissor.pop();
y += offset;
++i;
}
this.heightAnimation = AnimationMath.fast(this.heightAnimation, height2, 11.0f);
this.activeBind = i;
this.KeyBinds.setWidth(width2);
this.KeyBinds.setHeight(height2);
}
public void Effects(MatrixStack stack) {
float x = 3;
float y = 40;
float offset = this.offsetEffects.getValue().floatValue();
float height2 = 21.3f;
StyledFont small = Fonts.msSemiBold[13];
int counterEffect = 0;
for (EffectInstance effectInstance : Hud.mc.player.getActivePotionEffects()) {
String levelpotion = String.valueOf(effectInstance.getAmplifier() + 1);
float textWidthBonus = 27.3f;
if (levelpotion.contains("1")) {
levelpotion = "";
textWidthBonus -= 5.0f;
}
String durationText = EffectUtils.getPotionDurationString(effectInstance, 1.0f);
String text = I18n.format(effectInstance.getEffectName(), new Object[0]);
float textWidth = small.getWidth(text + effectInstance.getAmplifier() + levelpotion) + textWidthBonus - 0.6f;
RenderUtil.Render2D.drawRoundedCorner(x, y, textWidth, height2, 3.0f, new Color(0, 0, 0, 195).getRGB());
small.drawString(stack, text + " " + levelpotion, (double)(x + 22.3f), (double)(y + 5.5f), new Color(255, 255, 255, 255).getRGB());
small.drawString(stack, durationText, (double)(x + 22.3f), (double)(y + 13.5f), new Color(255, 255, 255, 255).getRGB());
PotionSpriteUploader potionspriteuploader = mc.getPotionSpriteUploader();
Effect effect = effectInstance.getPotion();
TextureAtlasSprite textureatlassprite = potionspriteuploader.getSprite(effect);
mc.getTextureManager().bindTexture(textureatlassprite.getAtlasTexture().getTextureLocation());
DisplayEffectsScreen.blit(stack, (int)(x + 2.0f), (int)y + 2, 10, 18, 18, textureatlassprite);
y += offset;
++counterEffect;
this.Effects.setWidth(textWidth);
}
float setHeight = offset / 8.0f * (float)counterEffect;
this.Effects.setHeight(height2 * (float)counterEffect + setHeight);
}
public void BPS(MatrixStack stack) {
float x = 3;
float y = 507;
float height2 = 15.0f;
StyledFont small = Fonts.msSemiBold[14];
String text = "Speed: " + String.format("%.2f", Math.hypot(mc.player.getPosX() - mc.player.prevPosX, mc.player.getPosZ() - mc.player.prevPosZ) * 20.0);
float textWidth = small.getWidth(text) + 8.5f;
RenderUtil.Render2D.drawRoundedCorner(x, y, textWidth, height2, 3.0f, new Color(0, 0, 0, 195).getRGB());
small.drawString(stack, text, (x + 4.5f), (double)y + 6.3, new Color(255, 255, 255, 255).getRGB());
this.BPS.setWidth(textWidth);
this.BPS.setHeight(height2);
}
public void Coords(MatrixStack stack) {
float x = 3;
float y = 524;
float height2 = 15.0f;
StyledFont small = Fonts.msSemiBold[14];
int X = (int)Hud.mc.player.getPosX();
int Y = (int)Hud.mc.player.getPosY();
int Z2 = (int)Hud.mc.player.getPosZ();
String text = "Coords: X: " + X + " Y: " + Y + " Z: " + Z2;
float textWidth = small.getWidth(text) + 8.5f;
RenderUtil.Render2D.drawRoundedCorner(x, y, textWidth, height2, 3.0f, new Color(0, 0, 0, 195).getRGB());
small.drawString(stack, text, (x + 4.5f), (y + 6.0f), new Color(255, 255, 255, 255).getRGB());
this.Coords.setWidth(textWidth);
this.Coords.setHeight(height2);
}
public void Logo(MatrixStack stack) {
float x = 3;
float y = 3;
float height2 = 17.0f;
String text = "Catlavan";
String icon = "D";
float textWidth = Fonts.msSemiBold[18].getWidth(text + icon) + 12;
RenderUtil.Render2D.drawRoundedCorner(x, y, textWidth, height2, 3.0f, new Color(0, 0, 0, 195).getRGB());
Fonts.msSemiBold[18].drawString(stack, "Catlavan", x + 16.0f, y + 6.5f, new Color(255, 255, 255, 255).getRGB());
Fonts.catlavan[22].drawString(stack, icon, x + 3.0f, y + 6.5f, new Color(255, 255, 255, 255).getRGB());
//Тики
RenderUtil.Render2D.drawRoundedCorner(x, y + 20, textWidth - 15, height2 - 2, 3.0f, new Color(0, 0, 0, 195).getRGB());
Fonts.msSemiBold[18].drawString(stack, "Ticks: 20", x + 3f, y + 25, new Color(255, 255, 255, 255).getRGB());
this.Logo.setWidth(textWidth);
this.Logo.setHeight(height2);
}
public void TimerHUD(MatrixStack stack) {
float x = this.TimerHUD.getX();
float y = this.TimerHUD.getY();
float width2 = 71.0f;
float height2 = 25.0f;
float quotient = Managment.FUNCTION_MANAGER.timerFunction.maxViolation / Managment.FUNCTION_MANAGER.timerFunction.timerAmount.getValue().floatValue();
float minimumValue = Math.min(Managment.FUNCTION_MANAGER.timerFunction.getViolation(), quotient);
this.perc = AnimationMath.lerp(this.perc, (quotient - minimumValue) / quotient, 7.0f);
String text = (int)(this.perc * 100.0f) + "%";
RenderUtil.Render2D.drawRoundedCorner(x, y, width2, height2, 3, new Color(0, 0, 0, 195).getRGB());
RenderUtil.Render2D.drawRoundedCorner(x + 5.0f, y + 14.0f, 61.0f, 8.0f, 0.0f, new Color(23, 23, 23, 196).getRGB());
RenderUtil.Render2D.drawRoundedCorner(x + 5.0f, y + 14.0f, 61.0f * this.perc, 8.0f, 3.0f, ColorUtil.getColorStyle(0.0f));
Fonts.msSemiBold[16].drawString(stack, "Timer ", (double)(x + 23.5f), (double)(y + 7.4f), new Color(255, 255, 255, 255).getRGB());
if (this.perc * 100.0f < 10.0f) {
// Fonts.msSemiBold[13].drawString(stack, text, (double)(x + 55.0f), (double)(y + 7.4f), new Color(255, 255, 255, 255).getRGB());
} else if (this.perc * 100.0f == 100.0f) {
// Fonts.msSemiBold[13].drawString(stack, text, (double)(x + 49.5f), (double)(y + 7.4f), new Color(255, 255, 255, 255).getRGB());
} else {
// Fonts.msSemiBold[13].drawString(stack, text, (double)(x + 51.5f), (double)(y + 7.4f), new Color(255, 255, 255, 255).getRGB());
}
this.TimerHUD.setWidth(width2);
this.TimerHUD.setHeight(height2);
}
public void TargetHUD(MatrixStack stack) {
float x = this.TargetHUD.getX();
float y = this.TargetHUD.getY();
float width2 = 95.0f;
float height2 = 34.0f;
float widthFace = 34.0f;
this.target = this.getTarget(this.target);
this.targetHudAnimation.setDuration(280);
this.scale = this.targetHudAnimation.getOutput();
if (this.scale == 0.0) {
this.target = null;
}
if (this.target == null) {
return;
}
GlStateManager.pushMatrix();
AnimationMath.sizeAnimation(x + width2 / 2.0f, y + 15.0f, this.scale);
RenderUtil.Render2D.drawRoundedCorner(x, y, width2 - 5, height2, 3.0f, new Color(0, 0, 0, 195).getRGB());
if (this.target instanceof PlayerEntity) {
RenderUtil.Render2D.drawFace(x + 3, y + 4, 8.0f, 8.0f, 8.0f, 8.0f, widthFace - 7, height2 - 7, 64.0f, 64.0f, (AbstractClientPlayerEntity)this.target);
}
float xHP = x + widthFace + 3.8f;
float yHP = y + 21.3f;
float widthHP = 52.0f;
this.health = AnimationMath.fast(this.health, this.target.getHealth() / this.target.getMaxHealth(), 6.0f);
this.health = MathHelper.clamp(this.health, 0.0f, 1.0f);
this.absorpation = AnimationMath.fast(this.absorpation, this.target.getAbsorptionAmount() / this.target.getMaxHealth(), 6.0f);
this.absorpation = MathHelper.clamp(this.absorpation, 0.0f, 1.0f);
RenderUtil.Render2D.drawRoundedCorner(xHP - 5, yHP, 52.0f * this.health, 9f, 2.5f, ColorUtil.getColorStyle(0.0f));
RenderUtil.Render2D.drawRoundedCorner(xHP - 5, yHP, 52.0f * this.absorpation, 9f, 2.5f, new Color(222, 211, 14, 255).getRGB());
String targetName = this.target.getName().getString();
RenderUtil.SmartScissor.push();
RenderUtil.SmartScissor.setFromComponentCoordinates(x, y, width2 - 6.0f, height2);
Fonts.msSemiBold[16].drawString(stack, targetName, (double)xHP - 5, (double)(yHP - 17.3f), new Color(255, 255, 255, 255).getRGB());
RenderUtil.SmartScissor.unset();
RenderUtil.SmartScissor.pop();
String HP = String.valueOf(this.target.getHealth() + this.target.getAbsorptionAmount());
String StringHP = HP.substring(0, Math.min(HP.length(), 4));
if (this.target.getHealth() + this.target.getAbsorptionAmount() < 10.0f) {
StringHP = HP.substring(0, Math.min(HP.length(), 3));
}
Fonts.msSemiBold[14].drawString(stack, "HP: " + StringHP, (double)xHP - 5, (double)(yHP - 7.7f), new Color(255, 255, 255, 255).getRGB());
this.drawItemStack(x, y - 12.0f, 10.5f, 0.7f);
GlStateManager.popMatrix();
this.TargetHUD.setWidth(width2);
this.TargetHUD.setHeight(height2);
}
private void drawItemStack(float x, float y, float offset, float scaleValue) {
ArrayList<ItemStack> stackList = new ArrayList<ItemStack>(Arrays.asList(this.target.getHeldItemMainhand(), this.target.getHeldItemOffhand()));
stackList.addAll((Collection)this.target.getArmorInventoryList());
AtomicReference<Float> posX = new AtomicReference<Float>(Float.valueOf(x));
stackList.stream().filter(stack -> !stack.isEmpty()).forEach(stack -> HudUtil.drawItemStack(stack, posX.getAndAccumulate(Float.valueOf(offset), Float::sum).floatValue(), y, true, true, scaleValue));
}
private LivingEntity getTarget(LivingEntity nullTarget) {
LivingEntity target = nullTarget;
FunctionManager functionManager = Managment.FUNCTION_MANAGER;
if (functionManager.auraNew.getTarget() instanceof LivingEntity) {
FunctionManager functionManager2 = Managment.FUNCTION_MANAGER;
target = functionManager2.auraNew.getTarget();
this.targetHudAnimation.setDirection(Direction.FORWARDS);
} else if (IMinecraft.mc.currentScreen instanceof ChatScreen) {
target = IMinecraft.mc.player;
this.targetHudAnimation.setDirection(Direction.FORWARDS);
} else {
this.targetHudAnimation.setDirection(Direction.BACKWARDS);
}
return target;
}
}