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

Визуальная часть Watermark Rich 1.21.4

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
30 Окт 2025
Сообщения
7
Реакции
0
Выберите загрузчик игры
  1. Fabric
Опять фул ии, мб лучше чем прошлая ватермарка
Java:
Expand Collapse Copy
package fun.rich.display.hud;

import antidaunleak.api.UserProfile;
import com.google.common.base.Suppliers;
import fun.rich.utils.client.managers.api.draggable.AbstractDraggable;
import fun.rich.utils.display.atlasfont.msdf.MsdfFont;
import fun.rich.utils.display.font.Fonts;
import fun.rich.utils.display.shape.ShapeProperties;
import fun.rich.utils.display.systemrender.builders.Builder;
import fun.rich.Rich;
import fun.rich.utils.display.color.ColorAssist;
import fun.rich.features.impl.render.Hud;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.util.math.MatrixStack;
import org.joml.Matrix4f;
import java.awt.Color;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.function.Supplier;
import fun.rich.utils.performance.AnimationOptimizer;

public class Watermark extends AbstractDraggable {
    private int fpsCount = 0;
    private double lastX = 0, lastZ = 0;
    private long lastTime = 0;
    private double bps = 0;


    private long lastUpdateTime = 0;
    private static final long UPDATE_INTERVAL = 50;
    private String cachedTime = "";
    private String cachedCoordinates = "";
    private String cachedPing = "";
    private String cachedBps = "";
    private String cachedWindowsName = "";
    private String cachedServerIP = "";
    private static final Supplier<MsdfFont> ICONS_FONT = Suppliers.memoize(() -> MsdfFont.builder().atlas("icons").data("icons").build());
    private static final Supplier<MsdfFont> ICONS_FONT_1 = Suppliers.memoize(() -> MsdfFont.builder().atlas("clienticon1").data("clienticon1").build());
    private static final Supplier<MsdfFont> BOLD_FONT = Suppliers.memoize(() -> MsdfFont.builder().atlas("medium").data("medium").build());
    private static final Supplier<MsdfFont> ICONS = Suppliers.memoize(() -> MsdfFont.builder().atlas("medium").data("medium").build());

    public Watermark() {
        super("Watermark", 5, 5, 92, 27, false);

    @Override
    public void tick() {
        long currentTime = System.currentTimeMillis();

        long updateInterval = AnimationOptimizer.getUpdateInterval();
        if (currentTime - lastUpdateTime < updateInterval) {
            return;
        }
        lastUpdateTime = currentTime;

        fpsCount = mc.getCurrentFps();

        if (mc.player != null) {
            double currentX = mc.player.getX();
            double currentZ = mc.player.getZ();

            if (lastTime != 0) {
                double deltaTime = (currentTime - lastTime) / 1000.0;
                if (deltaTime > 0) {
                    double distance = Math.sqrt(Math.pow(currentX - lastX, 2) + Math.pow(currentZ - lastZ, 2));
                    bps = distance / deltaTime;
                }
            }

            lastX = currentX;
            lastZ = currentZ;
            lastTime = currentTime;

            cachedTime = LocalTime.now().format(DateTimeFormatter.ofPattern("HH:mm"));
            cachedCoordinates = String.format("%.0f %.0f %.0f", currentX, mc.player.getY(), currentZ);
            cachedBps = String.format("%.1f bps", bps);

            int ping = mc.getNetworkHandler() != null && mc.getNetworkHandler().getPlayerListEntry(mc.player.getUuid()) != null
                    ? mc.getNetworkHandler().getPlayerListEntry(mc.player.getUuid()).getLatency()
                    : 0;
            cachedPing = ping + " ping";
        }
        
        if (cachedWindowsName.isEmpty()) {
            try {
                cachedWindowsName = System.getProperty("user.name", "User");
            } catch (Exception e) {
                cachedWindowsName = "User";
            }
        }
        
        try {
            if (mc.getNetworkHandler() != null && mc.getNetworkHandler().getServerInfo() != null) {
                cachedServerIP = mc.getNetworkHandler().getServerInfo().address;
            } else {
                cachedServerIP = "Singleplayer";
            }
        } catch (Exception e) {
            cachedServerIP = "Unknown";
        }
    }

    @Override
    public void drawDraggable(DrawContext e) {
        MatrixStack matrix = e.getMatrices();
        Matrix4f matrix4f = matrix.peek().getPositionMatrix();

        int iconColor = new Color(100, 120, 255).getRGB();
        
        
        float squareHeight = 16f;
        float iconSize = 16f;
        float textSize = 13f;
        float iconTextSpacing = 0.5f;
        float legionIconSize = 28f;
        
        float legionIconWidth = Fonts.getSize((int)legionIconSize, Fonts.Type.LEGION).getStringWidth("A");
        
        float userIconWidth = Fonts.getSize((int)iconSize, Fonts.Type.USERS).getStringWidth("A");
        float textWidth = Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).getStringWidth(cachedWindowsName);
        float arrowWidth = Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).getStringWidth(" » ");
        float serverIconWidth = Fonts.getSize((int)iconSize, Fonts.Type.SERVER).getStringWidth("A");
        float serverIPWidth = Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).getStringWidth(cachedServerIP);
        float pingIconWidth = Fonts.getSize((int)iconSize, Fonts.Type.PING).getStringWidth("A");
        
        int ping = mc.getNetworkHandler() != null && mc.getNetworkHandler().getPlayerListEntry(mc.player.getUuid()) != null
                ? mc.getNetworkHandler().getPlayerListEntry(mc.player.getUuid()).getLatency()
                : 0;
        String pingText = ping + "ms";
        float pingTextWidth = Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).getStringWidth(pingText);
        
        float fpsIconWidth = Fonts.getSize((int)iconSize, Fonts.Type.FPS).getStringWidth("A");
        String fpsText = fpsCount + "fps";
        float fpsTextWidth = Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).getStringWidth(fpsText);
        

        float totalContentWidth = legionIconWidth + arrowWidth + 4f +
                                 userIconWidth + iconTextSpacing + textWidth + arrowWidth +
                                 serverIconWidth + iconTextSpacing + serverIPWidth + arrowWidth +
                                 pingIconWidth + iconTextSpacing + pingTextWidth + arrowWidth +
                                 fpsIconWidth + iconTextSpacing + fpsTextWidth;
        
        float squareWidth = totalContentWidth + 8f;
        
        setWidth((int) squareWidth + 6);
        setHeight((int) squareHeight + 6);

        float currentX = getX() + 3;
        float currentY = getY() + 3;

        blur.render(ShapeProperties.create(matrix, currentX, currentY, squareWidth, squareHeight)
                .round(Hud.getInstance().roundnessSetting.getValue()).quality(15)
                .color(new Color(0, 0, 0, 120).getRGB())
                .build());

        rectangle.render(ShapeProperties.create(matrix, currentX, currentY, squareWidth, squareHeight)
                .round(Hud.getInstance().roundnessSetting.getValue())
                .thickness(1.5f)
                .outlineColor(new Color(40, 45, 64, 180).getRGB())
                .color(new Color(28, 31, 44, 255).getRGB())
                .build());
        
      
        float startX = currentX + (squareWidth - totalContentWidth) / 2;
        float centerY = currentY + (squareHeight - Math.max(iconSize, textSize)) / 2 + 6;
        
  
        float legionRectWidth = legionIconWidth + 4f;
        float legionRectHeight = squareHeight - 4f;
        float legionRectY = currentY + 2f;
        
        
        rectangle.render(ShapeProperties.create(matrix, legionRectX, legionRectY, legionRectWidth, legionRectHeight)
                .round(Hud.getInstance().roundnessSetting.getValue() - 1f)
                .color(new Color(18, 20, 28, 255).getRGB())
                .build());
        
        Fonts.getSize((int)legionIconSize, Fonts.Type.LEGION).drawString(matrix, "A", startX, centerY + -2f, iconColor);
        
        float legionArrowX = startX + legionIconWidth + 2f;
        Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).drawString(matrix, " » ",
                legionArrowX, centerY + 0.7f, Color.GRAY.getRGB());
        
        startX += legionIconWidth + arrowWidth + 4f;
        
        Fonts.getSize((int)iconSize, Fonts.Type.USERS).drawString(matrix, "A", startX + -1f, centerY + 1.5f, iconColor);
        
        float userNameX = startX + userIconWidth + iconTextSpacing + -1f;
        Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).drawString(matrix, cachedWindowsName,
                userNameX, centerY + 0.7f, Color.WHITE.getRGB());
        
        float arrowX = userNameX + textWidth;
        Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).drawString(matrix, " » ",
                arrowX, centerY + 0.7f, Color.GRAY.getRGB());
        
        float serverIconX = arrowX + arrowWidth;
        Fonts.getSize((int)iconSize, Fonts.Type.SERVER).drawString(matrix, "A",
                serverIconX, centerY + 1.5f, iconColor);
        
        float serverIPX = serverIconX + serverIconWidth + iconTextSpacing;
        Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).drawString(matrix, cachedServerIP,
                serverIPX, centerY + 0.7f, Color.WHITE.getRGB());
        
        float arrow2X = serverIPX + serverIPWidth;
        Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).drawString(matrix, " » ",
                arrow2X, centerY + 0.7f, Color.GRAY.getRGB());
        
        float pingIconX = arrow2X + arrowWidth;
        Fonts.getSize((int)iconSize, Fonts.Type.PING).drawString(matrix, "A",
                pingIconX, centerY + 1f, iconColor);
        
        float pingTextX = pingIconX + pingIconWidth + iconTextSpacing;
        Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).drawString(matrix, pingText,
                pingTextX, centerY + 0.7f, Color.WHITE.getRGB());
        
        float arrow3X = pingTextX + pingTextWidth;
        Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).drawString(matrix, " » ",
                arrow3X, centerY + 0.7f, Color.GRAY.getRGB());
        
        float fpsIconX = arrow3X + arrowWidth;
        Fonts.getSize((int)iconSize, Fonts.Type.FPS).drawString(matrix, "A",
                fpsIconX, centerY + 1f, iconColor);
        
        float fpsTextX = fpsIconX + fpsIconWidth + iconTextSpacing;
        Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).drawString(matrix, fpsText,
                fpsTextX, centerY + 0.7f, Color.WHITE.getRGB());
    }
}
 

Вложения

  • Minecraft Screenshot 2026.02.01 - 17.20.29.73.png
    Minecraft Screenshot 2026.02.01 - 17.20.29.73.png
    1.3 MB · Просмотры: 234
Опять фул ии, мб лучше чем прошлая ватермарка
Java:
Expand Collapse Copy
package fun.rich.display.hud;

import antidaunleak.api.UserProfile;
import com.google.common.base.Suppliers;
import fun.rich.utils.client.managers.api.draggable.AbstractDraggable;
import fun.rich.utils.display.atlasfont.msdf.MsdfFont;
import fun.rich.utils.display.font.Fonts;
import fun.rich.utils.display.shape.ShapeProperties;
import fun.rich.utils.display.systemrender.builders.Builder;
import fun.rich.Rich;
import fun.rich.utils.display.color.ColorAssist;
import fun.rich.features.impl.render.Hud;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.util.math.MatrixStack;
import org.joml.Matrix4f;
import java.awt.Color;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.function.Supplier;
import fun.rich.utils.performance.AnimationOptimizer;

public class Watermark extends AbstractDraggable {
    private int fpsCount = 0;
    private double lastX = 0, lastZ = 0;
    private long lastTime = 0;
    private double bps = 0;


    private long lastUpdateTime = 0;
    private static final long UPDATE_INTERVAL = 50;
    private String cachedTime = "";
    private String cachedCoordinates = "";
    private String cachedPing = "";
    private String cachedBps = "";
    private String cachedWindowsName = "";
    private String cachedServerIP = "";
    private static final Supplier<MsdfFont> ICONS_FONT = Suppliers.memoize(() -> MsdfFont.builder().atlas("icons").data("icons").build());
    private static final Supplier<MsdfFont> ICONS_FONT_1 = Suppliers.memoize(() -> MsdfFont.builder().atlas("clienticon1").data("clienticon1").build());
    private static final Supplier<MsdfFont> BOLD_FONT = Suppliers.memoize(() -> MsdfFont.builder().atlas("medium").data("medium").build());
    private static final Supplier<MsdfFont> ICONS = Suppliers.memoize(() -> MsdfFont.builder().atlas("medium").data("medium").build());

    public Watermark() {
        super("Watermark", 5, 5, 92, 27, false);

    @Override
    public void tick() {
        long currentTime = System.currentTimeMillis();

        long updateInterval = AnimationOptimizer.getUpdateInterval();
        if (currentTime - lastUpdateTime < updateInterval) {
            return;
        }
        lastUpdateTime = currentTime;

        fpsCount = mc.getCurrentFps();

        if (mc.player != null) {
            double currentX = mc.player.getX();
            double currentZ = mc.player.getZ();

            if (lastTime != 0) {
                double deltaTime = (currentTime - lastTime) / 1000.0;
                if (deltaTime > 0) {
                    double distance = Math.sqrt(Math.pow(currentX - lastX, 2) + Math.pow(currentZ - lastZ, 2));
                    bps = distance / deltaTime;
                }
            }

            lastX = currentX;
            lastZ = currentZ;
            lastTime = currentTime;

            cachedTime = LocalTime.now().format(DateTimeFormatter.ofPattern("HH:mm"));
            cachedCoordinates = String.format("%.0f %.0f %.0f", currentX, mc.player.getY(), currentZ);
            cachedBps = String.format("%.1f bps", bps);

            int ping = mc.getNetworkHandler() != null && mc.getNetworkHandler().getPlayerListEntry(mc.player.getUuid()) != null
                    ? mc.getNetworkHandler().getPlayerListEntry(mc.player.getUuid()).getLatency()
                    : 0;
            cachedPing = ping + " ping";
        }
       
        if (cachedWindowsName.isEmpty()) {
            try {
                cachedWindowsName = System.getProperty("user.name", "User");
            } catch (Exception e) {
                cachedWindowsName = "User";
            }
        }
       
        try {
            if (mc.getNetworkHandler() != null && mc.getNetworkHandler().getServerInfo() != null) {
                cachedServerIP = mc.getNetworkHandler().getServerInfo().address;
            } else {
                cachedServerIP = "Singleplayer";
            }
        } catch (Exception e) {
            cachedServerIP = "Unknown";
        }
    }

    @Override
    public void drawDraggable(DrawContext e) {
        MatrixStack matrix = e.getMatrices();
        Matrix4f matrix4f = matrix.peek().getPositionMatrix();

        int iconColor = new Color(100, 120, 255).getRGB();
       
       
        float squareHeight = 16f;
        float iconSize = 16f;
        float textSize = 13f;
        float iconTextSpacing = 0.5f;
        float legionIconSize = 28f;
       
        float legionIconWidth = Fonts.getSize((int)legionIconSize, Fonts.Type.LEGION).getStringWidth("A");
       
        float userIconWidth = Fonts.getSize((int)iconSize, Fonts.Type.USERS).getStringWidth("A");
        float textWidth = Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).getStringWidth(cachedWindowsName);
        float arrowWidth = Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).getStringWidth(" » ");
        float serverIconWidth = Fonts.getSize((int)iconSize, Fonts.Type.SERVER).getStringWidth("A");
        float serverIPWidth = Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).getStringWidth(cachedServerIP);
        float pingIconWidth = Fonts.getSize((int)iconSize, Fonts.Type.PING).getStringWidth("A");
       
        int ping = mc.getNetworkHandler() != null && mc.getNetworkHandler().getPlayerListEntry(mc.player.getUuid()) != null
                ? mc.getNetworkHandler().getPlayerListEntry(mc.player.getUuid()).getLatency()
                : 0;
        String pingText = ping + "ms";
        float pingTextWidth = Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).getStringWidth(pingText);
       
        float fpsIconWidth = Fonts.getSize((int)iconSize, Fonts.Type.FPS).getStringWidth("A");
        String fpsText = fpsCount + "fps";
        float fpsTextWidth = Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).getStringWidth(fpsText);
       

        float totalContentWidth = legionIconWidth + arrowWidth + 4f +
                                 userIconWidth + iconTextSpacing + textWidth + arrowWidth +
                                 serverIconWidth + iconTextSpacing + serverIPWidth + arrowWidth +
                                 pingIconWidth + iconTextSpacing + pingTextWidth + arrowWidth +
                                 fpsIconWidth + iconTextSpacing + fpsTextWidth;
       
        float squareWidth = totalContentWidth + 8f;
       
        setWidth((int) squareWidth + 6);
        setHeight((int) squareHeight + 6);

        float currentX = getX() + 3;
        float currentY = getY() + 3;

        blur.render(ShapeProperties.create(matrix, currentX, currentY, squareWidth, squareHeight)
                .round(Hud.getInstance().roundnessSetting.getValue()).quality(15)
                .color(new Color(0, 0, 0, 120).getRGB())
                .build());

        rectangle.render(ShapeProperties.create(matrix, currentX, currentY, squareWidth, squareHeight)
                .round(Hud.getInstance().roundnessSetting.getValue())
                .thickness(1.5f)
                .outlineColor(new Color(40, 45, 64, 180).getRGB())
                .color(new Color(28, 31, 44, 255).getRGB())
                .build());
       
     
        float startX = currentX + (squareWidth - totalContentWidth) / 2;
        float centerY = currentY + (squareHeight - Math.max(iconSize, textSize)) / 2 + 6;
       
 
        float legionRectWidth = legionIconWidth + 4f;
        float legionRectHeight = squareHeight - 4f;
        float legionRectY = currentY + 2f;
       
       
        rectangle.render(ShapeProperties.create(matrix, legionRectX, legionRectY, legionRectWidth, legionRectHeight)
                .round(Hud.getInstance().roundnessSetting.getValue() - 1f)
                .color(new Color(18, 20, 28, 255).getRGB())
                .build());
       
        Fonts.getSize((int)legionIconSize, Fonts.Type.LEGION).drawString(matrix, "A", startX, centerY + -2f, iconColor);
       
        float legionArrowX = startX + legionIconWidth + 2f;
        Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).drawString(matrix, " » ",
                legionArrowX, centerY + 0.7f, Color.GRAY.getRGB());
       
        startX += legionIconWidth + arrowWidth + 4f;
       
        Fonts.getSize((int)iconSize, Fonts.Type.USERS).drawString(matrix, "A", startX + -1f, centerY + 1.5f, iconColor);
       
        float userNameX = startX + userIconWidth + iconTextSpacing + -1f;
        Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).drawString(matrix, cachedWindowsName,
                userNameX, centerY + 0.7f, Color.WHITE.getRGB());
       
        float arrowX = userNameX + textWidth;
        Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).drawString(matrix, " » ",
                arrowX, centerY + 0.7f, Color.GRAY.getRGB());
       
        float serverIconX = arrowX + arrowWidth;
        Fonts.getSize((int)iconSize, Fonts.Type.SERVER).drawString(matrix, "A",
                serverIconX, centerY + 1.5f, iconColor);
       
        float serverIPX = serverIconX + serverIconWidth + iconTextSpacing;
        Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).drawString(matrix, cachedServerIP,
                serverIPX, centerY + 0.7f, Color.WHITE.getRGB());
       
        float arrow2X = serverIPX + serverIPWidth;
        Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).drawString(matrix, " » ",
                arrow2X, centerY + 0.7f, Color.GRAY.getRGB());
       
        float pingIconX = arrow2X + arrowWidth;
        Fonts.getSize((int)iconSize, Fonts.Type.PING).drawString(matrix, "A",
                pingIconX, centerY + 1f, iconColor);
       
        float pingTextX = pingIconX + pingIconWidth + iconTextSpacing;
        Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).drawString(matrix, pingText,
                pingTextX, centerY + 0.7f, Color.WHITE.getRGB());
       
        float arrow3X = pingTextX + pingTextWidth;
        Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).drawString(matrix, " » ",
                arrow3X, centerY + 0.7f, Color.GRAY.getRGB());
       
        float fpsIconX = arrow3X + arrowWidth;
        Fonts.getSize((int)iconSize, Fonts.Type.FPS).drawString(matrix, "A",
                fpsIconX, centerY + 1f, iconColor);
       
        float fpsTextX = fpsIconX + fpsIconWidth + iconTextSpacing;
        Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).drawString(matrix, fpsText,
                fpsTextX, centerY + 0.7f, Color.WHITE.getRGB());
    }
}
вроде норм а вроде всё ебать как слитно
 
Опять фул ии, мб лучше чем прошлая ватермарка
Java:
Expand Collapse Copy
package fun.rich.display.hud;

import antidaunleak.api.UserProfile;
import com.google.common.base.Suppliers;
import fun.rich.utils.client.managers.api.draggable.AbstractDraggable;
import fun.rich.utils.display.atlasfont.msdf.MsdfFont;
import fun.rich.utils.display.font.Fonts;
import fun.rich.utils.display.shape.ShapeProperties;
import fun.rich.utils.display.systemrender.builders.Builder;
import fun.rich.Rich;
import fun.rich.utils.display.color.ColorAssist;
import fun.rich.features.impl.render.Hud;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.util.math.MatrixStack;
import org.joml.Matrix4f;
import java.awt.Color;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.function.Supplier;
import fun.rich.utils.performance.AnimationOptimizer;

public class Watermark extends AbstractDraggable {
    private int fpsCount = 0;
    private double lastX = 0, lastZ = 0;
    private long lastTime = 0;
    private double bps = 0;


    private long lastUpdateTime = 0;
    private static final long UPDATE_INTERVAL = 50;
    private String cachedTime = "";
    private String cachedCoordinates = "";
    private String cachedPing = "";
    private String cachedBps = "";
    private String cachedWindowsName = "";
    private String cachedServerIP = "";
    private static final Supplier<MsdfFont> ICONS_FONT = Suppliers.memoize(() -> MsdfFont.builder().atlas("icons").data("icons").build());
    private static final Supplier<MsdfFont> ICONS_FONT_1 = Suppliers.memoize(() -> MsdfFont.builder().atlas("clienticon1").data("clienticon1").build());
    private static final Supplier<MsdfFont> BOLD_FONT = Suppliers.memoize(() -> MsdfFont.builder().atlas("medium").data("medium").build());
    private static final Supplier<MsdfFont> ICONS = Suppliers.memoize(() -> MsdfFont.builder().atlas("medium").data("medium").build());

    public Watermark() {
        super("Watermark", 5, 5, 92, 27, false);

    @Override
    public void tick() {
        long currentTime = System.currentTimeMillis();

        long updateInterval = AnimationOptimizer.getUpdateInterval();
        if (currentTime - lastUpdateTime < updateInterval) {
            return;
        }
        lastUpdateTime = currentTime;

        fpsCount = mc.getCurrentFps();

        if (mc.player != null) {
            double currentX = mc.player.getX();
            double currentZ = mc.player.getZ();

            if (lastTime != 0) {
                double deltaTime = (currentTime - lastTime) / 1000.0;
                if (deltaTime > 0) {
                    double distance = Math.sqrt(Math.pow(currentX - lastX, 2) + Math.pow(currentZ - lastZ, 2));
                    bps = distance / deltaTime;
                }
            }

            lastX = currentX;
            lastZ = currentZ;
            lastTime = currentTime;

            cachedTime = LocalTime.now().format(DateTimeFormatter.ofPattern("HH:mm"));
            cachedCoordinates = String.format("%.0f %.0f %.0f", currentX, mc.player.getY(), currentZ);
            cachedBps = String.format("%.1f bps", bps);

            int ping = mc.getNetworkHandler() != null && mc.getNetworkHandler().getPlayerListEntry(mc.player.getUuid()) != null
                    ? mc.getNetworkHandler().getPlayerListEntry(mc.player.getUuid()).getLatency()
                    : 0;
            cachedPing = ping + " ping";
        }
       
        if (cachedWindowsName.isEmpty()) {
            try {
                cachedWindowsName = System.getProperty("user.name", "User");
            } catch (Exception e) {
                cachedWindowsName = "User";
            }
        }
       
        try {
            if (mc.getNetworkHandler() != null && mc.getNetworkHandler().getServerInfo() != null) {
                cachedServerIP = mc.getNetworkHandler().getServerInfo().address;
            } else {
                cachedServerIP = "Singleplayer";
            }
        } catch (Exception e) {
            cachedServerIP = "Unknown";
        }
    }

    @Override
    public void drawDraggable(DrawContext e) {
        MatrixStack matrix = e.getMatrices();
        Matrix4f matrix4f = matrix.peek().getPositionMatrix();

        int iconColor = new Color(100, 120, 255).getRGB();
       
       
        float squareHeight = 16f;
        float iconSize = 16f;
        float textSize = 13f;
        float iconTextSpacing = 0.5f;
        float legionIconSize = 28f;
       
        float legionIconWidth = Fonts.getSize((int)legionIconSize, Fonts.Type.LEGION).getStringWidth("A");
       
        float userIconWidth = Fonts.getSize((int)iconSize, Fonts.Type.USERS).getStringWidth("A");
        float textWidth = Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).getStringWidth(cachedWindowsName);
        float arrowWidth = Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).getStringWidth(" » ");
        float serverIconWidth = Fonts.getSize((int)iconSize, Fonts.Type.SERVER).getStringWidth("A");
        float serverIPWidth = Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).getStringWidth(cachedServerIP);
        float pingIconWidth = Fonts.getSize((int)iconSize, Fonts.Type.PING).getStringWidth("A");
       
        int ping = mc.getNetworkHandler() != null && mc.getNetworkHandler().getPlayerListEntry(mc.player.getUuid()) != null
                ? mc.getNetworkHandler().getPlayerListEntry(mc.player.getUuid()).getLatency()
                : 0;
        String pingText = ping + "ms";
        float pingTextWidth = Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).getStringWidth(pingText);
       
        float fpsIconWidth = Fonts.getSize((int)iconSize, Fonts.Type.FPS).getStringWidth("A");
        String fpsText = fpsCount + "fps";
        float fpsTextWidth = Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).getStringWidth(fpsText);
       

        float totalContentWidth = legionIconWidth + arrowWidth + 4f +
                                 userIconWidth + iconTextSpacing + textWidth + arrowWidth +
                                 serverIconWidth + iconTextSpacing + serverIPWidth + arrowWidth +
                                 pingIconWidth + iconTextSpacing + pingTextWidth + arrowWidth +
                                 fpsIconWidth + iconTextSpacing + fpsTextWidth;
       
        float squareWidth = totalContentWidth + 8f;
       
        setWidth((int) squareWidth + 6);
        setHeight((int) squareHeight + 6);

        float currentX = getX() + 3;
        float currentY = getY() + 3;

        blur.render(ShapeProperties.create(matrix, currentX, currentY, squareWidth, squareHeight)
                .round(Hud.getInstance().roundnessSetting.getValue()).quality(15)
                .color(new Color(0, 0, 0, 120).getRGB())
                .build());

        rectangle.render(ShapeProperties.create(matrix, currentX, currentY, squareWidth, squareHeight)
                .round(Hud.getInstance().roundnessSetting.getValue())
                .thickness(1.5f)
                .outlineColor(new Color(40, 45, 64, 180).getRGB())
                .color(new Color(28, 31, 44, 255).getRGB())
                .build());
       
     
        float startX = currentX + (squareWidth - totalContentWidth) / 2;
        float centerY = currentY + (squareHeight - Math.max(iconSize, textSize)) / 2 + 6;
       
 
        float legionRectWidth = legionIconWidth + 4f;
        float legionRectHeight = squareHeight - 4f;
        float legionRectY = currentY + 2f;
       
       
        rectangle.render(ShapeProperties.create(matrix, legionRectX, legionRectY, legionRectWidth, legionRectHeight)
                .round(Hud.getInstance().roundnessSetting.getValue() - 1f)
                .color(new Color(18, 20, 28, 255).getRGB())
                .build());
       
        Fonts.getSize((int)legionIconSize, Fonts.Type.LEGION).drawString(matrix, "A", startX, centerY + -2f, iconColor);
       
        float legionArrowX = startX + legionIconWidth + 2f;
        Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).drawString(matrix, " » ",
                legionArrowX, centerY + 0.7f, Color.GRAY.getRGB());
       
        startX += legionIconWidth + arrowWidth + 4f;
       
        Fonts.getSize((int)iconSize, Fonts.Type.USERS).drawString(matrix, "A", startX + -1f, centerY + 1.5f, iconColor);
       
        float userNameX = startX + userIconWidth + iconTextSpacing + -1f;
        Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).drawString(matrix, cachedWindowsName,
                userNameX, centerY + 0.7f, Color.WHITE.getRGB());
       
        float arrowX = userNameX + textWidth;
        Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).drawString(matrix, " » ",
                arrowX, centerY + 0.7f, Color.GRAY.getRGB());
       
        float serverIconX = arrowX + arrowWidth;
        Fonts.getSize((int)iconSize, Fonts.Type.SERVER).drawString(matrix, "A",
                serverIconX, centerY + 1.5f, iconColor);
       
        float serverIPX = serverIconX + serverIconWidth + iconTextSpacing;
        Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).drawString(matrix, cachedServerIP,
                serverIPX, centerY + 0.7f, Color.WHITE.getRGB());
       
        float arrow2X = serverIPX + serverIPWidth;
        Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).drawString(matrix, " » ",
                arrow2X, centerY + 0.7f, Color.GRAY.getRGB());
       
        float pingIconX = arrow2X + arrowWidth;
        Fonts.getSize((int)iconSize, Fonts.Type.PING).drawString(matrix, "A",
                pingIconX, centerY + 1f, iconColor);
       
        float pingTextX = pingIconX + pingIconWidth + iconTextSpacing;
        Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).drawString(matrix, pingText,
                pingTextX, centerY + 0.7f, Color.WHITE.getRGB());
       
        float arrow3X = pingTextX + pingTextWidth;
        Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).drawString(matrix, " » ",
                arrow3X, centerY + 0.7f, Color.GRAY.getRGB());
       
        float fpsIconX = arrow3X + arrowWidth;
        Fonts.getSize((int)iconSize, Fonts.Type.FPS).drawString(matrix, "A",
                fpsIconX, centerY + 1f, iconColor);
       
        float fpsTextX = fpsIconX + fpsIconWidth + iconTextSpacing;
        Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).drawString(matrix, fpsText,
                fpsTextX, centerY + 0.7f, Color.WHITE.getRGB());
    }
}
Ну хз, вроде хуйня ебаная а вроде и сойдет
 
Назад
Сверху Снизу