Подписывайтесь на наш Telegram и не пропускайте важные новости! Перейти

Визуальная часть Watermark Sk3d CatLean | EvaWare v3 1.21.4

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
26 Апр 2025
Сообщения
50
Реакции
0
Выберите загрузчик игры
  1. Fabric
здраствуйте.
хз мейби кому то зайдет, главное не обосрите меня, я знаю что это говно.
Сделал за минут 20-40. Закругление не точь в точь, а остальное вроде тоже самое что и в CatLean.


Пожалуйста, авторизуйтесь для просмотра ссылки.


WatermarkWidget.java:
Expand Collapse Copy
package code.blume.client.ui.widget.overlay;

import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.util.math.MatrixStack;
import code.blume.api.system.backend.ClientInfo;
import code.blume.api.utils.color.UIColors;
import code.blume.api.utils.render.RenderUtil;
import code.blume.api.utils.render.fonts.Font;
import code.blume.client.ui.widget.Widget;

import java.awt.*;

public class WatermarkWidget extends Widget {

    public WatermarkWidget() {
        super(3f, 3f);
    }

    @Override
    public String getName() {
        return "Watermark";
    }

    @Override
    public void render(MatrixStack matrixStack) {
        float x = getDraggable().getX();
        float y = getDraggable().getY();
        float gap = getGap();

        float width = 0f;
        float height = 0f;

        float headSize = scaled(29f);
        boolean isRight = x > mc.getWindow().getScaledWidth() / 2f;

        float headX = !isRight ? x : x + getDraggable().getWidth() - headSize;

        Color staticBgColor = new Color(15, 15, 20, 220);
        Color staticOutlineColor = new Color(70, 70, 85, 150);
        float outlineWidth = 0.5f;
        float round = gap * 0.8f;

        RenderUtil.TEXTURE_RECT.drawHead(matrixStack, mc.player, headX, y, headSize, headSize, round, 2f, Color.WHITE);

        width += headSize + gap;
        height += headSize;

        float blocksStartX = !isRight ? x + headSize + gap : x;
        float blocksStartY = y;

        String clientFull = getClientName() + " " + getClientVersion();  // Blume 3.0.14
        String username = mc.player != null ? mc.player.getName().getString() : "Unknown";
        String serverIP = getServerIP();

        float fontSize = scaled(7.5f);

        float clientWidth = getSemiBoldFont().getWidth(clientFull, fontSize);
        float usernameWidth = getMediumFont().getWidth(username, fontSize);
        float serverWidth = getMediumFont().getWidth(serverIP, fontSize);

        float innerGap = gap * 0.6f;
        float blockHeight = fontSize + innerGap * 2f;

        float clientBlockX = blocksStartX;
        float clientBlockY = blocksStartY + (gap * 0.7f);
        float clientBlockWidth = clientWidth + gap * 1.2f;

        float usernameBlockX = blocksStartX;
        float usernameBlockY = blocksStartY + blockHeight + (gap * 1.5f);
        float usernameBlockWidth = usernameWidth + gap * 1.2f;

        float serverBlockX = usernameBlockX + usernameBlockWidth + gap * 0.8f;
        float serverBlockY = usernameBlockY;
        float serverBlockWidth = serverWidth + gap * 1.2f;

        float totalWidth = clientBlockWidth;
        totalWidth = Math.max(totalWidth, usernameBlockWidth + gap * 0.8f + serverBlockWidth);
        float totalHeight = blockHeight + gap + blockHeight;

        drawClientBlock(matrixStack, clientBlockX, clientBlockY, clientBlockWidth, blockHeight,
                getClientName(), getClientVersion(), staticBgColor, staticOutlineColor, fontSize, round, outlineWidth, innerGap);

        drawBlock(matrixStack, usernameBlockX, usernameBlockY, usernameBlockWidth, blockHeight, username,
                staticBgColor, staticOutlineColor, false, fontSize, round, outlineWidth, innerGap, usernameWidth);

        drawBlock(matrixStack, serverBlockX, serverBlockY, serverBlockWidth, blockHeight, serverIP,
                staticBgColor, staticOutlineColor, false, fontSize, round, outlineWidth, innerGap, serverWidth);

        width += totalWidth;
        height = Math.max(headSize, totalHeight);

        getDraggable().setWidth(width);
        getDraggable().setHeight(height);
    }

    private void drawClientBlock(MatrixStack matrixStack, float x, float y, float width, float height,
                                 String name, String version, Color bgColor, Color outlineColor,
                                 float fontSize, float round, float outlineWidth, float innerGap) {
        Font font = getSemiBoldFont();

        RenderUtil.RECT.draw(matrixStack, x - outlineWidth, y - outlineWidth,
                width + outlineWidth * 2, height + outlineWidth * 2,
                round + outlineWidth, outlineColor);

        RenderUtil.BLUR_RECT.draw(matrixStack, x, y, width, height, round, bgColor);

        float nameWidth = font.getWidth(name, fontSize);
        float versionWidth = font.getWidth(version, fontSize);
        float totalWidth = nameWidth + versionWidth + innerGap;
        float startX = x + (width - totalWidth) / 2f;
        float textY = y + (height - fontSize) / 2f;

        font.drawGradientText(matrixStack, name, startX, textY, fontSize,
                UIColors.primary(), UIColors.secondary(), nameWidth / 4f);

        font.drawText(matrixStack, version, startX + nameWidth + innerGap, textY, fontSize, new Color(180, 180, 200));
    }

    private void drawBlock(MatrixStack matrixStack, float x, float y, float width, float height, String content,
                           Color bgColor, Color outlineColor, boolean isGradient, float fontSize,
                           float round, float outlineWidth, float innerGap, float contentWidth) {

        RenderUtil.RECT.draw(matrixStack, x - outlineWidth, y - outlineWidth,
                width + outlineWidth * 2, height + outlineWidth * 2,
                round + outlineWidth, outlineColor);

        RenderUtil.BLUR_RECT.draw(matrixStack, x, y, width, height, round, bgColor);

        Font font = isGradient ? getSemiBoldFont() : getMediumFont();
        float textX = x + (width - contentWidth) / 2f;
        float textY = y + (height - fontSize) / 2f;

        if (isGradient) {
            font.drawGradientText(matrixStack, content, textX, textY, fontSize,
                    UIColors.primary(), UIColors.secondary(), contentWidth / 4f);
        } else {
            font.drawText(matrixStack, content, textX, textY, fontSize, UIColors.textColor());
        }
    }

    private String getServerIP() {
        if (mc.isInSingleplayer()) {
            return "Singleplayer";
        }

        if (mc.getCurrentServerEntry() != null) {
            String ip = mc.getCurrentServerEntry().address;
            if (ip.contains(":")) {
                ip = ip.substring(0, ip.indexOf(":"));
            }
            return ip;
        }

        return "Not connected";
    }

    private String getClientVersion() {
        return ClientInfo.VERSION;
    }

    private String getClientName() {
        return ClientInfo.NAME;
    }

    @Override
    public void render(DrawContext context, int mouseX, int mouseY, float delta) {
        render(context.getMatrices());
    }

    @Override
    public void mouseClicked(double mouseX, double mouseY, int button) {}

    @Override
    public void mouseReleased(double mouseX, double mouseY, int button) {}

    @Override
    public void keyPressed(int keyCode, int scanCode, int modifiers) {}

    @Override
    public void mouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount) {}
}
 
здраствуйте.
хз мейби кому то зайдет, главное не обосрите меня, я знаю что это говно.
Сделал за минут 20-40. Закругление не точь в точь, а остальное вроде тоже самое что и в CatLean.


Пожалуйста, авторизуйтесь для просмотра ссылки.


WatermarkWidget.java:
Expand Collapse Copy
package code.blume.client.ui.widget.overlay;

import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.util.math.MatrixStack;
import code.blume.api.system.backend.ClientInfo;
import code.blume.api.utils.color.UIColors;
import code.blume.api.utils.render.RenderUtil;
import code.blume.api.utils.render.fonts.Font;
import code.blume.client.ui.widget.Widget;

import java.awt.*;

public class WatermarkWidget extends Widget {

    public WatermarkWidget() {
        super(3f, 3f);
    }

    @Override
    public String getName() {
        return "Watermark";
    }

    @Override
    public void render(MatrixStack matrixStack) {
        float x = getDraggable().getX();
        float y = getDraggable().getY();
        float gap = getGap();

        float width = 0f;
        float height = 0f;

        float headSize = scaled(29f);
        boolean isRight = x > mc.getWindow().getScaledWidth() / 2f;

        float headX = !isRight ? x : x + getDraggable().getWidth() - headSize;

        Color staticBgColor = new Color(15, 15, 20, 220);
        Color staticOutlineColor = new Color(70, 70, 85, 150);
        float outlineWidth = 0.5f;
        float round = gap * 0.8f;

        RenderUtil.TEXTURE_RECT.drawHead(matrixStack, mc.player, headX, y, headSize, headSize, round, 2f, Color.WHITE);

        width += headSize + gap;
        height += headSize;

        float blocksStartX = !isRight ? x + headSize + gap : x;
        float blocksStartY = y;

        String clientFull = getClientName() + " " + getClientVersion();  // Blume 3.0.14
        String username = mc.player != null ? mc.player.getName().getString() : "Unknown";
        String serverIP = getServerIP();

        float fontSize = scaled(7.5f);

        float clientWidth = getSemiBoldFont().getWidth(clientFull, fontSize);
        float usernameWidth = getMediumFont().getWidth(username, fontSize);
        float serverWidth = getMediumFont().getWidth(serverIP, fontSize);

        float innerGap = gap * 0.6f;
        float blockHeight = fontSize + innerGap * 2f;

        float clientBlockX = blocksStartX;
        float clientBlockY = blocksStartY + (gap * 0.7f);
        float clientBlockWidth = clientWidth + gap * 1.2f;

        float usernameBlockX = blocksStartX;
        float usernameBlockY = blocksStartY + blockHeight + (gap * 1.5f);
        float usernameBlockWidth = usernameWidth + gap * 1.2f;

        float serverBlockX = usernameBlockX + usernameBlockWidth + gap * 0.8f;
        float serverBlockY = usernameBlockY;
        float serverBlockWidth = serverWidth + gap * 1.2f;

        float totalWidth = clientBlockWidth;
        totalWidth = Math.max(totalWidth, usernameBlockWidth + gap * 0.8f + serverBlockWidth);
        float totalHeight = blockHeight + gap + blockHeight;

        drawClientBlock(matrixStack, clientBlockX, clientBlockY, clientBlockWidth, blockHeight,
                getClientName(), getClientVersion(), staticBgColor, staticOutlineColor, fontSize, round, outlineWidth, innerGap);

        drawBlock(matrixStack, usernameBlockX, usernameBlockY, usernameBlockWidth, blockHeight, username,
                staticBgColor, staticOutlineColor, false, fontSize, round, outlineWidth, innerGap, usernameWidth);

        drawBlock(matrixStack, serverBlockX, serverBlockY, serverBlockWidth, blockHeight, serverIP,
                staticBgColor, staticOutlineColor, false, fontSize, round, outlineWidth, innerGap, serverWidth);

        width += totalWidth;
        height = Math.max(headSize, totalHeight);

        getDraggable().setWidth(width);
        getDraggable().setHeight(height);
    }

    private void drawClientBlock(MatrixStack matrixStack, float x, float y, float width, float height,
                                 String name, String version, Color bgColor, Color outlineColor,
                                 float fontSize, float round, float outlineWidth, float innerGap) {
        Font font = getSemiBoldFont();

        RenderUtil.RECT.draw(matrixStack, x - outlineWidth, y - outlineWidth,
                width + outlineWidth * 2, height + outlineWidth * 2,
                round + outlineWidth, outlineColor);

        RenderUtil.BLUR_RECT.draw(matrixStack, x, y, width, height, round, bgColor);

        float nameWidth = font.getWidth(name, fontSize);
        float versionWidth = font.getWidth(version, fontSize);
        float totalWidth = nameWidth + versionWidth + innerGap;
        float startX = x + (width - totalWidth) / 2f;
        float textY = y + (height - fontSize) / 2f;

        font.drawGradientText(matrixStack, name, startX, textY, fontSize,
                UIColors.primary(), UIColors.secondary(), nameWidth / 4f);

        font.drawText(matrixStack, version, startX + nameWidth + innerGap, textY, fontSize, new Color(180, 180, 200));
    }

    private void drawBlock(MatrixStack matrixStack, float x, float y, float width, float height, String content,
                           Color bgColor, Color outlineColor, boolean isGradient, float fontSize,
                           float round, float outlineWidth, float innerGap, float contentWidth) {

        RenderUtil.RECT.draw(matrixStack, x - outlineWidth, y - outlineWidth,
                width + outlineWidth * 2, height + outlineWidth * 2,
                round + outlineWidth, outlineColor);

        RenderUtil.BLUR_RECT.draw(matrixStack, x, y, width, height, round, bgColor);

        Font font = isGradient ? getSemiBoldFont() : getMediumFont();
        float textX = x + (width - contentWidth) / 2f;
        float textY = y + (height - fontSize) / 2f;

        if (isGradient) {
            font.drawGradientText(matrixStack, content, textX, textY, fontSize,
                    UIColors.primary(), UIColors.secondary(), contentWidth / 4f);
        } else {
            font.drawText(matrixStack, content, textX, textY, fontSize, UIColors.textColor());
        }
    }

    private String getServerIP() {
        if (mc.isInSingleplayer()) {
            return "Singleplayer";
        }

        if (mc.getCurrentServerEntry() != null) {
            String ip = mc.getCurrentServerEntry().address;
            if (ip.contains(":")) {
                ip = ip.substring(0, ip.indexOf(":"));
            }
            return ip;
        }

        return "Not connected";
    }

    private String getClientVersion() {
        return ClientInfo.VERSION;
    }

    private String getClientName() {
        return ClientInfo.NAME;
    }

    @Override
    public void render(DrawContext context, int mouseX, int mouseY, float delta) {
        render(context.getMatrices());
    }

    @Override
    public void mouseClicked(double mouseX, double mouseY, int button) {}

    @Override
    public void mouseReleased(double mouseX, double mouseY, int button) {}

    @Override
    public void keyPressed(int keyCode, int scanCode, int modifiers) {}

    @Override
    public void mouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount) {}
}
Норм, похоже, только паддинги чуть не те
 
здраствуйте.
хз мейби кому то зайдет, главное не обосрите меня, я знаю что это говно.
Сделал за минут 20-40. Закругление не точь в точь, а остальное вроде тоже самое что и в CatLean.


Пожалуйста, авторизуйтесь для просмотра ссылки.


WatermarkWidget.java:
Expand Collapse Copy
package code.blume.client.ui.widget.overlay;

import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.util.math.MatrixStack;
import code.blume.api.system.backend.ClientInfo;
import code.blume.api.utils.color.UIColors;
import code.blume.api.utils.render.RenderUtil;
import code.blume.api.utils.render.fonts.Font;
import code.blume.client.ui.widget.Widget;

import java.awt.*;

public class WatermarkWidget extends Widget {

    public WatermarkWidget() {
        super(3f, 3f);
    }

    @Override
    public String getName() {
        return "Watermark";
    }

    @Override
    public void render(MatrixStack matrixStack) {
        float x = getDraggable().getX();
        float y = getDraggable().getY();
        float gap = getGap();

        float width = 0f;
        float height = 0f;

        float headSize = scaled(29f);
        boolean isRight = x > mc.getWindow().getScaledWidth() / 2f;

        float headX = !isRight ? x : x + getDraggable().getWidth() - headSize;

        Color staticBgColor = new Color(15, 15, 20, 220);
        Color staticOutlineColor = new Color(70, 70, 85, 150);
        float outlineWidth = 0.5f;
        float round = gap * 0.8f;

        RenderUtil.TEXTURE_RECT.drawHead(matrixStack, mc.player, headX, y, headSize, headSize, round, 2f, Color.WHITE);

        width += headSize + gap;
        height += headSize;

        float blocksStartX = !isRight ? x + headSize + gap : x;
        float blocksStartY = y;

        String clientFull = getClientName() + " " + getClientVersion();  // Blume 3.0.14
        String username = mc.player != null ? mc.player.getName().getString() : "Unknown";
        String serverIP = getServerIP();

        float fontSize = scaled(7.5f);

        float clientWidth = getSemiBoldFont().getWidth(clientFull, fontSize);
        float usernameWidth = getMediumFont().getWidth(username, fontSize);
        float serverWidth = getMediumFont().getWidth(serverIP, fontSize);

        float innerGap = gap * 0.6f;
        float blockHeight = fontSize + innerGap * 2f;

        float clientBlockX = blocksStartX;
        float clientBlockY = blocksStartY + (gap * 0.7f);
        float clientBlockWidth = clientWidth + gap * 1.2f;

        float usernameBlockX = blocksStartX;
        float usernameBlockY = blocksStartY + blockHeight + (gap * 1.5f);
        float usernameBlockWidth = usernameWidth + gap * 1.2f;

        float serverBlockX = usernameBlockX + usernameBlockWidth + gap * 0.8f;
        float serverBlockY = usernameBlockY;
        float serverBlockWidth = serverWidth + gap * 1.2f;

        float totalWidth = clientBlockWidth;
        totalWidth = Math.max(totalWidth, usernameBlockWidth + gap * 0.8f + serverBlockWidth);
        float totalHeight = blockHeight + gap + blockHeight;

        drawClientBlock(matrixStack, clientBlockX, clientBlockY, clientBlockWidth, blockHeight,
                getClientName(), getClientVersion(), staticBgColor, staticOutlineColor, fontSize, round, outlineWidth, innerGap);

        drawBlock(matrixStack, usernameBlockX, usernameBlockY, usernameBlockWidth, blockHeight, username,
                staticBgColor, staticOutlineColor, false, fontSize, round, outlineWidth, innerGap, usernameWidth);

        drawBlock(matrixStack, serverBlockX, serverBlockY, serverBlockWidth, blockHeight, serverIP,
                staticBgColor, staticOutlineColor, false, fontSize, round, outlineWidth, innerGap, serverWidth);

        width += totalWidth;
        height = Math.max(headSize, totalHeight);

        getDraggable().setWidth(width);
        getDraggable().setHeight(height);
    }

    private void drawClientBlock(MatrixStack matrixStack, float x, float y, float width, float height,
                                 String name, String version, Color bgColor, Color outlineColor,
                                 float fontSize, float round, float outlineWidth, float innerGap) {
        Font font = getSemiBoldFont();

        RenderUtil.RECT.draw(matrixStack, x - outlineWidth, y - outlineWidth,
                width + outlineWidth * 2, height + outlineWidth * 2,
                round + outlineWidth, outlineColor);

        RenderUtil.BLUR_RECT.draw(matrixStack, x, y, width, height, round, bgColor);

        float nameWidth = font.getWidth(name, fontSize);
        float versionWidth = font.getWidth(version, fontSize);
        float totalWidth = nameWidth + versionWidth + innerGap;
        float startX = x + (width - totalWidth) / 2f;
        float textY = y + (height - fontSize) / 2f;

        font.drawGradientText(matrixStack, name, startX, textY, fontSize,
                UIColors.primary(), UIColors.secondary(), nameWidth / 4f);

        font.drawText(matrixStack, version, startX + nameWidth + innerGap, textY, fontSize, new Color(180, 180, 200));
    }

    private void drawBlock(MatrixStack matrixStack, float x, float y, float width, float height, String content,
                           Color bgColor, Color outlineColor, boolean isGradient, float fontSize,
                           float round, float outlineWidth, float innerGap, float contentWidth) {

        RenderUtil.RECT.draw(matrixStack, x - outlineWidth, y - outlineWidth,
                width + outlineWidth * 2, height + outlineWidth * 2,
                round + outlineWidth, outlineColor);

        RenderUtil.BLUR_RECT.draw(matrixStack, x, y, width, height, round, bgColor);

        Font font = isGradient ? getSemiBoldFont() : getMediumFont();
        float textX = x + (width - contentWidth) / 2f;
        float textY = y + (height - fontSize) / 2f;

        if (isGradient) {
            font.drawGradientText(matrixStack, content, textX, textY, fontSize,
                    UIColors.primary(), UIColors.secondary(), contentWidth / 4f);
        } else {
            font.drawText(matrixStack, content, textX, textY, fontSize, UIColors.textColor());
        }
    }

    private String getServerIP() {
        if (mc.isInSingleplayer()) {
            return "Singleplayer";
        }

        if (mc.getCurrentServerEntry() != null) {
            String ip = mc.getCurrentServerEntry().address;
            if (ip.contains(":")) {
                ip = ip.substring(0, ip.indexOf(":"));
            }
            return ip;
        }

        return "Not connected";
    }

    private String getClientVersion() {
        return ClientInfo.VERSION;
    }

    private String getClientName() {
        return ClientInfo.NAME;
    }

    @Override
    public void render(DrawContext context, int mouseX, int mouseY, float delta) {
        render(context.getMatrices());
    }

    @Override
    public void mouseClicked(double mouseX, double mouseY, int button) {}

    @Override
    public void mouseReleased(double mouseX, double mouseY, int button) {}

    @Override
    public void keyPressed(int keyCode, int scanCode, int modifiers) {}

    @Override
    public void mouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount) {}
}
шрифт поменяй
 
здраствуйте.
хз мейби кому то зайдет, главное не обосрите меня, я знаю что это говно.
Сделал за минут 20-40. Закругление не точь в точь, а остальное вроде тоже самое что и в CatLean.


Пожалуйста, авторизуйтесь для просмотра ссылки.


WatermarkWidget.java:
Expand Collapse Copy
package code.blume.client.ui.widget.overlay;

import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.util.math.MatrixStack;
import code.blume.api.system.backend.ClientInfo;
import code.blume.api.utils.color.UIColors;
import code.blume.api.utils.render.RenderUtil;
import code.blume.api.utils.render.fonts.Font;
import code.blume.client.ui.widget.Widget;

import java.awt.*;

public class WatermarkWidget extends Widget {

    public WatermarkWidget() {
        super(3f, 3f);
    }

    @Override
    public String getName() {
        return "Watermark";
    }

    @Override
    public void render(MatrixStack matrixStack) {
        float x = getDraggable().getX();
        float y = getDraggable().getY();
        float gap = getGap();

        float width = 0f;
        float height = 0f;

        float headSize = scaled(29f);
        boolean isRight = x > mc.getWindow().getScaledWidth() / 2f;

        float headX = !isRight ? x : x + getDraggable().getWidth() - headSize;

        Color staticBgColor = new Color(15, 15, 20, 220);
        Color staticOutlineColor = new Color(70, 70, 85, 150);
        float outlineWidth = 0.5f;
        float round = gap * 0.8f;

        RenderUtil.TEXTURE_RECT.drawHead(matrixStack, mc.player, headX, y, headSize, headSize, round, 2f, Color.WHITE);

        width += headSize + gap;
        height += headSize;

        float blocksStartX = !isRight ? x + headSize + gap : x;
        float blocksStartY = y;

        String clientFull = getClientName() + " " + getClientVersion();  // Blume 3.0.14
        String username = mc.player != null ? mc.player.getName().getString() : "Unknown";
        String serverIP = getServerIP();

        float fontSize = scaled(7.5f);

        float clientWidth = getSemiBoldFont().getWidth(clientFull, fontSize);
        float usernameWidth = getMediumFont().getWidth(username, fontSize);
        float serverWidth = getMediumFont().getWidth(serverIP, fontSize);

        float innerGap = gap * 0.6f;
        float blockHeight = fontSize + innerGap * 2f;

        float clientBlockX = blocksStartX;
        float clientBlockY = blocksStartY + (gap * 0.7f);
        float clientBlockWidth = clientWidth + gap * 1.2f;

        float usernameBlockX = blocksStartX;
        float usernameBlockY = blocksStartY + blockHeight + (gap * 1.5f);
        float usernameBlockWidth = usernameWidth + gap * 1.2f;

        float serverBlockX = usernameBlockX + usernameBlockWidth + gap * 0.8f;
        float serverBlockY = usernameBlockY;
        float serverBlockWidth = serverWidth + gap * 1.2f;

        float totalWidth = clientBlockWidth;
        totalWidth = Math.max(totalWidth, usernameBlockWidth + gap * 0.8f + serverBlockWidth);
        float totalHeight = blockHeight + gap + blockHeight;

        drawClientBlock(matrixStack, clientBlockX, clientBlockY, clientBlockWidth, blockHeight,
                getClientName(), getClientVersion(), staticBgColor, staticOutlineColor, fontSize, round, outlineWidth, innerGap);

        drawBlock(matrixStack, usernameBlockX, usernameBlockY, usernameBlockWidth, blockHeight, username,
                staticBgColor, staticOutlineColor, false, fontSize, round, outlineWidth, innerGap, usernameWidth);

        drawBlock(matrixStack, serverBlockX, serverBlockY, serverBlockWidth, blockHeight, serverIP,
                staticBgColor, staticOutlineColor, false, fontSize, round, outlineWidth, innerGap, serverWidth);

        width += totalWidth;
        height = Math.max(headSize, totalHeight);

        getDraggable().setWidth(width);
        getDraggable().setHeight(height);
    }

    private void drawClientBlock(MatrixStack matrixStack, float x, float y, float width, float height,
                                 String name, String version, Color bgColor, Color outlineColor,
                                 float fontSize, float round, float outlineWidth, float innerGap) {
        Font font = getSemiBoldFont();

        RenderUtil.RECT.draw(matrixStack, x - outlineWidth, y - outlineWidth,
                width + outlineWidth * 2, height + outlineWidth * 2,
                round + outlineWidth, outlineColor);

        RenderUtil.BLUR_RECT.draw(matrixStack, x, y, width, height, round, bgColor);

        float nameWidth = font.getWidth(name, fontSize);
        float versionWidth = font.getWidth(version, fontSize);
        float totalWidth = nameWidth + versionWidth + innerGap;
        float startX = x + (width - totalWidth) / 2f;
        float textY = y + (height - fontSize) / 2f;

        font.drawGradientText(matrixStack, name, startX, textY, fontSize,
                UIColors.primary(), UIColors.secondary(), nameWidth / 4f);

        font.drawText(matrixStack, version, startX + nameWidth + innerGap, textY, fontSize, new Color(180, 180, 200));
    }

    private void drawBlock(MatrixStack matrixStack, float x, float y, float width, float height, String content,
                           Color bgColor, Color outlineColor, boolean isGradient, float fontSize,
                           float round, float outlineWidth, float innerGap, float contentWidth) {

        RenderUtil.RECT.draw(matrixStack, x - outlineWidth, y - outlineWidth,
                width + outlineWidth * 2, height + outlineWidth * 2,
                round + outlineWidth, outlineColor);

        RenderUtil.BLUR_RECT.draw(matrixStack, x, y, width, height, round, bgColor);

        Font font = isGradient ? getSemiBoldFont() : getMediumFont();
        float textX = x + (width - contentWidth) / 2f;
        float textY = y + (height - fontSize) / 2f;

        if (isGradient) {
            font.drawGradientText(matrixStack, content, textX, textY, fontSize,
                    UIColors.primary(), UIColors.secondary(), contentWidth / 4f);
        } else {
            font.drawText(matrixStack, content, textX, textY, fontSize, UIColors.textColor());
        }
    }

    private String getServerIP() {
        if (mc.isInSingleplayer()) {
            return "Singleplayer";
        }

        if (mc.getCurrentServerEntry() != null) {
            String ip = mc.getCurrentServerEntry().address;
            if (ip.contains(":")) {
                ip = ip.substring(0, ip.indexOf(":"));
            }
            return ip;
        }

        return "Not connected";
    }

    private String getClientVersion() {
        return ClientInfo.VERSION;
    }

    private String getClientName() {
        return ClientInfo.NAME;
    }

    @Override
    public void render(DrawContext context, int mouseX, int mouseY, float delta) {
        render(context.getMatrices());
    }

    @Override
    public void mouseClicked(double mouseX, double mouseY, int button) {}

    @Override
    public void mouseReleased(double mouseX, double mouseY, int button) {}

    @Override
    public void keyPressed(int keyCode, int scanCode, int modifiers) {}

    @Override
    public void mouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount) {}
}
импортозамещение кетлина американского!
 
здраствуйте.
хз мейби кому то зайдет, главное не обосрите меня, я знаю что это говно.
Сделал за минут 20-40. Закругление не точь в точь, а остальное вроде тоже самое что и в CatLean.


Пожалуйста, авторизуйтесь для просмотра ссылки.


WatermarkWidget.java:
Expand Collapse Copy
package code.blume.client.ui.widget.overlay;

import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.util.math.MatrixStack;
import code.blume.api.system.backend.ClientInfo;
import code.blume.api.utils.color.UIColors;
import code.blume.api.utils.render.RenderUtil;
import code.blume.api.utils.render.fonts.Font;
import code.blume.client.ui.widget.Widget;

import java.awt.*;

public class WatermarkWidget extends Widget {

    public WatermarkWidget() {
        super(3f, 3f);
    }

    @Override
    public String getName() {
        return "Watermark";
    }

    @Override
    public void render(MatrixStack matrixStack) {
        float x = getDraggable().getX();
        float y = getDraggable().getY();
        float gap = getGap();

        float width = 0f;
        float height = 0f;

        float headSize = scaled(29f);
        boolean isRight = x > mc.getWindow().getScaledWidth() / 2f;

        float headX = !isRight ? x : x + getDraggable().getWidth() - headSize;

        Color staticBgColor = new Color(15, 15, 20, 220);
        Color staticOutlineColor = new Color(70, 70, 85, 150);
        float outlineWidth = 0.5f;
        float round = gap * 0.8f;

        RenderUtil.TEXTURE_RECT.drawHead(matrixStack, mc.player, headX, y, headSize, headSize, round, 2f, Color.WHITE);

        width += headSize + gap;
        height += headSize;

        float blocksStartX = !isRight ? x + headSize + gap : x;
        float blocksStartY = y;

        String clientFull = getClientName() + " " + getClientVersion();  // Blume 3.0.14
        String username = mc.player != null ? mc.player.getName().getString() : "Unknown";
        String serverIP = getServerIP();

        float fontSize = scaled(7.5f);

        float clientWidth = getSemiBoldFont().getWidth(clientFull, fontSize);
        float usernameWidth = getMediumFont().getWidth(username, fontSize);
        float serverWidth = getMediumFont().getWidth(serverIP, fontSize);

        float innerGap = gap * 0.6f;
        float blockHeight = fontSize + innerGap * 2f;

        float clientBlockX = blocksStartX;
        float clientBlockY = blocksStartY + (gap * 0.7f);
        float clientBlockWidth = clientWidth + gap * 1.2f;

        float usernameBlockX = blocksStartX;
        float usernameBlockY = blocksStartY + blockHeight + (gap * 1.5f);
        float usernameBlockWidth = usernameWidth + gap * 1.2f;

        float serverBlockX = usernameBlockX + usernameBlockWidth + gap * 0.8f;
        float serverBlockY = usernameBlockY;
        float serverBlockWidth = serverWidth + gap * 1.2f;

        float totalWidth = clientBlockWidth;
        totalWidth = Math.max(totalWidth, usernameBlockWidth + gap * 0.8f + serverBlockWidth);
        float totalHeight = blockHeight + gap + blockHeight;

        drawClientBlock(matrixStack, clientBlockX, clientBlockY, clientBlockWidth, blockHeight,
                getClientName(), getClientVersion(), staticBgColor, staticOutlineColor, fontSize, round, outlineWidth, innerGap);

        drawBlock(matrixStack, usernameBlockX, usernameBlockY, usernameBlockWidth, blockHeight, username,
                staticBgColor, staticOutlineColor, false, fontSize, round, outlineWidth, innerGap, usernameWidth);

        drawBlock(matrixStack, serverBlockX, serverBlockY, serverBlockWidth, blockHeight, serverIP,
                staticBgColor, staticOutlineColor, false, fontSize, round, outlineWidth, innerGap, serverWidth);

        width += totalWidth;
        height = Math.max(headSize, totalHeight);

        getDraggable().setWidth(width);
        getDraggable().setHeight(height);
    }

    private void drawClientBlock(MatrixStack matrixStack, float x, float y, float width, float height,
                                 String name, String version, Color bgColor, Color outlineColor,
                                 float fontSize, float round, float outlineWidth, float innerGap) {
        Font font = getSemiBoldFont();

        RenderUtil.RECT.draw(matrixStack, x - outlineWidth, y - outlineWidth,
                width + outlineWidth * 2, height + outlineWidth * 2,
                round + outlineWidth, outlineColor);

        RenderUtil.BLUR_RECT.draw(matrixStack, x, y, width, height, round, bgColor);

        float nameWidth = font.getWidth(name, fontSize);
        float versionWidth = font.getWidth(version, fontSize);
        float totalWidth = nameWidth + versionWidth + innerGap;
        float startX = x + (width - totalWidth) / 2f;
        float textY = y + (height - fontSize) / 2f;

        font.drawGradientText(matrixStack, name, startX, textY, fontSize,
                UIColors.primary(), UIColors.secondary(), nameWidth / 4f);

        font.drawText(matrixStack, version, startX + nameWidth + innerGap, textY, fontSize, new Color(180, 180, 200));
    }

    private void drawBlock(MatrixStack matrixStack, float x, float y, float width, float height, String content,
                           Color bgColor, Color outlineColor, boolean isGradient, float fontSize,
                           float round, float outlineWidth, float innerGap, float contentWidth) {

        RenderUtil.RECT.draw(matrixStack, x - outlineWidth, y - outlineWidth,
                width + outlineWidth * 2, height + outlineWidth * 2,
                round + outlineWidth, outlineColor);

        RenderUtil.BLUR_RECT.draw(matrixStack, x, y, width, height, round, bgColor);

        Font font = isGradient ? getSemiBoldFont() : getMediumFont();
        float textX = x + (width - contentWidth) / 2f;
        float textY = y + (height - fontSize) / 2f;

        if (isGradient) {
            font.drawGradientText(matrixStack, content, textX, textY, fontSize,
                    UIColors.primary(), UIColors.secondary(), contentWidth / 4f);
        } else {
            font.drawText(matrixStack, content, textX, textY, fontSize, UIColors.textColor());
        }
    }

    private String getServerIP() {
        if (mc.isInSingleplayer()) {
            return "Singleplayer";
        }

        if (mc.getCurrentServerEntry() != null) {
            String ip = mc.getCurrentServerEntry().address;
            if (ip.contains(":")) {
                ip = ip.substring(0, ip.indexOf(":"));
            }
            return ip;
        }

        return "Not connected";
    }

    private String getClientVersion() {
        return ClientInfo.VERSION;
    }

    private String getClientName() {
        return ClientInfo.NAME;
    }

    @Override
    public void render(DrawContext context, int mouseX, int mouseY, float delta) {
        render(context.getMatrices());
    }

    @Override
    public void mouseClicked(double mouseX, double mouseY, int button) {}

    @Override
    public void mouseReleased(double mouseX, double mouseY, int button) {}

    @Override
    public void keyPressed(int keyCode, int scanCode, int modifiers) {}

    @Override
    public void mouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount) {}
}
1774384114041.png

а что измениллось с сурсов?
 
Назад
Сверху Снизу