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

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

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
30 Окт 2025
Сообщения
4
Реакции
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();

String title = "Legion";

float colorSquareWidth = 18f;
float colorSquareHeight = 18f;
float spacing = 2f;
float potionsSquareHeight = 14f;
float iconSize = 16f;
float textSize = 13f;
float iconTextSpacing = 0.5f;

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 = userIconWidth + iconTextSpacing + textWidth + arrowWidth +
serverIconWidth + iconTextSpacing + serverIPWidth + arrowWidth +
pingIconWidth + iconTextSpacing + pingTextWidth + arrowWidth +
fpsIconWidth + iconTextSpacing + fpsTextWidth;

float potionsSquareWidth = totalContentWidth + 8f;

float totalWidth = colorSquareWidth + spacing + potionsSquareWidth + 6;
float totalHeight = Math.max(colorSquareHeight, potionsSquareHeight);

setWidth((int) totalWidth);
setHeight((int) totalHeight + 6);

float currentX = getX() + 3;

int hudColor = Color.WHITE.getRGB();
try {
if (Hud.getInstance() != null) {
hudColor = Hud.getInstance().colorSetting.getColor();
}
} catch (Exception ignored) {
}

rectangle.render(ShapeProperties.create(matrix, currentX, getY() + 3, colorSquareWidth, colorSquareHeight)
.round(Hud.getInstance().roundnessSetting.getValue())
.color(hudColor)
.build());

Fonts.getSize(30, Fonts.Type.LEGION).drawString(matrix, "A", currentX + 1.7, getY() + 7.5f, Color.WHITE.getRGB());

float potionsX = currentX + colorSquareWidth + spacing;
float potionsY = getY() + 3 + (colorSquareHeight - potionsSquareHeight) / 2;

blur.render(ShapeProperties.create(matrix, potionsX, potionsY, potionsSquareWidth, potionsSquareHeight)
.round(Hud.getInstance().roundnessSetting.getValue()).quality(15)
.color(new Color(0, 0, 0, 120).getRGB())
.build());

rectangle.render(ShapeProperties.create(matrix, potionsX, potionsY, potionsSquareWidth, potionsSquareHeight)
.round(Hud.getInstance().roundnessSetting.getValue())
.thickness(0.5f)
.outlineColor(new Color(255, 255, 255, 40).getRGB())
.color(hudColor, // Слева - цвет из HUD
new Color(25, 25, 30, 150).getRGB(),
new Color(25, 25, 30, 150).getRGB(), hudColor) // Слева - цвет из HUD .build());

float startX = potionsX + (potionsSquareWidth - totalContentWidth) / 2;
float centerY = potionsY + (potionsSquareHeight - Math.max(iconSize, textSize)) / 2 + 6;

Fonts.getSize((int)iconSize, Fonts.Type.USERS).drawString(matrix, "A", startX + -1f, centerY + 1.5f, hudColor);

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, hudColor);

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, hudColor);

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 + 1.5f, hudColor);

float fpsTextX = fpsIconX + fpsIconWidth + iconTextSpacing;
Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).drawString(matrix, fpsText,
fpsTextX, centerY + 0.7f, Color.WHITE.getRGB());
}
}
Ватермарка как в кряке дельты(фулл ии)
 

Вложения

  • Base Profile Screenshot 2026.01.24 - 21.51.27.65.png
    Base Profile Screenshot 2026.01.24 - 21.51.27.65.png
    1.3 MB · Просмотры: 333
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();

String title = "Legion";

float colorSquareWidth = 18f;
float colorSquareHeight = 18f;
float spacing = 2f;
float potionsSquareHeight = 14f;
float iconSize = 16f;
float textSize = 13f;
float iconTextSpacing = 0.5f;

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 = userIconWidth + iconTextSpacing + textWidth + arrowWidth +
serverIconWidth + iconTextSpacing + serverIPWidth + arrowWidth +
pingIconWidth + iconTextSpacing + pingTextWidth + arrowWidth +
fpsIconWidth + iconTextSpacing + fpsTextWidth;

float potionsSquareWidth = totalContentWidth + 8f;

float totalWidth = colorSquareWidth + spacing + potionsSquareWidth + 6;
float totalHeight = Math.max(colorSquareHeight, potionsSquareHeight);

setWidth((int) totalWidth);
setHeight((int) totalHeight + 6);

float currentX = getX() + 3;

int hudColor = Color.WHITE.getRGB();
try {
if (Hud.getInstance() != null) {
hudColor = Hud.getInstance().colorSetting.getColor();
}
} catch (Exception ignored) {
}

rectangle.render(ShapeProperties.create(matrix, currentX, getY() + 3, colorSquareWidth, colorSquareHeight)
.round(Hud.getInstance().roundnessSetting.getValue())
.color(hudColor)
.build());

Fonts.getSize(30, Fonts.Type.LEGION).drawString(matrix, "A", currentX + 1.7, getY() + 7.5f, Color.WHITE.getRGB());

float potionsX = currentX + colorSquareWidth + spacing;
float potionsY = getY() + 3 + (colorSquareHeight - potionsSquareHeight) / 2;

blur.render(ShapeProperties.create(matrix, potionsX, potionsY, potionsSquareWidth, potionsSquareHeight)
.round(Hud.getInstance().roundnessSetting.getValue()).quality(15)
.color(new Color(0, 0, 0, 120).getRGB())
.build());

rectangle.render(ShapeProperties.create(matrix, potionsX, potionsY, potionsSquareWidth, potionsSquareHeight)
.round(Hud.getInstance().roundnessSetting.getValue())
.thickness(0.5f)
.outlineColor(new Color(255, 255, 255, 40).getRGB())
.color(hudColor, // Слева - цвет из HUD
new Color(25, 25, 30, 150).getRGB(),
new Color(25, 25, 30, 150).getRGB(), hudColor) // Слева - цвет из HUD .build());

float startX = potionsX + (potionsSquareWidth - totalContentWidth) / 2;
float centerY = potionsY + (potionsSquareHeight - Math.max(iconSize, textSize)) / 2 + 6;

Fonts.getSize((int)iconSize, Fonts.Type.USERS).drawString(matrix, "A", startX + -1f, centerY + 1.5f, hudColor);

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, hudColor);

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, hudColor);

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 + 1.5f, hudColor);

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();

String title = "Legion";

float colorSquareWidth = 18f;
float colorSquareHeight = 18f;
float spacing = 2f;
float potionsSquareHeight = 14f;
float iconSize = 16f;
float textSize = 13f;
float iconTextSpacing = 0.5f;

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 = userIconWidth + iconTextSpacing + textWidth + arrowWidth +
serverIconWidth + iconTextSpacing + serverIPWidth + arrowWidth +
pingIconWidth + iconTextSpacing + pingTextWidth + arrowWidth +
fpsIconWidth + iconTextSpacing + fpsTextWidth;

float potionsSquareWidth = totalContentWidth + 8f;

float totalWidth = colorSquareWidth + spacing + potionsSquareWidth + 6;
float totalHeight = Math.max(colorSquareHeight, potionsSquareHeight);

setWidth((int) totalWidth);
setHeight((int) totalHeight + 6);

float currentX = getX() + 3;

int hudColor = Color.WHITE.getRGB();
try {
if (Hud.getInstance() != null) {
hudColor = Hud.getInstance().colorSetting.getColor();
}
} catch (Exception ignored) {
}

rectangle.render(ShapeProperties.create(matrix, currentX, getY() + 3, colorSquareWidth, colorSquareHeight)
.round(Hud.getInstance().roundnessSetting.getValue())
.color(hudColor)
.build());

Fonts.getSize(30, Fonts.Type.LEGION).drawString(matrix, "A", currentX + 1.7, getY() + 7.5f, Color.WHITE.getRGB());

float potionsX = currentX + colorSquareWidth + spacing;
float potionsY = getY() + 3 + (colorSquareHeight - potionsSquareHeight) / 2;

blur.render(ShapeProperties.create(matrix, potionsX, potionsY, potionsSquareWidth, potionsSquareHeight)
.round(Hud.getInstance().roundnessSetting.getValue()).quality(15)
.color(new Color(0, 0, 0, 120).getRGB())
.build());

rectangle.render(ShapeProperties.create(matrix, potionsX, potionsY, potionsSquareWidth, potionsSquareHeight)
.round(Hud.getInstance().roundnessSetting.getValue())
.thickness(0.5f)
.outlineColor(new Color(255, 255, 255, 40).getRGB())
.color(hudColor, // Слева - цвет из HUD
new Color(25, 25, 30, 150).getRGB(),
new Color(25, 25, 30, 150).getRGB(), hudColor) // Слева - цвет из HUD .build());

float startX = potionsX + (potionsSquareWidth - totalContentWidth) / 2;
float centerY = potionsY + (potionsSquareHeight - Math.max(iconSize, textSize)) / 2 + 6;

Fonts.getSize((int)iconSize, Fonts.Type.USERS).drawString(matrix, "A", startX + -1f, centerY + 1.5f, hudColor);

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, hudColor);

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, hudColor);

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 + 1.5f, hudColor);

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();

String title = "Legion";

float colorSquareWidth = 18f;
float colorSquareHeight = 18f;
float spacing = 2f;
float potionsSquareHeight = 14f;
float iconSize = 16f;
float textSize = 13f;
float iconTextSpacing = 0.5f;

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 = userIconWidth + iconTextSpacing + textWidth + arrowWidth +
serverIconWidth + iconTextSpacing + serverIPWidth + arrowWidth +
pingIconWidth + iconTextSpacing + pingTextWidth + arrowWidth +
fpsIconWidth + iconTextSpacing + fpsTextWidth;

float potionsSquareWidth = totalContentWidth + 8f;

float totalWidth = colorSquareWidth + spacing + potionsSquareWidth + 6;
float totalHeight = Math.max(colorSquareHeight, potionsSquareHeight);

setWidth((int) totalWidth);
setHeight((int) totalHeight + 6);

float currentX = getX() + 3;

int hudColor = Color.WHITE.getRGB();
try {
if (Hud.getInstance() != null) {
hudColor = Hud.getInstance().colorSetting.getColor();
}
} catch (Exception ignored) {
}

rectangle.render(ShapeProperties.create(matrix, currentX, getY() + 3, colorSquareWidth, colorSquareHeight)
.round(Hud.getInstance().roundnessSetting.getValue())
.color(hudColor)
.build());

Fonts.getSize(30, Fonts.Type.LEGION).drawString(matrix, "A", currentX + 1.7, getY() + 7.5f, Color.WHITE.getRGB());

float potionsX = currentX + colorSquareWidth + spacing;
float potionsY = getY() + 3 + (colorSquareHeight - potionsSquareHeight) / 2;

blur.render(ShapeProperties.create(matrix, potionsX, potionsY, potionsSquareWidth, potionsSquareHeight)
.round(Hud.getInstance().roundnessSetting.getValue()).quality(15)
.color(new Color(0, 0, 0, 120).getRGB())
.build());

rectangle.render(ShapeProperties.create(matrix, potionsX, potionsY, potionsSquareWidth, potionsSquareHeight)
.round(Hud.getInstance().roundnessSetting.getValue())
.thickness(0.5f)
.outlineColor(new Color(255, 255, 255, 40).getRGB())
.color(hudColor, // Слева - цвет из HUD
new Color(25, 25, 30, 150).getRGB(),
new Color(25, 25, 30, 150).getRGB(), hudColor) // Слева - цвет из HUD .build());

float startX = potionsX + (potionsSquareWidth - totalContentWidth) / 2;
float centerY = potionsY + (potionsSquareHeight - Math.max(iconSize, textSize)) / 2 + 6;

Fonts.getSize((int)iconSize, Fonts.Type.USERS).drawString(matrix, "A", startX + -1f, centerY + 1.5f, hudColor);

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, hudColor);

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, hudColor);

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 + 1.5f, hudColor);

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();

String title = "Legion";

float colorSquareWidth = 18f;
float colorSquareHeight = 18f;
float spacing = 2f;
float potionsSquareHeight = 14f;
float iconSize = 16f;
float textSize = 13f;
float iconTextSpacing = 0.5f;

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 = userIconWidth + iconTextSpacing + textWidth + arrowWidth +
serverIconWidth + iconTextSpacing + serverIPWidth + arrowWidth +
pingIconWidth + iconTextSpacing + pingTextWidth + arrowWidth +
fpsIconWidth + iconTextSpacing + fpsTextWidth;

float potionsSquareWidth = totalContentWidth + 8f;

float totalWidth = colorSquareWidth + spacing + potionsSquareWidth + 6;
float totalHeight = Math.max(colorSquareHeight, potionsSquareHeight);

setWidth((int) totalWidth);
setHeight((int) totalHeight + 6);

float currentX = getX() + 3;

int hudColor = Color.WHITE.getRGB();
try {
if (Hud.getInstance() != null) {
hudColor = Hud.getInstance().colorSetting.getColor();
}
} catch (Exception ignored) {
}

rectangle.render(ShapeProperties.create(matrix, currentX, getY() + 3, colorSquareWidth, colorSquareHeight)
.round(Hud.getInstance().roundnessSetting.getValue())
.color(hudColor)
.build());

Fonts.getSize(30, Fonts.Type.LEGION).drawString(matrix, "A", currentX + 1.7, getY() + 7.5f, Color.WHITE.getRGB());

float potionsX = currentX + colorSquareWidth + spacing;
float potionsY = getY() + 3 + (colorSquareHeight - potionsSquareHeight) / 2;

blur.render(ShapeProperties.create(matrix, potionsX, potionsY, potionsSquareWidth, potionsSquareHeight)
.round(Hud.getInstance().roundnessSetting.getValue()).quality(15)
.color(new Color(0, 0, 0, 120).getRGB())
.build());

rectangle.render(ShapeProperties.create(matrix, potionsX, potionsY, potionsSquareWidth, potionsSquareHeight)
.round(Hud.getInstance().roundnessSetting.getValue())
.thickness(0.5f)
.outlineColor(new Color(255, 255, 255, 40).getRGB())
.color(hudColor, // Слева - цвет из HUD
new Color(25, 25, 30, 150).getRGB(),
new Color(25, 25, 30, 150).getRGB(), hudColor) // Слева - цвет из HUD .build());

float startX = potionsX + (potionsSquareWidth - totalContentWidth) / 2;
float centerY = potionsY + (potionsSquareHeight - Math.max(iconSize, textSize)) / 2 + 6;

Fonts.getSize((int)iconSize, Fonts.Type.USERS).drawString(matrix, "A", startX + -1f, centerY + 1.5f, hudColor);

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, hudColor);

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, hudColor);

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 + 1.5f, hudColor);

float fpsTextX = fpsIconX + fpsIconWidth + iconTextSpacing;
Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).drawString(matrix, fpsText,
fpsTextX, centerY + 0.7f, Color.WHITE.getRGB());
}
}
Ватермарка как в кряке дельты(фулл ии)
Ну +-, градиент вообще не смотрится как будто + иконку фпс выровняй, а то она сьехала куда то
1769338046413.png
 
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();

String title = "Legion";

float colorSquareWidth = 18f;
float colorSquareHeight = 18f;
float spacing = 2f;
float potionsSquareHeight = 14f;
float iconSize = 16f;
float textSize = 13f;
float iconTextSpacing = 0.5f;

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 = userIconWidth + iconTextSpacing + textWidth + arrowWidth +
serverIconWidth + iconTextSpacing + serverIPWidth + arrowWidth +
pingIconWidth + iconTextSpacing + pingTextWidth + arrowWidth +
fpsIconWidth + iconTextSpacing + fpsTextWidth;

float potionsSquareWidth = totalContentWidth + 8f;

float totalWidth = colorSquareWidth + spacing + potionsSquareWidth + 6;
float totalHeight = Math.max(colorSquareHeight, potionsSquareHeight);

setWidth((int) totalWidth);
setHeight((int) totalHeight + 6);

float currentX = getX() + 3;

int hudColor = Color.WHITE.getRGB();
try {
if (Hud.getInstance() != null) {
hudColor = Hud.getInstance().colorSetting.getColor();
}
} catch (Exception ignored) {
}

rectangle.render(ShapeProperties.create(matrix, currentX, getY() + 3, colorSquareWidth, colorSquareHeight)
.round(Hud.getInstance().roundnessSetting.getValue())
.color(hudColor)
.build());

Fonts.getSize(30, Fonts.Type.LEGION).drawString(matrix, "A", currentX + 1.7, getY() + 7.5f, Color.WHITE.getRGB());

float potionsX = currentX + colorSquareWidth + spacing;
float potionsY = getY() + 3 + (colorSquareHeight - potionsSquareHeight) / 2;

blur.render(ShapeProperties.create(matrix, potionsX, potionsY, potionsSquareWidth, potionsSquareHeight)
.round(Hud.getInstance().roundnessSetting.getValue()).quality(15)
.color(new Color(0, 0, 0, 120).getRGB())
.build());

rectangle.render(ShapeProperties.create(matrix, potionsX, potionsY, potionsSquareWidth, potionsSquareHeight)
.round(Hud.getInstance().roundnessSetting.getValue())
.thickness(0.5f)
.outlineColor(new Color(255, 255, 255, 40).getRGB())
.color(hudColor, // Слева - цвет из HUD
new Color(25, 25, 30, 150).getRGB(),
new Color(25, 25, 30, 150).getRGB(), hudColor) // Слева - цвет из HUD .build());

float startX = potionsX + (potionsSquareWidth - totalContentWidth) / 2;
float centerY = potionsY + (potionsSquareHeight - Math.max(iconSize, textSize)) / 2 + 6;

Fonts.getSize((int)iconSize, Fonts.Type.USERS).drawString(matrix, "A", startX + -1f, centerY + 1.5f, hudColor);

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, hudColor);

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, hudColor);

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 + 1.5f, hudColor);

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();

String title = "Legion";

float colorSquareWidth = 18f;
float colorSquareHeight = 18f;
float spacing = 2f;
float potionsSquareHeight = 14f;
float iconSize = 16f;
float textSize = 13f;
float iconTextSpacing = 0.5f;

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 = userIconWidth + iconTextSpacing + textWidth + arrowWidth +
serverIconWidth + iconTextSpacing + serverIPWidth + arrowWidth +
pingIconWidth + iconTextSpacing + pingTextWidth + arrowWidth +
fpsIconWidth + iconTextSpacing + fpsTextWidth;

float potionsSquareWidth = totalContentWidth + 8f;

float totalWidth = colorSquareWidth + spacing + potionsSquareWidth + 6;
float totalHeight = Math.max(colorSquareHeight, potionsSquareHeight);

setWidth((int) totalWidth);
setHeight((int) totalHeight + 6);

float currentX = getX() + 3;

int hudColor = Color.WHITE.getRGB();
try {
if (Hud.getInstance() != null) {
hudColor = Hud.getInstance().colorSetting.getColor();
}
} catch (Exception ignored) {
}

rectangle.render(ShapeProperties.create(matrix, currentX, getY() + 3, colorSquareWidth, colorSquareHeight)
.round(Hud.getInstance().roundnessSetting.getValue())
.color(hudColor)
.build());

Fonts.getSize(30, Fonts.Type.LEGION).drawString(matrix, "A", currentX + 1.7, getY() + 7.5f, Color.WHITE.getRGB());

float potionsX = currentX + colorSquareWidth + spacing;
float potionsY = getY() + 3 + (colorSquareHeight - potionsSquareHeight) / 2;

blur.render(ShapeProperties.create(matrix, potionsX, potionsY, potionsSquareWidth, potionsSquareHeight)
.round(Hud.getInstance().roundnessSetting.getValue()).quality(15)
.color(new Color(0, 0, 0, 120).getRGB())
.build());

rectangle.render(ShapeProperties.create(matrix, potionsX, potionsY, potionsSquareWidth, potionsSquareHeight)
.round(Hud.getInstance().roundnessSetting.getValue())
.thickness(0.5f)
.outlineColor(new Color(255, 255, 255, 40).getRGB())
.color(hudColor, // Слева - цвет из HUD
new Color(25, 25, 30, 150).getRGB(),
new Color(25, 25, 30, 150).getRGB(), hudColor) // Слева - цвет из HUD .build());

float startX = potionsX + (potionsSquareWidth - totalContentWidth) / 2;
float centerY = potionsY + (potionsSquareHeight - Math.max(iconSize, textSize)) / 2 + 6;

Fonts.getSize((int)iconSize, Fonts.Type.USERS).drawString(matrix, "A", startX + -1f, centerY + 1.5f, hudColor);

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, hudColor);

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, hudColor);

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 + 1.5f, hudColor);

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();

String title = "Legion";

float colorSquareWidth = 18f;
float colorSquareHeight = 18f;
float spacing = 2f;
float potionsSquareHeight = 14f;
float iconSize = 16f;
float textSize = 13f;
float iconTextSpacing = 0.5f;

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 = userIconWidth + iconTextSpacing + textWidth + arrowWidth +
serverIconWidth + iconTextSpacing + serverIPWidth + arrowWidth +
pingIconWidth + iconTextSpacing + pingTextWidth + arrowWidth +
fpsIconWidth + iconTextSpacing + fpsTextWidth;

float potionsSquareWidth = totalContentWidth + 8f;

float totalWidth = colorSquareWidth + spacing + potionsSquareWidth + 6;
float totalHeight = Math.max(colorSquareHeight, potionsSquareHeight);

setWidth((int) totalWidth);
setHeight((int) totalHeight + 6);

float currentX = getX() + 3;

int hudColor = Color.WHITE.getRGB();
try {
if (Hud.getInstance() != null) {
hudColor = Hud.getInstance().colorSetting.getColor();
}
} catch (Exception ignored) {
}

rectangle.render(ShapeProperties.create(matrix, currentX, getY() + 3, colorSquareWidth, colorSquareHeight)
.round(Hud.getInstance().roundnessSetting.getValue())
.color(hudColor)
.build());

Fonts.getSize(30, Fonts.Type.LEGION).drawString(matrix, "A", currentX + 1.7, getY() + 7.5f, Color.WHITE.getRGB());

float potionsX = currentX + colorSquareWidth + spacing;
float potionsY = getY() + 3 + (colorSquareHeight - potionsSquareHeight) / 2;

blur.render(ShapeProperties.create(matrix, potionsX, potionsY, potionsSquareWidth, potionsSquareHeight)
.round(Hud.getInstance().roundnessSetting.getValue()).quality(15)
.color(new Color(0, 0, 0, 120).getRGB())
.build());

rectangle.render(ShapeProperties.create(matrix, potionsX, potionsY, potionsSquareWidth, potionsSquareHeight)
.round(Hud.getInstance().roundnessSetting.getValue())
.thickness(0.5f)
.outlineColor(new Color(255, 255, 255, 40).getRGB())
.color(hudColor, // Слева - цвет из HUD
new Color(25, 25, 30, 150).getRGB(),
new Color(25, 25, 30, 150).getRGB(), hudColor) // Слева - цвет из HUD .build());

float startX = potionsX + (potionsSquareWidth - totalContentWidth) / 2;
float centerY = potionsY + (potionsSquareHeight - Math.max(iconSize, textSize)) / 2 + 6;

Fonts.getSize((int)iconSize, Fonts.Type.USERS).drawString(matrix, "A", startX + -1f, centerY + 1.5f, hudColor);

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, hudColor);

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, hudColor);

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 + 1.5f, hudColor);

float fpsTextX = fpsIconX + fpsIconWidth + iconTextSpacing;
Fonts.getSize((int)textSize, Fonts.Type.DEFAULT).drawString(matrix, fpsText,
fpsTextX, centerY + 0.7f, Color.WHITE.getRGB());
}
}
Ватермарка как в кряке дельты(фулл ии)
неплохо
 
Назад
Сверху Снизу