Начинающий
- Статус
- Оффлайн
- Регистрация
- 31 Мар 2025
- Сообщения
- 10
- Реакции
- 0
- Выберите загрузчик игры
- Fabric
скиднул ватермарку нурсултана на евочку
есле што эта фулл ии патамушто ева любит вайбкод
SS:
есле што эта фулл ии патамушто ева любит вайбкод
SS:
WatermarkWidget:
package sweetie.evaware.client.ui.widget.overlay;
import net.minecraft.client.network.PlayerListEntry;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.network.packet.s2c.play.WorldTimeUpdateS2CPacket;
import sweetie.evaware.api.event.Listener;
import sweetie.evaware.api.event.events.client.PacketEvent;
import sweetie.evaware.api.utils.color.UIColors;
import sweetie.evaware.api.utils.math.MathUtil;
import sweetie.evaware.api.utils.render.RenderUtil;
import sweetie.evaware.api.utils.render.fonts.Font;
import sweetie.evaware.api.utils.render.fonts.Fonts;
import sweetie.evaware.client.ui.widget.Widget;
import java.awt.*;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.Locale;
public class WatermarkWidget extends Widget {
private static final DateTimeFormatter TIME_FORMATTER = DateTimeFormatter.ofPattern("HH:mm:ss");
private static final Color SEPARATOR_COLOR = new Color(220, 220, 220, 115);
private float animFps;
private double tps = 20.0;
private long lastTimePacket = -1L;
@Override
public String getName() {
return "Watermark";
}
public WatermarkWidget() {
super(3f, 3f);
PacketEvent.getInstance().subscribe(new Listener<>(this::handlePacketEvent));
}
@Override
public void render(MatrixStack matrixStack) {
if (mc.player == null) return;
float x = getDraggable().getX();
float y = getDraggable().getY();
float gap = getGap() * 0.78f;
float boxHeight = scaled(13.5f);
float topBoxWidth = scaled(14f);
float bottomBoxWidth = scaled(13.2f);
float radius = scaled(3f);
drawIconBox(matrixStack, x, y, topBoxWidth, boxHeight, radius, "P");
float topRowWidth = drawTopRow(matrixStack, x + topBoxWidth + gap, y, boxHeight, radius);
float bottomY = y + boxHeight + gap;
drawIconBox(matrixStack, x, bottomY, bottomBoxWidth, boxHeight, radius, "U");
float bottomRowX = x + bottomBoxWidth + gap;
float bottomRowWidth = 0f;
bottomRowWidth += drawInfoPill(matrixStack, bottomRowX + bottomRowWidth, bottomY, boxHeight, radius, "Q", getPingText());
bottomRowWidth += gap;
bottomRowWidth += drawInfoPill(matrixStack, bottomRowX + bottomRowWidth, bottomY, boxHeight, radius, "$", getTpsText());
bottomRowWidth += gap;
bottomRowWidth += drawInfoPill(matrixStack, bottomRowX + bottomRowWidth, bottomY, boxHeight, radius, "@", getBpsText());
float topWidth = topBoxWidth + gap + topRowWidth;
float bottomWidth = bottomBoxWidth + gap + bottomRowWidth;
getDraggable().setWidth(Math.max(topWidth, bottomWidth));
getDraggable().setHeight(boxHeight * 2f + gap);
}
private void handlePacketEvent(PacketEvent.PacketEventData event) {
if (!event.isReceive() || !(event.packet() instanceof WorldTimeUpdateS2CPacket)) return;
long now = System.currentTimeMillis();
if (lastTimePacket > 0L) {
long delay = now - lastTimePacket;
if (delay > 0L) {
tps = Math.min(20.0, Math.max(0.0, 20000.0 / delay));
}
}
lastTimePacket = now;
}
private float drawTopRow(MatrixStack matrixStack, float x, float y, float height, float radius) {
Font iconFont = Fonts.NUR_ICONS;
Font textFont = Fonts.SF_BOLD;
float iconSize = scaled(6.8f);
float textSize = scaled(6.1f);
float padding = scaled(3.3f);
float innerGap = scaled(2f);
float separatorGap = scaled(2.5f);
String username = mc.getSession().getUsername();
String fps = getFpsText();
String time = LocalTime.now().format(TIME_FORMATTER);
float width = padding * 2f
+ iconFont.getWidth("W", iconSize) + innerGap
+ textFont.getWidth(username, textSize) + separatorGap
+ textFont.getWidth("|", textSize) + separatorGap
+ iconFont.getWidth("X", iconSize) + innerGap
+ textFont.getWidth(fps, textSize) + separatorGap
+ textFont.getWidth("|", textSize) + separatorGap
+ iconFont.getWidth("V", iconSize) + innerGap
+ textFont.getWidth(time, textSize);
RenderUtil.BLUR_RECT.draw(matrixStack, x, y, width, height, radius, UIColors.widgetBlur());
float textY = y + (height - textSize) / 2f;
float iconY = y + (height - iconSize) / 2f;
float offset = x + padding;
iconFont.drawText(matrixStack, "W", offset, iconY, iconSize, UIColors.primary());
offset += iconFont.getWidth("W", iconSize) + innerGap;
textFont.drawText(matrixStack, username, offset, textY, textSize, UIColors.textColor());
offset += textFont.getWidth(username, textSize) + separatorGap;
offset = drawSeparator(matrixStack, offset, textY, textSize) + separatorGap;
iconFont.drawText(matrixStack, "X", offset, iconY, iconSize, UIColors.primary());
offset += iconFont.getWidth("X", iconSize) + innerGap;
textFont.drawText(matrixStack, fps, offset, textY, textSize, UIColors.textColor());
offset += textFont.getWidth(fps, textSize) + separatorGap;
offset = drawSeparator(matrixStack, offset, textY, textSize) + separatorGap;
iconFont.drawText(matrixStack, "V", offset, iconY, iconSize, UIColors.primary());
offset += iconFont.getWidth("V", iconSize) + innerGap;
textFont.drawText(matrixStack, time, offset, textY, textSize, UIColors.textColor());
return width;
}
private float drawInfoPill(MatrixStack matrixStack, float x, float y, float height, float radius, String icon, String value) {
Font iconFont = Fonts.NUR_ICONS;
Font textFont = Fonts.SF_BOLD;
float iconSize = scaled(6.8f);
float textSize = scaled(6.1f);
float padding = scaled(3.3f);
float innerGap = scaled(2f);
float width = padding * 2f
+ iconFont.getWidth(icon, iconSize) + innerGap
+ textFont.getWidth("|", textSize) + innerGap
+ textFont.getWidth(value, textSize);
RenderUtil.BLUR_RECT.draw(matrixStack, x, y, width, height, radius, UIColors.widgetBlur());
float textY = y + (height - textSize) / 2f;
float iconY = y + (height - iconSize) / 2f;
float offset = x + padding;
iconFont.drawText(matrixStack, icon, offset, iconY, iconSize, UIColors.primary());
offset += iconFont.getWidth(icon, iconSize) + innerGap;
offset = drawSeparator(matrixStack, offset, textY, textSize) + innerGap;
textFont.drawText(matrixStack, value, offset, textY, textSize, UIColors.textColor());
return width;
}
private void drawIconBox(MatrixStack matrixStack, float x, float y, float width, float height, float radius, String icon) {
Font iconFont = Fonts.NUR_ICONS;
float iconSize = scaled(7.2f);
RenderUtil.BLUR_RECT.draw(matrixStack, x, y, width, height, radius, UIColors.widgetBlur());
iconFont.drawCenteredGradientText(matrixStack, icon, x + width / 2f - scaled(0.55f), y + (height - iconSize) / 2f, iconSize, UIColors.primary(), UIColors.secondary(), width);
}
private float drawSeparator(MatrixStack matrixStack, float x, float y, float size) {
Font font = Fonts.SF_BOLD;
font.drawText(matrixStack, "|", x, y, size, SEPARATOR_COLOR);
return x + font.getWidth("|", size);
}
private String getFpsText() {
animFps = MathUtil.interpolate((int) animFps, mc.getCurrentFps(), 0.2f);
return (int) animFps + " Fps";
}
private String getPingText() {
int ping = 0;
if (mc.getNetworkHandler() != null) {
for (PlayerListEntry entry : mc.getNetworkHandler().getPlayerList()) {
if (entry.getProfile().getId().equals(mc.player.getUuid())) {
ping = entry.getLatency();
break;
}
}
}
return ping + " Ping";
}
private String getTpsText() {
return String.format(Locale.US, "%.1f Ticks", tps);
}
private String getBpsText() {
return String.format(Locale.US, "%.1f Bps", MathUtil.getEntityBPS(mc.player));
}
}