Исходник AltWidget 3.1 Ready

Начинающий
Статус
Оффлайн
Регистрация
17 Июн 2024
Сообщения
179
Реакции[?]
0
Поинты[?]
0

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

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

Спасибо!

ну ебать, что сказать начал делать на 3.1 кто не смог запастить альт менеджер (таких много) для тех пойдет там рандом ник и более мение норм код если нужны утилки пишите а вообще это говно не должно было вспливать

Это пиздец....:
package ru.protection.desing.mainmenu;

import com.mojang.blaze3d.platform.GlStateManager;
import ru.protection.client.config.AltConfig;
import ru.protection.system.client.IMinecraft;
import ru.protection.system.math.StopWatch;
import ru.protection.system.render.*;
import ru.protection.system.render.font.Fonts;
import com.mojang.blaze3d.matrix.MatrixStack;
import ru.protection.system.math.MathUtil;
import net.minecraft.util.Session;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector4f;
import org.lwjgl.glfw.GLFW;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;

public class AltWidget implements IMinecraft {
    public final List<Alt> alts = new ArrayList<>();
    private float x;
    private final float y;
    private float animation = 0f;
    private final StopWatch animationTimer = new StopWatch();

    public AltWidget() {
        y = 10;
    }

    public boolean open;
    private String altName = "";
    private boolean typing;
    private float scrollPre;
    private float scroll;

    public void updateScroll(int mouseX, int mouseY, float delta) {
        float minHeight = 20 + (4 * 25);
        float height = open ? Math.max(minHeight, Math.min(20 + alts.size() * 25, mc.getMainWindow().getScaledHeight() - 40)) : 20;
        if (MathUtil.isHovered(mouseX, mouseY, this.x, this.y + 20, 160, height - 70) && open) {
            scrollPre += delta * 10;
        }
    }

    public void render(MatrixStack stack, int mouseX, int mouseY) {
        boolean hovered = MathUtil.isHovered(mouseX, mouseY, x, y, 160, 20);
        if (hovered) {
            if (animation < 1f) animation += animationTimer.getElapsedTime() / 200f;
        } else if (animation > 0f) animation -= animationTimer.getElapsedTime() / 200f;

        animation = MathHelper.clamp(animation, 0f, 1f);
        animationTimer.reset();
        scroll = MathUtil.fast(scroll, scrollPre, 10);
        this.x = mc.getMainWindow().getScaledWidth() - 160 - 45;
        float width = 160;
        float minHeight = 20 + (4 * 25);
        float height = open ? Math.max(minHeight, Math.min(20 + alts.size() * 25, mc.getMainWindow().getScaledHeight() - 40)) : 20;
        float inputPanelHeight = 50;

        Stencil.initStencilToWrite();
        DisplayUtils.drawRoundedRect(this.x, this.y, width, height, 8, -1);
        Stencil.readStencilBuffer(1);
        KawaseBlur.blur.BLURRED.draw();
        Stencil.uninitStencilBuffer();

        int startColor = ColorUtils.interpolateColorsBackAndForth(15, 0, ColorUtils.rgb(50, 53, 77), ColorUtils.rgb(60, 63, 87), false);
        int endColor = ColorUtils.interpolateColorsBackAndForth(15, 180, ColorUtils.rgb(70, 73, 97), ColorUtils.rgb(80, 83, 107), false);
        DisplayUtils.drawGradientRoundedRect(this.x, this.y, width, height, 8, startColor, endColor);

        float outlineWidth = 1.5f;
        int outlineColor = ColorUtils.interpolateColorsBackAndForth(15, 0, ColorUtils.rgba(255, 255, 255, hovered ? 100 : 40), ColorUtils.rgba(255, 255, 255, hovered ? 150 : 60), false);
        DisplayUtils.drawRoundedRectOutline(this.x, this.y, width, height, 8, outlineWidth, outlineColor);

        Scissor.push();
        Scissor.setFromComponentCoordinates(this.x, this.y, width - 16, height);
        float scale = 1.0f + (0.05f * animation);
        GlStateManager.pushMatrix();
        GlStateManager.translatef(this.x + 6, this.y + 6, 0);
        GlStateManager.scalef(scale, scale, 1);
        Fonts.montserrat.drawText(stack, "Alt Manager", 0, 0, -1, 8);
        GlStateManager.popMatrix();
        Scissor.unset();
        Scissor.pop();

        Fonts.icons.drawText(stack, open ? "C" : "B", this.x + width - 15, this.y + 6.5f, -1, 8);

        if (open) {
            DisplayUtils.drawRectW(this.x, this.y + 25, width, 0.5f, ColorUtils.rgba(64, 64, 64, 255));

            float listHeight = height - inputPanelHeight - 20;

            Scissor.push();
            Scissor.setFromComponentCoordinates(this.x, this.y + 32, width, listHeight);
            float i = 0;
            for (Alt alt : alts) {
                float altY = this.y + 26 + i * 20 + scroll;
                boolean altHovered = MathUtil.isHovered(mouseX, mouseY, this.x + 5, altY, width - 10, 18);
                DisplayUtils.drawRoundedRect(this.x + 5, altY, width - 10, 18, 4, mc.session.getUsername().equals(alt.name) ? ColorUtils.rgba(40, 40, 46, 180) : ColorUtils.rgba(30, 30, 36, altHovered ? 128 : 64));
                Fonts.montserrat.drawText(stack, alt.name, this.x + 10, altY + 5, -1, 7);
                i++;
            }
            Scissor.unset();
            Scissor.pop();

            float inputY = this.y + height - 25;

            String textToDraw = altName.isEmpty() && !typing ? "nickname" : altName;
            DisplayUtils.drawRoundedRect(this.x + 5, inputY, width - 10, 18, 4, ColorUtils.rgba(30, 30, 36, 64));

            DisplayUtils.drawRoundedRect(this.x + width - 35, inputY + 2, 20, 14, 3, ColorUtils.rgba(40, 40, 46, 128));
            Fonts.montserrat.drawCenteredText(stack, "R", this.x + width - 25, inputY + 5, -1, 7);

            DisplayUtils.drawRoundedRect(this.x + width - 55, inputY + 2, 20, 14, 3, ColorUtils.rgba(40, 40, 46, 128));
            Fonts.montserrat.drawCenteredText(stack, "+", this.x + width - 45, inputY + 5, -1, 7);

            Fonts.montserrat.drawText(stack, textToDraw + (typing ? (System.currentTimeMillis() % 1000 > 500 ? "_" : "") : ""),
                    this.x + 10, inputY + 5, ColorUtils.rgba(255, 255, 255, typing ? 255 : 128), 7);
        }
    }

    public void onChar(char typed) {
        if (typing) {
            if (Fonts.montserrat.getWidth(altName, 7f) < 160 - 70) {
                altName += typed;
            }
        }
    }

    public void onKey(int key) {
        boolean ctrlDown = GLFW.glfwGetKey(mc.getMainWindow().getHandle(), GLFW.GLFW_KEY_LEFT_CONTROL) == GLFW.GLFW_PRESS || GLFW.glfwGetKey(mc.getMainWindow().getHandle(), GLFW.GLFW_KEY_RIGHT_CONTROL) == GLFW.GLFW_PRESS;
        if (typing) {
            if (ctrlDown && key == GLFW.GLFW_KEY_V) {
                try {
                    altName += GLFW.glfwGetClipboardString(mc.getMainWindow().getHandle());
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            if (key == GLFW.GLFW_KEY_BACKSPACE) {
                if (!altName.isEmpty()) {
                    altName = altName.substring(0, altName.length() - 1);
                }
            }
            if (key == GLFW.GLFW_KEY_ENTER) {
                if (altName.length() >= 3) {
                    alts.add(new Alt(altName));
                    altName = "";
                    AltConfig.updateFile();
                }
                typing = false;
            }
        }
    }

    public void click(int mouseX, int mouseY, int button) {
        float width = 160;
        float minHeight = 20 + (4 * 25);
        float height = open ? Math.max(minHeight, Math.min(20 + alts.size() * 25, mc.getMainWindow().getScaledHeight() - 40)) : 20;

        if (MathUtil.isHovered(mouseX, mouseY, this.x, this.y, width, 20)) {
            open = !open;
            if (!open) typing = false;
        }

        if (open) {
            float i = 0;
            for (Alt alt : alts) {
                float altY = this.y + 26 + i * 20 + scroll;
                if (MathUtil.isHovered(mouseX, mouseY, this.x + 5, altY, width - 10, 18)) {
                    if (button == 0) {
                        mc.session = new Session(alt.name, UUID.randomUUID().toString(), "", "mojang");
                        AltConfig.updateFile();
                    } else {
                        alts.remove(alt);
                        AltConfig.updateFile();
                        break;
                    }
                }
                i++;
            }

            float inputY = this.y + height - 25;

            if (MathUtil.isHovered(mouseX, mouseY, this.x + 5, inputY, width - 70, 18)) {
                typing = !typing;
            }

            if (MathUtil.isHovered(mouseX, mouseY, this.x + width - 55, inputY + 2, 20, 14)) {
                if (altName.length() >= 3) {
                    alts.add(new Alt(altName));
                    altName = "";
                    AltConfig.updateFile();
                }
                typing = false;
            }

            if (MathUtil.isHovered(mouseX, mouseY, this.x + width - 35, inputY + 2, 20, 14)) {
                altName = generateRandomName();
                typing = false;
            }
        }
    }


    private String generateRandomName() {
        String[] prefixes = {"Player", "User", "Gamer", "Pro", "Cool", "Epic", "Shadow", "Dark", "Light", "Crystal", "Star", "Moon", "Dragon", "Phoenix", "Wolf", "Tiger", "Eagle", "Ghost", "Ninja", "Warrior", "Knight", "King", "Legend", "Hero", "Storm", "Thunder", "Fire", "Ice", "Wind", "Sky", "Cyber", "Tech", "Pixel", "Bit", "Neon", "Quantum", "Alpha", "Omega", "Ultra", "Mega", "Super", "Hyper"};
        String[] suffixes = {"Master", "Slayer", "Hunter", "Runner", "Walker", "Rider", "Gaming", "Play", "Live", "Stream", "YT", "TTV", "Pro", "God", "Lord", "King", "Boss", "Chief"};
        String prefix = prefixes[ThreadLocalRandom.current().nextInt(prefixes.length)];
        String suffix = suffixes[ThreadLocalRandom.current().nextInt(suffixes.length)];
        int number = ThreadLocalRandom.current().nextInt(100, 999);
        return prefix + suffix + number;
    }
}
1732763094417.png
1732763110127.png
 
Начинающий
Статус
Оффлайн
Регистрация
4 Май 2023
Сообщения
92
Реакции[?]
0
Поинты[?]
0
ну ебать, что сказать начал делать на 3.1 кто не смог запастить альт менеджер (таких много) для тех пойдет там рандом ник и более мение норм код если нужны утилки пишите а вообще это говно не должно было вспливать

Это пиздец....:
package ru.protection.desing.mainmenu;

import com.mojang.blaze3d.platform.GlStateManager;
import ru.protection.client.config.AltConfig;
import ru.protection.system.client.IMinecraft;
import ru.protection.system.math.StopWatch;
import ru.protection.system.render.*;
import ru.protection.system.render.font.Fonts;
import com.mojang.blaze3d.matrix.MatrixStack;
import ru.protection.system.math.MathUtil;
import net.minecraft.util.Session;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector4f;
import org.lwjgl.glfw.GLFW;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;

public class AltWidget implements IMinecraft {
    public final List<Alt> alts = new ArrayList<>();
    private float x;
    private final float y;
    private float animation = 0f;
    private final StopWatch animationTimer = new StopWatch();

    public AltWidget() {
        y = 10;
    }

    public boolean open;
    private String altName = "";
    private boolean typing;
    private float scrollPre;
    private float scroll;

    public void updateScroll(int mouseX, int mouseY, float delta) {
        float minHeight = 20 + (4 * 25);
        float height = open ? Math.max(minHeight, Math.min(20 + alts.size() * 25, mc.getMainWindow().getScaledHeight() - 40)) : 20;
        if (MathUtil.isHovered(mouseX, mouseY, this.x, this.y + 20, 160, height - 70) && open) {
            scrollPre += delta * 10;
        }
    }

    public void render(MatrixStack stack, int mouseX, int mouseY) {
        boolean hovered = MathUtil.isHovered(mouseX, mouseY, x, y, 160, 20);
        if (hovered) {
            if (animation < 1f) animation += animationTimer.getElapsedTime() / 200f;
        } else if (animation > 0f) animation -= animationTimer.getElapsedTime() / 200f;

        animation = MathHelper.clamp(animation, 0f, 1f);
        animationTimer.reset();
        scroll = MathUtil.fast(scroll, scrollPre, 10);
        this.x = mc.getMainWindow().getScaledWidth() - 160 - 45;
        float width = 160;
        float minHeight = 20 + (4 * 25);
        float height = open ? Math.max(minHeight, Math.min(20 + alts.size() * 25, mc.getMainWindow().getScaledHeight() - 40)) : 20;
        float inputPanelHeight = 50;

        Stencil.initStencilToWrite();
        DisplayUtils.drawRoundedRect(this.x, this.y, width, height, 8, -1);
        Stencil.readStencilBuffer(1);
        KawaseBlur.blur.BLURRED.draw();
        Stencil.uninitStencilBuffer();

        int startColor = ColorUtils.interpolateColorsBackAndForth(15, 0, ColorUtils.rgb(50, 53, 77), ColorUtils.rgb(60, 63, 87), false);
        int endColor = ColorUtils.interpolateColorsBackAndForth(15, 180, ColorUtils.rgb(70, 73, 97), ColorUtils.rgb(80, 83, 107), false);
        DisplayUtils.drawGradientRoundedRect(this.x, this.y, width, height, 8, startColor, endColor);

        float outlineWidth = 1.5f;
        int outlineColor = ColorUtils.interpolateColorsBackAndForth(15, 0, ColorUtils.rgba(255, 255, 255, hovered ? 100 : 40), ColorUtils.rgba(255, 255, 255, hovered ? 150 : 60), false);
        DisplayUtils.drawRoundedRectOutline(this.x, this.y, width, height, 8, outlineWidth, outlineColor);

        Scissor.push();
        Scissor.setFromComponentCoordinates(this.x, this.y, width - 16, height);
        float scale = 1.0f + (0.05f * animation);
        GlStateManager.pushMatrix();
        GlStateManager.translatef(this.x + 6, this.y + 6, 0);
        GlStateManager.scalef(scale, scale, 1);
        Fonts.montserrat.drawText(stack, "Alt Manager", 0, 0, -1, 8);
        GlStateManager.popMatrix();
        Scissor.unset();
        Scissor.pop();

        Fonts.icons.drawText(stack, open ? "C" : "B", this.x + width - 15, this.y + 6.5f, -1, 8);

        if (open) {
            DisplayUtils.drawRectW(this.x, this.y + 25, width, 0.5f, ColorUtils.rgba(64, 64, 64, 255));

            float listHeight = height - inputPanelHeight - 20;

            Scissor.push();
            Scissor.setFromComponentCoordinates(this.x, this.y + 32, width, listHeight);
            float i = 0;
            for (Alt alt : alts) {
                float altY = this.y + 26 + i * 20 + scroll;
                boolean altHovered = MathUtil.isHovered(mouseX, mouseY, this.x + 5, altY, width - 10, 18);
                DisplayUtils.drawRoundedRect(this.x + 5, altY, width - 10, 18, 4, mc.session.getUsername().equals(alt.name) ? ColorUtils.rgba(40, 40, 46, 180) : ColorUtils.rgba(30, 30, 36, altHovered ? 128 : 64));
                Fonts.montserrat.drawText(stack, alt.name, this.x + 10, altY + 5, -1, 7);
                i++;
            }
            Scissor.unset();
            Scissor.pop();

            float inputY = this.y + height - 25;

            String textToDraw = altName.isEmpty() && !typing ? "nickname" : altName;
            DisplayUtils.drawRoundedRect(this.x + 5, inputY, width - 10, 18, 4, ColorUtils.rgba(30, 30, 36, 64));

            DisplayUtils.drawRoundedRect(this.x + width - 35, inputY + 2, 20, 14, 3, ColorUtils.rgba(40, 40, 46, 128));
            Fonts.montserrat.drawCenteredText(stack, "R", this.x + width - 25, inputY + 5, -1, 7);

            DisplayUtils.drawRoundedRect(this.x + width - 55, inputY + 2, 20, 14, 3, ColorUtils.rgba(40, 40, 46, 128));
            Fonts.montserrat.drawCenteredText(stack, "+", this.x + width - 45, inputY + 5, -1, 7);

            Fonts.montserrat.drawText(stack, textToDraw + (typing ? (System.currentTimeMillis() % 1000 > 500 ? "_" : "") : ""),
                    this.x + 10, inputY + 5, ColorUtils.rgba(255, 255, 255, typing ? 255 : 128), 7);
        }
    }

    public void onChar(char typed) {
        if (typing) {
            if (Fonts.montserrat.getWidth(altName, 7f) < 160 - 70) {
                altName += typed;
            }
        }
    }

    public void onKey(int key) {
        boolean ctrlDown = GLFW.glfwGetKey(mc.getMainWindow().getHandle(), GLFW.GLFW_KEY_LEFT_CONTROL) == GLFW.GLFW_PRESS || GLFW.glfwGetKey(mc.getMainWindow().getHandle(), GLFW.GLFW_KEY_RIGHT_CONTROL) == GLFW.GLFW_PRESS;
        if (typing) {
            if (ctrlDown && key == GLFW.GLFW_KEY_V) {
                try {
                    altName += GLFW.glfwGetClipboardString(mc.getMainWindow().getHandle());
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            if (key == GLFW.GLFW_KEY_BACKSPACE) {
                if (!altName.isEmpty()) {
                    altName = altName.substring(0, altName.length() - 1);
                }
            }
            if (key == GLFW.GLFW_KEY_ENTER) {
                if (altName.length() >= 3) {
                    alts.add(new Alt(altName));
                    altName = "";
                    AltConfig.updateFile();
                }
                typing = false;
            }
        }
    }

    public void click(int mouseX, int mouseY, int button) {
        float width = 160;
        float minHeight = 20 + (4 * 25);
        float height = open ? Math.max(minHeight, Math.min(20 + alts.size() * 25, mc.getMainWindow().getScaledHeight() - 40)) : 20;

        if (MathUtil.isHovered(mouseX, mouseY, this.x, this.y, width, 20)) {
            open = !open;
            if (!open) typing = false;
        }

        if (open) {
            float i = 0;
            for (Alt alt : alts) {
                float altY = this.y + 26 + i * 20 + scroll;
                if (MathUtil.isHovered(mouseX, mouseY, this.x + 5, altY, width - 10, 18)) {
                    if (button == 0) {
                        mc.session = new Session(alt.name, UUID.randomUUID().toString(), "", "mojang");
                        AltConfig.updateFile();
                    } else {
                        alts.remove(alt);
                        AltConfig.updateFile();
                        break;
                    }
                }
                i++;
            }

            float inputY = this.y + height - 25;

            if (MathUtil.isHovered(mouseX, mouseY, this.x + 5, inputY, width - 70, 18)) {
                typing = !typing;
            }

            if (MathUtil.isHovered(mouseX, mouseY, this.x + width - 55, inputY + 2, 20, 14)) {
                if (altName.length() >= 3) {
                    alts.add(new Alt(altName));
                    altName = "";
                    AltConfig.updateFile();
                }
                typing = false;
            }

            if (MathUtil.isHovered(mouseX, mouseY, this.x + width - 35, inputY + 2, 20, 14)) {
                altName = generateRandomName();
                typing = false;
            }
        }
    }


    private String generateRandomName() {
        String[] prefixes = {"Player", "User", "Gamer", "Pro", "Cool", "Epic", "Shadow", "Dark", "Light", "Crystal", "Star", "Moon", "Dragon", "Phoenix", "Wolf", "Tiger", "Eagle", "Ghost", "Ninja", "Warrior", "Knight", "King", "Legend", "Hero", "Storm", "Thunder", "Fire", "Ice", "Wind", "Sky", "Cyber", "Tech", "Pixel", "Bit", "Neon", "Quantum", "Alpha", "Omega", "Ultra", "Mega", "Super", "Hyper"};
        String[] suffixes = {"Master", "Slayer", "Hunter", "Runner", "Walker", "Rider", "Gaming", "Play", "Live", "Stream", "YT", "TTV", "Pro", "God", "Lord", "King", "Boss", "Chief"};
        String prefix = prefixes[ThreadLocalRandom.current().nextInt(prefixes.length)];
        String suffix = suffixes[ThreadLocalRandom.current().nextInt(suffixes.length)];
        int number = ThreadLocalRandom.current().nextInt(100, 999);
        return prefix + suffix + number;
    }
}
Посмотреть вложение 291527
Посмотреть вложение 291528
Дай пожалуйста ColorUtils.interpolateColorsBackAndForth, drawRoundedRectOutline и drawGradientRoundedRect
и еще animationTimer.getElapsedTime()
 
Начинающий
Статус
Оффлайн
Регистрация
17 Июн 2024
Сообщения
179
Реакции[?]
0
Поинты[?]
0
Дай пожалуйста ColorUtils.interpolateColorsBackAndForth, drawRoundedRectOutline и drawGradientRoundedRect
и еще animationTimer.getElapsedTime()
1.
interpolateColorsBackAndForth:
  public static int interpolateColorsBackAndForth(int speed, int index, int start, int end, boolean trueColor) {
        int angle = (int) (((System.currentTimeMillis()) / speed + index) % 360);
        angle = (angle >= 180 ? 360 - angle : angle) * 2;
        return interpolateColor(start, end, angle / 360f);
    }

2.

drawRoundedRectOutline:
    public static void drawRoundedRectOutline(float x, float y, float width, float height, float radius, float lineWidth, int color) {
        float alpha = (color >> 24 & 0xFF) / 255.0F;
        float red = (color >> 16 & 0xFF) / 255.0F;
        float green = (color >> 8 & 0xFF) / 255.0F;
        float blue = (color & 0xFF) / 255.0F;

        GlStateManager.enableBlend();
        GlStateManager.disableTexture();
        GlStateManager.blendFuncSeparate(770, 771, 1, 0);
        GL11.glLineWidth(lineWidth);

        Tessellator tessellator = Tessellator.getInstance();
        BufferBuilder buffer = tessellator.getBuffer();
        buffer.begin(GL_LINE_LOOP, DefaultVertexFormats.POSITION_COLOR);

        double angleStep = Math.PI / 2 / 8;

        for (int i = 0; i <= 8; i++) {
            double angle = Math.PI + angleStep * i;
            buffer.pos(x + radius + Math.cos(angle) * radius, y + radius + Math.sin(angle) * radius, 0).color(red, green, blue, alpha).endVertex();
        }
        
        for (int i = 0; i <= 8; i++) {
            double angle = 3 * Math.PI / 2 + angleStep * i;
            buffer.pos(x + width - radius + Math.cos(angle) * radius, y + radius + Math.sin(angle) * radius, 0).color(red, green, blue, alpha).endVertex();
        }
        
        for (int i = 0; i <= 8; i++) {
            double angle = angleStep * i;
            buffer.pos(x + width - radius + Math.cos(angle) * radius, y + height - radius + Math.sin(angle) * radius, 0).color(red, green, blue, alpha).endVertex();
        }
        
        for (int i = 0; i <= 8; i++) {
            double angle = Math.PI / 2 + angleStep * i;
            buffer.pos(x + radius + Math.cos(angle) * radius, y + height - radius + Math.sin(angle) * radius, 0).color(red, green, blue, alpha).endVertex();
        }

        tessellator.draw();

        GlStateManager.enableTexture();
        GlStateManager.disableBlend();
    }
3.

drawGradientRoundedRect:
 public static void drawGradientRoundedRect(float x, float y, float width, float height, float radius, int startColor, int endColor) {
        GlStateManager.enableBlend();
        GlStateManager.disableTexture();
        GlStateManager.blendFuncSeparate(770, 771, 1, 0);

        float alpha1 = (startColor >> 24 & 0xFF) / 255.0F;
        float red1 = (startColor >> 16 & 0xFF) / 255.0F;
        float green1 = (startColor >> 8 & 0xFF) / 255.0F;
        float blue1 = (startColor & 0xFF) / 255.0F;

        float alpha2 = (endColor >> 24 & 0xFF) / 255.0F;
        float red2 = (endColor >> 16 & 0xFF) / 255.0F;
        float green2 = (endColor >> 8 & 0xFF) / 255.0F;
        float blue2 = (endColor & 0xFF) / 255.0F;

        Tessellator tessellator = Tessellator.getInstance();
        BufferBuilder buffer = tessellator.getBuffer();
        buffer.begin(7, DefaultVertexFormats.POSITION_COLOR);

        buffer.pos(x + radius, y, 0).color(red1, green1, blue1, alpha1).endVertex();
        buffer.pos(x + width - radius, y, 0).color(red1, green1, blue1, alpha1).endVertex();
        buffer.pos(x + width - radius, y + height, 0).color(red2, green2, blue2, alpha2).endVertex();
        buffer.pos(x + radius, y + height, 0).color(red2, green2, blue2, alpha2).endVertex();

        tessellator.draw();

        drawRoundedCorner(x + radius, y + radius, radius, 0, startColor);
        drawRoundedCorner(x + width - radius, y + radius, radius, 1, startColor);
        drawRoundedCorner(x + width - radius, y + height - radius, radius, 2, endColor);
        drawRoundedCorner(x + radius, y + height - radius, radius, 3, endColor);

        GlStateManager.enableTexture();
        GlStateManager.disableBlend();
    }
4.

getElapsedTime:
    public float getElapsedTime() {
        return (float) (System.currentTimeMillis() - lastMS);
    }
 
Начинающий
Статус
Оффлайн
Регистрация
16 Апр 2024
Сообщения
297
Реакции[?]
3
Поинты[?]
1K
ну ебать, что сказать начал делать на 3.1 кто не смог запастить альт менеджер (таких много) для тех пойдет там рандом ник и более мение норм код если нужны утилки пишите а вообще это говно не должно было вспливать

Это пиздец....:
package ru.protection.desing.mainmenu;

import com.mojang.blaze3d.platform.GlStateManager;
import ru.protection.client.config.AltConfig;
import ru.protection.system.client.IMinecraft;
import ru.protection.system.math.StopWatch;
import ru.protection.system.render.*;
import ru.protection.system.render.font.Fonts;
import com.mojang.blaze3d.matrix.MatrixStack;
import ru.protection.system.math.MathUtil;
import net.minecraft.util.Session;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector4f;
import org.lwjgl.glfw.GLFW;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;

public class AltWidget implements IMinecraft {
    public final List<Alt> alts = new ArrayList<>();
    private float x;
    private final float y;
    private float animation = 0f;
    private final StopWatch animationTimer = new StopWatch();

    public AltWidget() {
        y = 10;
    }

    public boolean open;
    private String altName = "";
    private boolean typing;
    private float scrollPre;
    private float scroll;

    public void updateScroll(int mouseX, int mouseY, float delta) {
        float minHeight = 20 + (4 * 25);
        float height = open ? Math.max(minHeight, Math.min(20 + alts.size() * 25, mc.getMainWindow().getScaledHeight() - 40)) : 20;
        if (MathUtil.isHovered(mouseX, mouseY, this.x, this.y + 20, 160, height - 70) && open) {
            scrollPre += delta * 10;
        }
    }

    public void render(MatrixStack stack, int mouseX, int mouseY) {
        boolean hovered = MathUtil.isHovered(mouseX, mouseY, x, y, 160, 20);
        if (hovered) {
            if (animation < 1f) animation += animationTimer.getElapsedTime() / 200f;
        } else if (animation > 0f) animation -= animationTimer.getElapsedTime() / 200f;

        animation = MathHelper.clamp(animation, 0f, 1f);
        animationTimer.reset();
        scroll = MathUtil.fast(scroll, scrollPre, 10);
        this.x = mc.getMainWindow().getScaledWidth() - 160 - 45;
        float width = 160;
        float minHeight = 20 + (4 * 25);
        float height = open ? Math.max(minHeight, Math.min(20 + alts.size() * 25, mc.getMainWindow().getScaledHeight() - 40)) : 20;
        float inputPanelHeight = 50;

        Stencil.initStencilToWrite();
        DisplayUtils.drawRoundedRect(this.x, this.y, width, height, 8, -1);
        Stencil.readStencilBuffer(1);
        KawaseBlur.blur.BLURRED.draw();
        Stencil.uninitStencilBuffer();

        int startColor = ColorUtils.interpolateColorsBackAndForth(15, 0, ColorUtils.rgb(50, 53, 77), ColorUtils.rgb(60, 63, 87), false);
        int endColor = ColorUtils.interpolateColorsBackAndForth(15, 180, ColorUtils.rgb(70, 73, 97), ColorUtils.rgb(80, 83, 107), false);
        DisplayUtils.drawGradientRoundedRect(this.x, this.y, width, height, 8, startColor, endColor);

        float outlineWidth = 1.5f;
        int outlineColor = ColorUtils.interpolateColorsBackAndForth(15, 0, ColorUtils.rgba(255, 255, 255, hovered ? 100 : 40), ColorUtils.rgba(255, 255, 255, hovered ? 150 : 60), false);
        DisplayUtils.drawRoundedRectOutline(this.x, this.y, width, height, 8, outlineWidth, outlineColor);

        Scissor.push();
        Scissor.setFromComponentCoordinates(this.x, this.y, width - 16, height);
        float scale = 1.0f + (0.05f * animation);
        GlStateManager.pushMatrix();
        GlStateManager.translatef(this.x + 6, this.y + 6, 0);
        GlStateManager.scalef(scale, scale, 1);
        Fonts.montserrat.drawText(stack, "Alt Manager", 0, 0, -1, 8);
        GlStateManager.popMatrix();
        Scissor.unset();
        Scissor.pop();

        Fonts.icons.drawText(stack, open ? "C" : "B", this.x + width - 15, this.y + 6.5f, -1, 8);

        if (open) {
            DisplayUtils.drawRectW(this.x, this.y + 25, width, 0.5f, ColorUtils.rgba(64, 64, 64, 255));

            float listHeight = height - inputPanelHeight - 20;

            Scissor.push();
            Scissor.setFromComponentCoordinates(this.x, this.y + 32, width, listHeight);
            float i = 0;
            for (Alt alt : alts) {
                float altY = this.y + 26 + i * 20 + scroll;
                boolean altHovered = MathUtil.isHovered(mouseX, mouseY, this.x + 5, altY, width - 10, 18);
                DisplayUtils.drawRoundedRect(this.x + 5, altY, width - 10, 18, 4, mc.session.getUsername().equals(alt.name) ? ColorUtils.rgba(40, 40, 46, 180) : ColorUtils.rgba(30, 30, 36, altHovered ? 128 : 64));
                Fonts.montserrat.drawText(stack, alt.name, this.x + 10, altY + 5, -1, 7);
                i++;
            }
            Scissor.unset();
            Scissor.pop();

            float inputY = this.y + height - 25;

            String textToDraw = altName.isEmpty() && !typing ? "nickname" : altName;
            DisplayUtils.drawRoundedRect(this.x + 5, inputY, width - 10, 18, 4, ColorUtils.rgba(30, 30, 36, 64));

            DisplayUtils.drawRoundedRect(this.x + width - 35, inputY + 2, 20, 14, 3, ColorUtils.rgba(40, 40, 46, 128));
            Fonts.montserrat.drawCenteredText(stack, "R", this.x + width - 25, inputY + 5, -1, 7);

            DisplayUtils.drawRoundedRect(this.x + width - 55, inputY + 2, 20, 14, 3, ColorUtils.rgba(40, 40, 46, 128));
            Fonts.montserrat.drawCenteredText(stack, "+", this.x + width - 45, inputY + 5, -1, 7);

            Fonts.montserrat.drawText(stack, textToDraw + (typing ? (System.currentTimeMillis() % 1000 > 500 ? "_" : "") : ""),
                    this.x + 10, inputY + 5, ColorUtils.rgba(255, 255, 255, typing ? 255 : 128), 7);
        }
    }

    public void onChar(char typed) {
        if (typing) {
            if (Fonts.montserrat.getWidth(altName, 7f) < 160 - 70) {
                altName += typed;
            }
        }
    }

    public void onKey(int key) {
        boolean ctrlDown = GLFW.glfwGetKey(mc.getMainWindow().getHandle(), GLFW.GLFW_KEY_LEFT_CONTROL) == GLFW.GLFW_PRESS || GLFW.glfwGetKey(mc.getMainWindow().getHandle(), GLFW.GLFW_KEY_RIGHT_CONTROL) == GLFW.GLFW_PRESS;
        if (typing) {
            if (ctrlDown && key == GLFW.GLFW_KEY_V) {
                try {
                    altName += GLFW.glfwGetClipboardString(mc.getMainWindow().getHandle());
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            if (key == GLFW.GLFW_KEY_BACKSPACE) {
                if (!altName.isEmpty()) {
                    altName = altName.substring(0, altName.length() - 1);
                }
            }
            if (key == GLFW.GLFW_KEY_ENTER) {
                if (altName.length() >= 3) {
                    alts.add(new Alt(altName));
                    altName = "";
                    AltConfig.updateFile();
                }
                typing = false;
            }
        }
    }

    public void click(int mouseX, int mouseY, int button) {
        float width = 160;
        float minHeight = 20 + (4 * 25);
        float height = open ? Math.max(minHeight, Math.min(20 + alts.size() * 25, mc.getMainWindow().getScaledHeight() - 40)) : 20;

        if (MathUtil.isHovered(mouseX, mouseY, this.x, this.y, width, 20)) {
            open = !open;
            if (!open) typing = false;
        }

        if (open) {
            float i = 0;
            for (Alt alt : alts) {
                float altY = this.y + 26 + i * 20 + scroll;
                if (MathUtil.isHovered(mouseX, mouseY, this.x + 5, altY, width - 10, 18)) {
                    if (button == 0) {
                        mc.session = new Session(alt.name, UUID.randomUUID().toString(), "", "mojang");
                        AltConfig.updateFile();
                    } else {
                        alts.remove(alt);
                        AltConfig.updateFile();
                        break;
                    }
                }
                i++;
            }

            float inputY = this.y + height - 25;

            if (MathUtil.isHovered(mouseX, mouseY, this.x + 5, inputY, width - 70, 18)) {
                typing = !typing;
            }

            if (MathUtil.isHovered(mouseX, mouseY, this.x + width - 55, inputY + 2, 20, 14)) {
                if (altName.length() >= 3) {
                    alts.add(new Alt(altName));
                    altName = "";
                    AltConfig.updateFile();
                }
                typing = false;
            }

            if (MathUtil.isHovered(mouseX, mouseY, this.x + width - 35, inputY + 2, 20, 14)) {
                altName = generateRandomName();
                typing = false;
            }
        }
    }


    private String generateRandomName() {
        String[] prefixes = {"Player", "User", "Gamer", "Pro", "Cool", "Epic", "Shadow", "Dark", "Light", "Crystal", "Star", "Moon", "Dragon", "Phoenix", "Wolf", "Tiger", "Eagle", "Ghost", "Ninja", "Warrior", "Knight", "King", "Legend", "Hero", "Storm", "Thunder", "Fire", "Ice", "Wind", "Sky", "Cyber", "Tech", "Pixel", "Bit", "Neon", "Quantum", "Alpha", "Omega", "Ultra", "Mega", "Super", "Hyper"};
        String[] suffixes = {"Master", "Slayer", "Hunter", "Runner", "Walker", "Rider", "Gaming", "Play", "Live", "Stream", "YT", "TTV", "Pro", "God", "Lord", "King", "Boss", "Chief"};
        String prefix = prefixes[ThreadLocalRandom.current().nextInt(prefixes.length)];
        String suffix = suffixes[ThreadLocalRandom.current().nextInt(suffixes.length)];
        int number = ThreadLocalRandom.current().nextInt(100, 999);
        return prefix + suffix + number;
    }
}
Посмотреть вложение 291527
Посмотреть вложение 291528
ну если сделать окном то ваще имба будет
 
Начинающий
Статус
Оффлайн
Регистрация
28 Окт 2024
Сообщения
39
Реакции[?]
0
Поинты[?]
0
ну ебать, что сказать начал делать на 3.1 кто не смог запастить альт менеджер (таких много) для тех пойдет там рандом ник и более мение норм код если нужны утилки пишите а вообще это говно не должно было вспливать

Это пиздец....:
package ru.protection.desing.mainmenu;

import com.mojang.blaze3d.platform.GlStateManager;
import ru.protection.client.config.AltConfig;
import ru.protection.system.client.IMinecraft;
import ru.protection.system.math.StopWatch;
import ru.protection.system.render.*;
import ru.protection.system.render.font.Fonts;
import com.mojang.blaze3d.matrix.MatrixStack;
import ru.protection.system.math.MathUtil;
import net.minecraft.util.Session;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector4f;
import org.lwjgl.glfw.GLFW;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;

public class AltWidget implements IMinecraft {
    public final List<Alt> alts = new ArrayList<>();
    private float x;
    private final float y;
    private float animation = 0f;
    private final StopWatch animationTimer = new StopWatch();

    public AltWidget() {
        y = 10;
    }

    public boolean open;
    private String altName = "";
    private boolean typing;
    private float scrollPre;
    private float scroll;

    public void updateScroll(int mouseX, int mouseY, float delta) {
        float minHeight = 20 + (4 * 25);
        float height = open ? Math.max(minHeight, Math.min(20 + alts.size() * 25, mc.getMainWindow().getScaledHeight() - 40)) : 20;
        if (MathUtil.isHovered(mouseX, mouseY, this.x, this.y + 20, 160, height - 70) && open) {
            scrollPre += delta * 10;
        }
    }

    public void render(MatrixStack stack, int mouseX, int mouseY) {
        boolean hovered = MathUtil.isHovered(mouseX, mouseY, x, y, 160, 20);
        if (hovered) {
            if (animation < 1f) animation += animationTimer.getElapsedTime() / 200f;
        } else if (animation > 0f) animation -= animationTimer.getElapsedTime() / 200f;

        animation = MathHelper.clamp(animation, 0f, 1f);
        animationTimer.reset();
        scroll = MathUtil.fast(scroll, scrollPre, 10);
        this.x = mc.getMainWindow().getScaledWidth() - 160 - 45;
        float width = 160;
        float minHeight = 20 + (4 * 25);
        float height = open ? Math.max(minHeight, Math.min(20 + alts.size() * 25, mc.getMainWindow().getScaledHeight() - 40)) : 20;
        float inputPanelHeight = 50;

        Stencil.initStencilToWrite();
        DisplayUtils.drawRoundedRect(this.x, this.y, width, height, 8, -1);
        Stencil.readStencilBuffer(1);
        KawaseBlur.blur.BLURRED.draw();
        Stencil.uninitStencilBuffer();

        int startColor = ColorUtils.interpolateColorsBackAndForth(15, 0, ColorUtils.rgb(50, 53, 77), ColorUtils.rgb(60, 63, 87), false);
        int endColor = ColorUtils.interpolateColorsBackAndForth(15, 180, ColorUtils.rgb(70, 73, 97), ColorUtils.rgb(80, 83, 107), false);
        DisplayUtils.drawGradientRoundedRect(this.x, this.y, width, height, 8, startColor, endColor);

        float outlineWidth = 1.5f;
        int outlineColor = ColorUtils.interpolateColorsBackAndForth(15, 0, ColorUtils.rgba(255, 255, 255, hovered ? 100 : 40), ColorUtils.rgba(255, 255, 255, hovered ? 150 : 60), false);
        DisplayUtils.drawRoundedRectOutline(this.x, this.y, width, height, 8, outlineWidth, outlineColor);

        Scissor.push();
        Scissor.setFromComponentCoordinates(this.x, this.y, width - 16, height);
        float scale = 1.0f + (0.05f * animation);
        GlStateManager.pushMatrix();
        GlStateManager.translatef(this.x + 6, this.y + 6, 0);
        GlStateManager.scalef(scale, scale, 1);
        Fonts.montserrat.drawText(stack, "Alt Manager", 0, 0, -1, 8);
        GlStateManager.popMatrix();
        Scissor.unset();
        Scissor.pop();

        Fonts.icons.drawText(stack, open ? "C" : "B", this.x + width - 15, this.y + 6.5f, -1, 8);

        if (open) {
            DisplayUtils.drawRectW(this.x, this.y + 25, width, 0.5f, ColorUtils.rgba(64, 64, 64, 255));

            float listHeight = height - inputPanelHeight - 20;

            Scissor.push();
            Scissor.setFromComponentCoordinates(this.x, this.y + 32, width, listHeight);
            float i = 0;
            for (Alt alt : alts) {
                float altY = this.y + 26 + i * 20 + scroll;
                boolean altHovered = MathUtil.isHovered(mouseX, mouseY, this.x + 5, altY, width - 10, 18);
                DisplayUtils.drawRoundedRect(this.x + 5, altY, width - 10, 18, 4, mc.session.getUsername().equals(alt.name) ? ColorUtils.rgba(40, 40, 46, 180) : ColorUtils.rgba(30, 30, 36, altHovered ? 128 : 64));
                Fonts.montserrat.drawText(stack, alt.name, this.x + 10, altY + 5, -1, 7);
                i++;
            }
            Scissor.unset();
            Scissor.pop();

            float inputY = this.y + height - 25;

            String textToDraw = altName.isEmpty() && !typing ? "nickname" : altName;
            DisplayUtils.drawRoundedRect(this.x + 5, inputY, width - 10, 18, 4, ColorUtils.rgba(30, 30, 36, 64));

            DisplayUtils.drawRoundedRect(this.x + width - 35, inputY + 2, 20, 14, 3, ColorUtils.rgba(40, 40, 46, 128));
            Fonts.montserrat.drawCenteredText(stack, "R", this.x + width - 25, inputY + 5, -1, 7);

            DisplayUtils.drawRoundedRect(this.x + width - 55, inputY + 2, 20, 14, 3, ColorUtils.rgba(40, 40, 46, 128));
            Fonts.montserrat.drawCenteredText(stack, "+", this.x + width - 45, inputY + 5, -1, 7);

            Fonts.montserrat.drawText(stack, textToDraw + (typing ? (System.currentTimeMillis() % 1000 > 500 ? "_" : "") : ""),
                    this.x + 10, inputY + 5, ColorUtils.rgba(255, 255, 255, typing ? 255 : 128), 7);
        }
    }

    public void onChar(char typed) {
        if (typing) {
            if (Fonts.montserrat.getWidth(altName, 7f) < 160 - 70) {
                altName += typed;
            }
        }
    }

    public void onKey(int key) {
        boolean ctrlDown = GLFW.glfwGetKey(mc.getMainWindow().getHandle(), GLFW.GLFW_KEY_LEFT_CONTROL) == GLFW.GLFW_PRESS || GLFW.glfwGetKey(mc.getMainWindow().getHandle(), GLFW.GLFW_KEY_RIGHT_CONTROL) == GLFW.GLFW_PRESS;
        if (typing) {
            if (ctrlDown && key == GLFW.GLFW_KEY_V) {
                try {
                    altName += GLFW.glfwGetClipboardString(mc.getMainWindow().getHandle());
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            if (key == GLFW.GLFW_KEY_BACKSPACE) {
                if (!altName.isEmpty()) {
                    altName = altName.substring(0, altName.length() - 1);
                }
            }
            if (key == GLFW.GLFW_KEY_ENTER) {
                if (altName.length() >= 3) {
                    alts.add(new Alt(altName));
                    altName = "";
                    AltConfig.updateFile();
                }
                typing = false;
            }
        }
    }

    public void click(int mouseX, int mouseY, int button) {
        float width = 160;
        float minHeight = 20 + (4 * 25);
        float height = open ? Math.max(minHeight, Math.min(20 + alts.size() * 25, mc.getMainWindow().getScaledHeight() - 40)) : 20;

        if (MathUtil.isHovered(mouseX, mouseY, this.x, this.y, width, 20)) {
            open = !open;
            if (!open) typing = false;
        }

        if (open) {
            float i = 0;
            for (Alt alt : alts) {
                float altY = this.y + 26 + i * 20 + scroll;
                if (MathUtil.isHovered(mouseX, mouseY, this.x + 5, altY, width - 10, 18)) {
                    if (button == 0) {
                        mc.session = new Session(alt.name, UUID.randomUUID().toString(), "", "mojang");
                        AltConfig.updateFile();
                    } else {
                        alts.remove(alt);
                        AltConfig.updateFile();
                        break;
                    }
                }
                i++;
            }

            float inputY = this.y + height - 25;

            if (MathUtil.isHovered(mouseX, mouseY, this.x + 5, inputY, width - 70, 18)) {
                typing = !typing;
            }

            if (MathUtil.isHovered(mouseX, mouseY, this.x + width - 55, inputY + 2, 20, 14)) {
                if (altName.length() >= 3) {
                    alts.add(new Alt(altName));
                    altName = "";
                    AltConfig.updateFile();
                }
                typing = false;
            }

            if (MathUtil.isHovered(mouseX, mouseY, this.x + width - 35, inputY + 2, 20, 14)) {
                altName = generateRandomName();
                typing = false;
            }
        }
    }


    private String generateRandomName() {
        String[] prefixes = {"Player", "User", "Gamer", "Pro", "Cool", "Epic", "Shadow", "Dark", "Light", "Crystal", "Star", "Moon", "Dragon", "Phoenix", "Wolf", "Tiger", "Eagle", "Ghost", "Ninja", "Warrior", "Knight", "King", "Legend", "Hero", "Storm", "Thunder", "Fire", "Ice", "Wind", "Sky", "Cyber", "Tech", "Pixel", "Bit", "Neon", "Quantum", "Alpha", "Omega", "Ultra", "Mega", "Super", "Hyper"};
        String[] suffixes = {"Master", "Slayer", "Hunter", "Runner", "Walker", "Rider", "Gaming", "Play", "Live", "Stream", "YT", "TTV", "Pro", "God", "Lord", "King", "Boss", "Chief"};
        String prefix = prefixes[ThreadLocalRandom.current().nextInt(prefixes.length)];
        String suffix = suffixes[ThreadLocalRandom.current().nextInt(suffixes.length)];
        int number = ThreadLocalRandom.current().nextInt(100, 999);
        return prefix + suffix + number;
    }
}
Посмотреть вложение 291527
Посмотреть вложение 291528
Фул MainMenu сливай
ну ебать, что сказать начал делать на 3.1 кто не смог запастить альт менеджер (таких много) для тех пойдет там рандом ник и более мение норм код если нужны утилки пишите а вообще это говно не должно было вспливать

Это пиздец....:
package ru.protection.desing.mainmenu;

import com.mojang.blaze3d.platform.GlStateManager;
import ru.protection.client.config.AltConfig;
import ru.protection.system.client.IMinecraft;
import ru.protection.system.math.StopWatch;
import ru.protection.system.render.*;
import ru.protection.system.render.font.Fonts;
import com.mojang.blaze3d.matrix.MatrixStack;
import ru.protection.system.math.MathUtil;
import net.minecraft.util.Session;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector4f;
import org.lwjgl.glfw.GLFW;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;

public class AltWidget implements IMinecraft {
    public final List<Alt> alts = new ArrayList<>();
    private float x;
    private final float y;
    private float animation = 0f;
    private final StopWatch animationTimer = new StopWatch();

    public AltWidget() {
        y = 10;
    }

    public boolean open;
    private String altName = "";
    private boolean typing;
    private float scrollPre;
    private float scroll;

    public void updateScroll(int mouseX, int mouseY, float delta) {
        float minHeight = 20 + (4 * 25);
        float height = open ? Math.max(minHeight, Math.min(20 + alts.size() * 25, mc.getMainWindow().getScaledHeight() - 40)) : 20;
        if (MathUtil.isHovered(mouseX, mouseY, this.x, this.y + 20, 160, height - 70) && open) {
            scrollPre += delta * 10;
        }
    }

    public void render(MatrixStack stack, int mouseX, int mouseY) {
        boolean hovered = MathUtil.isHovered(mouseX, mouseY, x, y, 160, 20);
        if (hovered) {
            if (animation < 1f) animation += animationTimer.getElapsedTime() / 200f;
        } else if (animation > 0f) animation -= animationTimer.getElapsedTime() / 200f;

        animation = MathHelper.clamp(animation, 0f, 1f);
        animationTimer.reset();
        scroll = MathUtil.fast(scroll, scrollPre, 10);
        this.x = mc.getMainWindow().getScaledWidth() - 160 - 45;
        float width = 160;
        float minHeight = 20 + (4 * 25);
        float height = open ? Math.max(minHeight, Math.min(20 + alts.size() * 25, mc.getMainWindow().getScaledHeight() - 40)) : 20;
        float inputPanelHeight = 50;

        Stencil.initStencilToWrite();
        DisplayUtils.drawRoundedRect(this.x, this.y, width, height, 8, -1);
        Stencil.readStencilBuffer(1);
        KawaseBlur.blur.BLURRED.draw();
        Stencil.uninitStencilBuffer();

        int startColor = ColorUtils.interpolateColorsBackAndForth(15, 0, ColorUtils.rgb(50, 53, 77), ColorUtils.rgb(60, 63, 87), false);
        int endColor = ColorUtils.interpolateColorsBackAndForth(15, 180, ColorUtils.rgb(70, 73, 97), ColorUtils.rgb(80, 83, 107), false);
        DisplayUtils.drawGradientRoundedRect(this.x, this.y, width, height, 8, startColor, endColor);

        float outlineWidth = 1.5f;
        int outlineColor = ColorUtils.interpolateColorsBackAndForth(15, 0, ColorUtils.rgba(255, 255, 255, hovered ? 100 : 40), ColorUtils.rgba(255, 255, 255, hovered ? 150 : 60), false);
        DisplayUtils.drawRoundedRectOutline(this.x, this.y, width, height, 8, outlineWidth, outlineColor);

        Scissor.push();
        Scissor.setFromComponentCoordinates(this.x, this.y, width - 16, height);
        float scale = 1.0f + (0.05f * animation);
        GlStateManager.pushMatrix();
        GlStateManager.translatef(this.x + 6, this.y + 6, 0);
        GlStateManager.scalef(scale, scale, 1);
        Fonts.montserrat.drawText(stack, "Alt Manager", 0, 0, -1, 8);
        GlStateManager.popMatrix();
        Scissor.unset();
        Scissor.pop();

        Fonts.icons.drawText(stack, open ? "C" : "B", this.x + width - 15, this.y + 6.5f, -1, 8);

        if (open) {
            DisplayUtils.drawRectW(this.x, this.y + 25, width, 0.5f, ColorUtils.rgba(64, 64, 64, 255));

            float listHeight = height - inputPanelHeight - 20;

            Scissor.push();
            Scissor.setFromComponentCoordinates(this.x, this.y + 32, width, listHeight);
            float i = 0;
            for (Alt alt : alts) {
                float altY = this.y + 26 + i * 20 + scroll;
                boolean altHovered = MathUtil.isHovered(mouseX, mouseY, this.x + 5, altY, width - 10, 18);
                DisplayUtils.drawRoundedRect(this.x + 5, altY, width - 10, 18, 4, mc.session.getUsername().equals(alt.name) ? ColorUtils.rgba(40, 40, 46, 180) : ColorUtils.rgba(30, 30, 36, altHovered ? 128 : 64));
                Fonts.montserrat.drawText(stack, alt.name, this.x + 10, altY + 5, -1, 7);
                i++;
            }
            Scissor.unset();
            Scissor.pop();

            float inputY = this.y + height - 25;

            String textToDraw = altName.isEmpty() && !typing ? "nickname" : altName;
            DisplayUtils.drawRoundedRect(this.x + 5, inputY, width - 10, 18, 4, ColorUtils.rgba(30, 30, 36, 64));

            DisplayUtils.drawRoundedRect(this.x + width - 35, inputY + 2, 20, 14, 3, ColorUtils.rgba(40, 40, 46, 128));
            Fonts.montserrat.drawCenteredText(stack, "R", this.x + width - 25, inputY + 5, -1, 7);

            DisplayUtils.drawRoundedRect(this.x + width - 55, inputY + 2, 20, 14, 3, ColorUtils.rgba(40, 40, 46, 128));
            Fonts.montserrat.drawCenteredText(stack, "+", this.x + width - 45, inputY + 5, -1, 7);

            Fonts.montserrat.drawText(stack, textToDraw + (typing ? (System.currentTimeMillis() % 1000 > 500 ? "_" : "") : ""),
                    this.x + 10, inputY + 5, ColorUtils.rgba(255, 255, 255, typing ? 255 : 128), 7);
        }
    }

    public void onChar(char typed) {
        if (typing) {
            if (Fonts.montserrat.getWidth(altName, 7f) < 160 - 70) {
                altName += typed;
            }
        }
    }

    public void onKey(int key) {
        boolean ctrlDown = GLFW.glfwGetKey(mc.getMainWindow().getHandle(), GLFW.GLFW_KEY_LEFT_CONTROL) == GLFW.GLFW_PRESS || GLFW.glfwGetKey(mc.getMainWindow().getHandle(), GLFW.GLFW_KEY_RIGHT_CONTROL) == GLFW.GLFW_PRESS;
        if (typing) {
            if (ctrlDown && key == GLFW.GLFW_KEY_V) {
                try {
                    altName += GLFW.glfwGetClipboardString(mc.getMainWindow().getHandle());
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            if (key == GLFW.GLFW_KEY_BACKSPACE) {
                if (!altName.isEmpty()) {
                    altName = altName.substring(0, altName.length() - 1);
                }
            }
            if (key == GLFW.GLFW_KEY_ENTER) {
                if (altName.length() >= 3) {
                    alts.add(new Alt(altName));
                    altName = "";
                    AltConfig.updateFile();
                }
                typing = false;
            }
        }
    }

    public void click(int mouseX, int mouseY, int button) {
        float width = 160;
        float minHeight = 20 + (4 * 25);
        float height = open ? Math.max(minHeight, Math.min(20 + alts.size() * 25, mc.getMainWindow().getScaledHeight() - 40)) : 20;

        if (MathUtil.isHovered(mouseX, mouseY, this.x, this.y, width, 20)) {
            open = !open;
            if (!open) typing = false;
        }

        if (open) {
            float i = 0;
            for (Alt alt : alts) {
                float altY = this.y + 26 + i * 20 + scroll;
                if (MathUtil.isHovered(mouseX, mouseY, this.x + 5, altY, width - 10, 18)) {
                    if (button == 0) {
                        mc.session = new Session(alt.name, UUID.randomUUID().toString(), "", "mojang");
                        AltConfig.updateFile();
                    } else {
                        alts.remove(alt);
                        AltConfig.updateFile();
                        break;
                    }
                }
                i++;
            }

            float inputY = this.y + height - 25;

            if (MathUtil.isHovered(mouseX, mouseY, this.x + 5, inputY, width - 70, 18)) {
                typing = !typing;
            }

            if (MathUtil.isHovered(mouseX, mouseY, this.x + width - 55, inputY + 2, 20, 14)) {
                if (altName.length() >= 3) {
                    alts.add(new Alt(altName));
                    altName = "";
                    AltConfig.updateFile();
                }
                typing = false;
            }

            if (MathUtil.isHovered(mouseX, mouseY, this.x + width - 35, inputY + 2, 20, 14)) {
                altName = generateRandomName();
                typing = false;
            }
        }
    }


    private String generateRandomName() {
        String[] prefixes = {"Player", "User", "Gamer", "Pro", "Cool", "Epic", "Shadow", "Dark", "Light", "Crystal", "Star", "Moon", "Dragon", "Phoenix", "Wolf", "Tiger", "Eagle", "Ghost", "Ninja", "Warrior", "Knight", "King", "Legend", "Hero", "Storm", "Thunder", "Fire", "Ice", "Wind", "Sky", "Cyber", "Tech", "Pixel", "Bit", "Neon", "Quantum", "Alpha", "Omega", "Ultra", "Mega", "Super", "Hyper"};
        String[] suffixes = {"Master", "Slayer", "Hunter", "Runner", "Walker", "Rider", "Gaming", "Play", "Live", "Stream", "YT", "TTV", "Pro", "God", "Lord", "King", "Boss", "Chief"};
        String prefix = prefixes[ThreadLocalRandom.current().nextInt(prefixes.length)];
        String suffix = suffixes[ThreadLocalRandom.current().nextInt(suffixes.length)];
        int number = ThreadLocalRandom.current().nextInt(100, 999);
        return prefix + suffix + number;
    }
}
Посмотреть вложение 291527
Посмотреть вложение 291528
+rep norm
 
Начинающий
Статус
Оффлайн
Регистрация
22 Сен 2024
Сообщения
80
Реакции[?]
0
Поинты[?]
0
Последнее редактирование:
Начинающий
Статус
Оффлайн
Регистрация
20 Сен 2024
Сообщения
86
Реакции[?]
0
Поинты[?]
0
ну ебать, что сказать начал делать на 3.1 кто не смог запастить альт менеджер (таких много) для тех пойдет там рандом ник и более мение норм код если нужны утилки пишите а вообще это говно не должно было вспливать

Это пиздец....:
package ru.protection.desing.mainmenu;

import com.mojang.blaze3d.platform.GlStateManager;
import ru.protection.client.config.AltConfig;
import ru.protection.system.client.IMinecraft;
import ru.protection.system.math.StopWatch;
import ru.protection.system.render.*;
import ru.protection.system.render.font.Fonts;
import com.mojang.blaze3d.matrix.MatrixStack;
import ru.protection.system.math.MathUtil;
import net.minecraft.util.Session;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector4f;
import org.lwjgl.glfw.GLFW;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;

public class AltWidget implements IMinecraft {
    public final List<Alt> alts = new ArrayList<>();
    private float x;
    private final float y;
    private float animation = 0f;
    private final StopWatch animationTimer = new StopWatch();

    public AltWidget() {
        y = 10;
    }

    public boolean open;
    private String altName = "";
    private boolean typing;
    private float scrollPre;
    private float scroll;

    public void updateScroll(int mouseX, int mouseY, float delta) {
        float minHeight = 20 + (4 * 25);
        float height = open ? Math.max(minHeight, Math.min(20 + alts.size() * 25, mc.getMainWindow().getScaledHeight() - 40)) : 20;
        if (MathUtil.isHovered(mouseX, mouseY, this.x, this.y + 20, 160, height - 70) && open) {
            scrollPre += delta * 10;
        }
    }

    public void render(MatrixStack stack, int mouseX, int mouseY) {
        boolean hovered = MathUtil.isHovered(mouseX, mouseY, x, y, 160, 20);
        if (hovered) {
            if (animation < 1f) animation += animationTimer.getElapsedTime() / 200f;
        } else if (animation > 0f) animation -= animationTimer.getElapsedTime() / 200f;

        animation = MathHelper.clamp(animation, 0f, 1f);
        animationTimer.reset();
        scroll = MathUtil.fast(scroll, scrollPre, 10);
        this.x = mc.getMainWindow().getScaledWidth() - 160 - 45;
        float width = 160;
        float minHeight = 20 + (4 * 25);
        float height = open ? Math.max(minHeight, Math.min(20 + alts.size() * 25, mc.getMainWindow().getScaledHeight() - 40)) : 20;
        float inputPanelHeight = 50;

        Stencil.initStencilToWrite();
        DisplayUtils.drawRoundedRect(this.x, this.y, width, height, 8, -1);
        Stencil.readStencilBuffer(1);
        KawaseBlur.blur.BLURRED.draw();
        Stencil.uninitStencilBuffer();

        int startColor = ColorUtils.interpolateColorsBackAndForth(15, 0, ColorUtils.rgb(50, 53, 77), ColorUtils.rgb(60, 63, 87), false);
        int endColor = ColorUtils.interpolateColorsBackAndForth(15, 180, ColorUtils.rgb(70, 73, 97), ColorUtils.rgb(80, 83, 107), false);
        DisplayUtils.drawGradientRoundedRect(this.x, this.y, width, height, 8, startColor, endColor);

        float outlineWidth = 1.5f;
        int outlineColor = ColorUtils.interpolateColorsBackAndForth(15, 0, ColorUtils.rgba(255, 255, 255, hovered ? 100 : 40), ColorUtils.rgba(255, 255, 255, hovered ? 150 : 60), false);
        DisplayUtils.drawRoundedRectOutline(this.x, this.y, width, height, 8, outlineWidth, outlineColor);

        Scissor.push();
        Scissor.setFromComponentCoordinates(this.x, this.y, width - 16, height);
        float scale = 1.0f + (0.05f * animation);
        GlStateManager.pushMatrix();
        GlStateManager.translatef(this.x + 6, this.y + 6, 0);
        GlStateManager.scalef(scale, scale, 1);
        Fonts.montserrat.drawText(stack, "Alt Manager", 0, 0, -1, 8);
        GlStateManager.popMatrix();
        Scissor.unset();
        Scissor.pop();

        Fonts.icons.drawText(stack, open ? "C" : "B", this.x + width - 15, this.y + 6.5f, -1, 8);

        if (open) {
            DisplayUtils.drawRectW(this.x, this.y + 25, width, 0.5f, ColorUtils.rgba(64, 64, 64, 255));

            float listHeight = height - inputPanelHeight - 20;

            Scissor.push();
            Scissor.setFromComponentCoordinates(this.x, this.y + 32, width, listHeight);
            float i = 0;
            for (Alt alt : alts) {
                float altY = this.y + 26 + i * 20 + scroll;
                boolean altHovered = MathUtil.isHovered(mouseX, mouseY, this.x + 5, altY, width - 10, 18);
                DisplayUtils.drawRoundedRect(this.x + 5, altY, width - 10, 18, 4, mc.session.getUsername().equals(alt.name) ? ColorUtils.rgba(40, 40, 46, 180) : ColorUtils.rgba(30, 30, 36, altHovered ? 128 : 64));
                Fonts.montserrat.drawText(stack, alt.name, this.x + 10, altY + 5, -1, 7);
                i++;
            }
            Scissor.unset();
            Scissor.pop();

            float inputY = this.y + height - 25;

            String textToDraw = altName.isEmpty() && !typing ? "nickname" : altName;
            DisplayUtils.drawRoundedRect(this.x + 5, inputY, width - 10, 18, 4, ColorUtils.rgba(30, 30, 36, 64));

            DisplayUtils.drawRoundedRect(this.x + width - 35, inputY + 2, 20, 14, 3, ColorUtils.rgba(40, 40, 46, 128));
            Fonts.montserrat.drawCenteredText(stack, "R", this.x + width - 25, inputY + 5, -1, 7);

            DisplayUtils.drawRoundedRect(this.x + width - 55, inputY + 2, 20, 14, 3, ColorUtils.rgba(40, 40, 46, 128));
            Fonts.montserrat.drawCenteredText(stack, "+", this.x + width - 45, inputY + 5, -1, 7);

            Fonts.montserrat.drawText(stack, textToDraw + (typing ? (System.currentTimeMillis() % 1000 > 500 ? "_" : "") : ""),
                    this.x + 10, inputY + 5, ColorUtils.rgba(255, 255, 255, typing ? 255 : 128), 7);
        }
    }

    public void onChar(char typed) {
        if (typing) {
            if (Fonts.montserrat.getWidth(altName, 7f) < 160 - 70) {
                altName += typed;
            }
        }
    }

    public void onKey(int key) {
        boolean ctrlDown = GLFW.glfwGetKey(mc.getMainWindow().getHandle(), GLFW.GLFW_KEY_LEFT_CONTROL) == GLFW.GLFW_PRESS || GLFW.glfwGetKey(mc.getMainWindow().getHandle(), GLFW.GLFW_KEY_RIGHT_CONTROL) == GLFW.GLFW_PRESS;
        if (typing) {
            if (ctrlDown && key == GLFW.GLFW_KEY_V) {
                try {
                    altName += GLFW.glfwGetClipboardString(mc.getMainWindow().getHandle());
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            if (key == GLFW.GLFW_KEY_BACKSPACE) {
                if (!altName.isEmpty()) {
                    altName = altName.substring(0, altName.length() - 1);
                }
            }
            if (key == GLFW.GLFW_KEY_ENTER) {
                if (altName.length() >= 3) {
                    alts.add(new Alt(altName));
                    altName = "";
                    AltConfig.updateFile();
                }
                typing = false;
            }
        }
    }

    public void click(int mouseX, int mouseY, int button) {
        float width = 160;
        float minHeight = 20 + (4 * 25);
        float height = open ? Math.max(minHeight, Math.min(20 + alts.size() * 25, mc.getMainWindow().getScaledHeight() - 40)) : 20;

        if (MathUtil.isHovered(mouseX, mouseY, this.x, this.y, width, 20)) {
            open = !open;
            if (!open) typing = false;
        }

        if (open) {
            float i = 0;
            for (Alt alt : alts) {
                float altY = this.y + 26 + i * 20 + scroll;
                if (MathUtil.isHovered(mouseX, mouseY, this.x + 5, altY, width - 10, 18)) {
                    if (button == 0) {
                        mc.session = new Session(alt.name, UUID.randomUUID().toString(), "", "mojang");
                        AltConfig.updateFile();
                    } else {
                        alts.remove(alt);
                        AltConfig.updateFile();
                        break;
                    }
                }
                i++;
            }

            float inputY = this.y + height - 25;

            if (MathUtil.isHovered(mouseX, mouseY, this.x + 5, inputY, width - 70, 18)) {
                typing = !typing;
            }

            if (MathUtil.isHovered(mouseX, mouseY, this.x + width - 55, inputY + 2, 20, 14)) {
                if (altName.length() >= 3) {
                    alts.add(new Alt(altName));
                    altName = "";
                    AltConfig.updateFile();
                }
                typing = false;
            }

            if (MathUtil.isHovered(mouseX, mouseY, this.x + width - 35, inputY + 2, 20, 14)) {
                altName = generateRandomName();
                typing = false;
            }
        }
    }


    private String generateRandomName() {
        String[] prefixes = {"Player", "User", "Gamer", "Pro", "Cool", "Epic", "Shadow", "Dark", "Light", "Crystal", "Star", "Moon", "Dragon", "Phoenix", "Wolf", "Tiger", "Eagle", "Ghost", "Ninja", "Warrior", "Knight", "King", "Legend", "Hero", "Storm", "Thunder", "Fire", "Ice", "Wind", "Sky", "Cyber", "Tech", "Pixel", "Bit", "Neon", "Quantum", "Alpha", "Omega", "Ultra", "Mega", "Super", "Hyper"};
        String[] suffixes = {"Master", "Slayer", "Hunter", "Runner", "Walker", "Rider", "Gaming", "Play", "Live", "Stream", "YT", "TTV", "Pro", "God", "Lord", "King", "Boss", "Chief"};
        String prefix = prefixes[ThreadLocalRandom.current().nextInt(prefixes.length)];
        String suffix = suffixes[ThreadLocalRandom.current().nextInt(suffixes.length)];
        int number = ThreadLocalRandom.current().nextInt(100, 999);
        return prefix + suffix + number;
    }
}
Посмотреть вложение 291527
Посмотреть вложение 291528
/del спастил с Neverlose client
 
Начинающий
Статус
Оффлайн
Регистрация
22 Сен 2024
Сообщения
80
Реакции[?]
0
Поинты[?]
0
ну ебать, что сказать начал делать на 3.1 кто не смог запастить альт менеджер (таких много) для тех пойдет там рандом ник и более мение норм код если нужны утилки пишите а вообще это говно не должно было вспливать

Это пиздец....:
package ru.protection.desing.mainmenu;

import com.mojang.blaze3d.platform.GlStateManager;
import ru.protection.client.config.AltConfig;
import ru.protection.system.client.IMinecraft;
import ru.protection.system.math.StopWatch;
import ru.protection.system.render.*;
import ru.protection.system.render.font.Fonts;
import com.mojang.blaze3d.matrix.MatrixStack;
import ru.protection.system.math.MathUtil;
import net.minecraft.util.Session;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector4f;
import org.lwjgl.glfw.GLFW;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;

public class AltWidget implements IMinecraft {
    public final List<Alt> alts = new ArrayList<>();
    private float x;
    private final float y;
    private float animation = 0f;
    private final StopWatch animationTimer = new StopWatch();

    public AltWidget() {
        y = 10;
    }

    public boolean open;
    private String altName = "";
    private boolean typing;
    private float scrollPre;
    private float scroll;

    public void updateScroll(int mouseX, int mouseY, float delta) {
        float minHeight = 20 + (4 * 25);
        float height = open ? Math.max(minHeight, Math.min(20 + alts.size() * 25, mc.getMainWindow().getScaledHeight() - 40)) : 20;
        if (MathUtil.isHovered(mouseX, mouseY, this.x, this.y + 20, 160, height - 70) && open) {
            scrollPre += delta * 10;
        }
    }

    public void render(MatrixStack stack, int mouseX, int mouseY) {
        boolean hovered = MathUtil.isHovered(mouseX, mouseY, x, y, 160, 20);
        if (hovered) {
            if (animation < 1f) animation += animationTimer.getElapsedTime() / 200f;
        } else if (animation > 0f) animation -= animationTimer.getElapsedTime() / 200f;

        animation = MathHelper.clamp(animation, 0f, 1f);
        animationTimer.reset();
        scroll = MathUtil.fast(scroll, scrollPre, 10);
        this.x = mc.getMainWindow().getScaledWidth() - 160 - 45;
        float width = 160;
        float minHeight = 20 + (4 * 25);
        float height = open ? Math.max(minHeight, Math.min(20 + alts.size() * 25, mc.getMainWindow().getScaledHeight() - 40)) : 20;
        float inputPanelHeight = 50;

        Stencil.initStencilToWrite();
        DisplayUtils.drawRoundedRect(this.x, this.y, width, height, 8, -1);
        Stencil.readStencilBuffer(1);
        KawaseBlur.blur.BLURRED.draw();
        Stencil.uninitStencilBuffer();

        int startColor = ColorUtils.interpolateColorsBackAndForth(15, 0, ColorUtils.rgb(50, 53, 77), ColorUtils.rgb(60, 63, 87), false);
        int endColor = ColorUtils.interpolateColorsBackAndForth(15, 180, ColorUtils.rgb(70, 73, 97), ColorUtils.rgb(80, 83, 107), false);
        DisplayUtils.drawGradientRoundedRect(this.x, this.y, width, height, 8, startColor, endColor);

        float outlineWidth = 1.5f;
        int outlineColor = ColorUtils.interpolateColorsBackAndForth(15, 0, ColorUtils.rgba(255, 255, 255, hovered ? 100 : 40), ColorUtils.rgba(255, 255, 255, hovered ? 150 : 60), false);
        DisplayUtils.drawRoundedRectOutline(this.x, this.y, width, height, 8, outlineWidth, outlineColor);

        Scissor.push();
        Scissor.setFromComponentCoordinates(this.x, this.y, width - 16, height);
        float scale = 1.0f + (0.05f * animation);
        GlStateManager.pushMatrix();
        GlStateManager.translatef(this.x + 6, this.y + 6, 0);
        GlStateManager.scalef(scale, scale, 1);
        Fonts.montserrat.drawText(stack, "Alt Manager", 0, 0, -1, 8);
        GlStateManager.popMatrix();
        Scissor.unset();
        Scissor.pop();

        Fonts.icons.drawText(stack, open ? "C" : "B", this.x + width - 15, this.y + 6.5f, -1, 8);

        if (open) {
            DisplayUtils.drawRectW(this.x, this.y + 25, width, 0.5f, ColorUtils.rgba(64, 64, 64, 255));

            float listHeight = height - inputPanelHeight - 20;

            Scissor.push();
            Scissor.setFromComponentCoordinates(this.x, this.y + 32, width, listHeight);
            float i = 0;
            for (Alt alt : alts) {
                float altY = this.y + 26 + i * 20 + scroll;
                boolean altHovered = MathUtil.isHovered(mouseX, mouseY, this.x + 5, altY, width - 10, 18);
                DisplayUtils.drawRoundedRect(this.x + 5, altY, width - 10, 18, 4, mc.session.getUsername().equals(alt.name) ? ColorUtils.rgba(40, 40, 46, 180) : ColorUtils.rgba(30, 30, 36, altHovered ? 128 : 64));
                Fonts.montserrat.drawText(stack, alt.name, this.x + 10, altY + 5, -1, 7);
                i++;
            }
            Scissor.unset();
            Scissor.pop();

            float inputY = this.y + height - 25;

            String textToDraw = altName.isEmpty() && !typing ? "nickname" : altName;
            DisplayUtils.drawRoundedRect(this.x + 5, inputY, width - 10, 18, 4, ColorUtils.rgba(30, 30, 36, 64));

            DisplayUtils.drawRoundedRect(this.x + width - 35, inputY + 2, 20, 14, 3, ColorUtils.rgba(40, 40, 46, 128));
            Fonts.montserrat.drawCenteredText(stack, "R", this.x + width - 25, inputY + 5, -1, 7);

            DisplayUtils.drawRoundedRect(this.x + width - 55, inputY + 2, 20, 14, 3, ColorUtils.rgba(40, 40, 46, 128));
            Fonts.montserrat.drawCenteredText(stack, "+", this.x + width - 45, inputY + 5, -1, 7);

            Fonts.montserrat.drawText(stack, textToDraw + (typing ? (System.currentTimeMillis() % 1000 > 500 ? "_" : "") : ""),
                    this.x + 10, inputY + 5, ColorUtils.rgba(255, 255, 255, typing ? 255 : 128), 7);
        }
    }

    public void onChar(char typed) {
        if (typing) {
            if (Fonts.montserrat.getWidth(altName, 7f) < 160 - 70) {
                altName += typed;
            }
        }
    }

    public void onKey(int key) {
        boolean ctrlDown = GLFW.glfwGetKey(mc.getMainWindow().getHandle(), GLFW.GLFW_KEY_LEFT_CONTROL) == GLFW.GLFW_PRESS || GLFW.glfwGetKey(mc.getMainWindow().getHandle(), GLFW.GLFW_KEY_RIGHT_CONTROL) == GLFW.GLFW_PRESS;
        if (typing) {
            if (ctrlDown && key == GLFW.GLFW_KEY_V) {
                try {
                    altName += GLFW.glfwGetClipboardString(mc.getMainWindow().getHandle());
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            if (key == GLFW.GLFW_KEY_BACKSPACE) {
                if (!altName.isEmpty()) {
                    altName = altName.substring(0, altName.length() - 1);
                }
            }
            if (key == GLFW.GLFW_KEY_ENTER) {
                if (altName.length() >= 3) {
                    alts.add(new Alt(altName));
                    altName = "";
                    AltConfig.updateFile();
                }
                typing = false;
            }
        }
    }

    public void click(int mouseX, int mouseY, int button) {
        float width = 160;
        float minHeight = 20 + (4 * 25);
        float height = open ? Math.max(minHeight, Math.min(20 + alts.size() * 25, mc.getMainWindow().getScaledHeight() - 40)) : 20;

        if (MathUtil.isHovered(mouseX, mouseY, this.x, this.y, width, 20)) {
            open = !open;
            if (!open) typing = false;
        }

        if (open) {
            float i = 0;
            for (Alt alt : alts) {
                float altY = this.y + 26 + i * 20 + scroll;
                if (MathUtil.isHovered(mouseX, mouseY, this.x + 5, altY, width - 10, 18)) {
                    if (button == 0) {
                        mc.session = new Session(alt.name, UUID.randomUUID().toString(), "", "mojang");
                        AltConfig.updateFile();
                    } else {
                        alts.remove(alt);
                        AltConfig.updateFile();
                        break;
                    }
                }
                i++;
            }

            float inputY = this.y + height - 25;

            if (MathUtil.isHovered(mouseX, mouseY, this.x + 5, inputY, width - 70, 18)) {
                typing = !typing;
            }

            if (MathUtil.isHovered(mouseX, mouseY, this.x + width - 55, inputY + 2, 20, 14)) {
                if (altName.length() >= 3) {
                    alts.add(new Alt(altName));
                    altName = "";
                    AltConfig.updateFile();
                }
                typing = false;
            }

            if (MathUtil.isHovered(mouseX, mouseY, this.x + width - 35, inputY + 2, 20, 14)) {
                altName = generateRandomName();
                typing = false;
            }
        }
    }


    private String generateRandomName() {
        String[] prefixes = {"Player", "User", "Gamer", "Pro", "Cool", "Epic", "Shadow", "Dark", "Light", "Crystal", "Star", "Moon", "Dragon", "Phoenix", "Wolf", "Tiger", "Eagle", "Ghost", "Ninja", "Warrior", "Knight", "King", "Legend", "Hero", "Storm", "Thunder", "Fire", "Ice", "Wind", "Sky", "Cyber", "Tech", "Pixel", "Bit", "Neon", "Quantum", "Alpha", "Omega", "Ultra", "Mega", "Super", "Hyper"};
        String[] suffixes = {"Master", "Slayer", "Hunter", "Runner", "Walker", "Rider", "Gaming", "Play", "Live", "Stream", "YT", "TTV", "Pro", "God", "Lord", "King", "Boss", "Chief"};
        String prefix = prefixes[ThreadLocalRandom.current().nextInt(prefixes.length)];
        String suffix = suffixes[ThreadLocalRandom.current().nextInt(suffixes.length)];
        int number = ThreadLocalRandom.current().nextInt(100, 999);
        return prefix + suffix + number;
    }
}
Посмотреть вложение 291527
Посмотреть вложение 291528
(utils.currentTimeMillis()
скинь на утилс агриться
 
Начинающий
Статус
Оффлайн
Регистрация
17 Июн 2024
Сообщения
179
Реакции[?]
0
Поинты[?]
0
Последнее редактирование:
Сверху Снизу