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

Визуальная часть WatermarkRenderer | exp 3.1

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
12 Мар 2026
Сообщения
8
Реакции
0
Выберите загрузчик игры
  1. Vanilla
  2. OptiFine
Сделал вроде +- норм вотермарку ( как для дурака ), может кому то надо - берите, пишите, если что-то мб поменять или добавить
Не обращайся внимания на иконки, я просто немного дурак

SS -
1773499080226.png


Code -
WatermarkRenderer:
Expand Collapse Copy
package im.expensive.ui.display.impl;

import com.mojang.blaze3d.matrix.MatrixStack;
import im.expensive.events.EventDisplay;
import im.expensive.ui.display.ElementRenderer;
import im.expensive.utils.render.ColorUtils;
import im.expensive.utils.render.DisplayUtils;
import im.expensive.utils.render.font.Fonts;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.experimental.FieldDefaults;
import net.minecraft.client.network.play.NetworkPlayerInfo;
import net.minecraft.util.ResourceLocation;

@FieldDefaults(level = AccessLevel.PRIVATE)
@RequiredArgsConstructor
public class WatermarkRenderer implements ElementRenderer {

    final ResourceLocation logo = new ResourceLocation("expensive/images/hud/logo.png");
    final ResourceLocation user = new ResourceLocation("expensive/images/hud/user.png");
    final ResourceLocation display = new ResourceLocation("expensive/images/hud/display.png");
    final ResourceLocation signal = new ResourceLocation("expensive/images/hud/signal.png");
    final ResourceLocation compass = new ResourceLocation("expensive/images/hud/compass.png");

    @Override
    public void render(EventDisplay eventDisplay) {
        if (mc.player == null) return;

        MatrixStack ms = eventDisplay.getMatrixStack();

        float posX = 4;
        float posY = 4;
        float fontSize = 7.5f;
        float iconSize = 9;

        int mainBg = ColorUtils.rgba(10, 10, 10, 140);
        int boxBg = ColorUtils.rgba(25, 25, 25, 170);
        int accent = ColorUtils.rgba(255, 255, 255, 255);
        int textC = ColorUtils.rgba(245, 245, 245, 255);
        int darkC = ColorUtils.rgba(20, 20, 20, 255);

        String userName = mc.getSession().getUsername();
        String fpsStr = String.valueOf(mc.getDebugFPS());

        int ping = 0;
        if (mc.getConnection() != null) {
            NetworkPlayerInfo info = mc.getConnection().getPlayerInfo(mc.player.getUniqueID());
            if (info != null) ping = info.getResponseTime();
        }
        String pingStr = ping + " ms";

        int px = (int) mc.player.getPosX();
        int py = (int) mc.player.getPosY();
        int pz = (int) mc.player.getPosZ();
        String coordsStr = px + ", " + py + ", " + pz;

        float innerPad = 6;
        float gap = 5;
        float outerPad = 4;
        float boxH = 20;

        float userW = innerPad * 2 + iconSize + 4 + Fonts.sfui.getWidth(userName, fontSize);
        float fpsW = innerPad * 2 + iconSize + 3 + Fonts.sfui.getWidth(fpsStr, fontSize) + Fonts.sfui.getWidth("fps", fontSize);
        float pingW = innerPad * 2 + iconSize + 4 + Fonts.sfui.getWidth(pingStr, fontSize);
        float coordsW = innerPad * 2 + iconSize + 4 + Fonts.sfui.getWidth(coordsStr, fontSize);

        float totalW = outerPad * 2 + boxH + gap + userW + gap + fpsW + gap + pingW + gap + coordsW;
        float totalH = boxH + outerPad * 2;

        DisplayUtils.drawShadow(posX, posY, totalW, totalH, 15, ColorUtils.rgba(0, 0, 0, 120), ColorUtils.rgba(0, 0, 0, 120));
        DisplayUtils.drawRoundedRect(posX, posY, totalW, totalH, totalH / 2f, mainBg);

        float currentX = posX + outerPad;
        float currentY = posY + outerPad;
        float textY = currentY + 6.5f;
        float iconY = currentY + (boxH - iconSize) / 2f;

        DisplayUtils.drawRoundedRect(currentX, currentY, boxH, boxH, 6, boxBg);
        DisplayUtils.drawImage(logo, currentX + (boxH - iconSize) / 2f, iconY, iconSize, iconSize, accent);
        currentX += boxH + gap;

        DisplayUtils.drawRoundedRect(currentX, currentY, userW, boxH, 6, boxBg);
        DisplayUtils.drawImage(user, currentX + innerPad, iconY, iconSize, iconSize, accent);
        Fonts.sfui.drawText(ms, userName, currentX + innerPad + iconSize + 4, textY, textC, fontSize);
        currentX += userW + gap;

        DisplayUtils.drawRoundedRect(currentX, currentY, fpsW, boxH, 6, boxBg);
        DisplayUtils.drawImage(display, currentX + innerPad, iconY, iconSize, iconSize, accent);
        float fpsNumW = Fonts.sfui.getWidth(fpsStr, fontSize);
        Fonts.sfui.drawText(ms, fpsStr, currentX + innerPad + iconSize + 3, textY, textC, fontSize);
        Fonts.sfui.drawText(ms, "fps", currentX + innerPad + iconSize + 3 + fpsNumW, textY, ColorUtils.rgba(180, 180, 180, 255), fontSize);
        currentX += fpsW + gap;

        DisplayUtils.drawRoundedRect(currentX, currentY, pingW, boxH, 6, boxBg);
        DisplayUtils.drawImage(signal, currentX + innerPad, iconY, iconSize, iconSize, accent);
        Fonts.sfui.drawText(ms, pingStr, currentX + innerPad + iconSize + 4, textY, textC, fontSize);
        currentX += pingW + gap;

        DisplayUtils.drawRoundedRect(currentX, currentY, coordsW, boxH, 6, boxBg);
        DisplayUtils.drawImage(compass, currentX + innerPad, iconY, iconSize, iconSize, accent);
        Fonts.sfui.drawText(ms, coordsStr, currentX + innerPad + iconSize + 4, textY, textC, fontSize);
    }
}
 
Сделал вроде +- норм вотермарку ( как для дурака ), может кому то надо - берите, пишите, если что-то мб поменять или добавить
Не обращайся внимания на иконки, я просто немного дурак

SS - Посмотреть вложение 330305

Code -
WatermarkRenderer:
Expand Collapse Copy
package im.expensive.ui.display.impl;

import com.mojang.blaze3d.matrix.MatrixStack;
import im.expensive.events.EventDisplay;
import im.expensive.ui.display.ElementRenderer;
import im.expensive.utils.render.ColorUtils;
import im.expensive.utils.render.DisplayUtils;
import im.expensive.utils.render.font.Fonts;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.experimental.FieldDefaults;
import net.minecraft.client.network.play.NetworkPlayerInfo;
import net.minecraft.util.ResourceLocation;

@FieldDefaults(level = AccessLevel.PRIVATE)
@RequiredArgsConstructor
public class WatermarkRenderer implements ElementRenderer {

    final ResourceLocation logo = new ResourceLocation("expensive/images/hud/logo.png");
    final ResourceLocation user = new ResourceLocation("expensive/images/hud/user.png");
    final ResourceLocation display = new ResourceLocation("expensive/images/hud/display.png");
    final ResourceLocation signal = new ResourceLocation("expensive/images/hud/signal.png");
    final ResourceLocation compass = new ResourceLocation("expensive/images/hud/compass.png");

    @Override
    public void render(EventDisplay eventDisplay) {
        if (mc.player == null) return;

        MatrixStack ms = eventDisplay.getMatrixStack();

        float posX = 4;
        float posY = 4;
        float fontSize = 7.5f;
        float iconSize = 9;

        int mainBg = ColorUtils.rgba(10, 10, 10, 140);
        int boxBg = ColorUtils.rgba(25, 25, 25, 170);
        int accent = ColorUtils.rgba(255, 255, 255, 255);
        int textC = ColorUtils.rgba(245, 245, 245, 255);
        int darkC = ColorUtils.rgba(20, 20, 20, 255);

        String userName = mc.getSession().getUsername();
        String fpsStr = String.valueOf(mc.getDebugFPS());

        int ping = 0;
        if (mc.getConnection() != null) {
            NetworkPlayerInfo info = mc.getConnection().getPlayerInfo(mc.player.getUniqueID());
            if (info != null) ping = info.getResponseTime();
        }
        String pingStr = ping + " ms";

        int px = (int) mc.player.getPosX();
        int py = (int) mc.player.getPosY();
        int pz = (int) mc.player.getPosZ();
        String coordsStr = px + ", " + py + ", " + pz;

        float innerPad = 6;
        float gap = 5;
        float outerPad = 4;
        float boxH = 20;

        float userW = innerPad * 2 + iconSize + 4 + Fonts.sfui.getWidth(userName, fontSize);
        float fpsW = innerPad * 2 + iconSize + 3 + Fonts.sfui.getWidth(fpsStr, fontSize) + Fonts.sfui.getWidth("fps", fontSize);
        float pingW = innerPad * 2 + iconSize + 4 + Fonts.sfui.getWidth(pingStr, fontSize);
        float coordsW = innerPad * 2 + iconSize + 4 + Fonts.sfui.getWidth(coordsStr, fontSize);

        float totalW = outerPad * 2 + boxH + gap + userW + gap + fpsW + gap + pingW + gap + coordsW;
        float totalH = boxH + outerPad * 2;

        DisplayUtils.drawShadow(posX, posY, totalW, totalH, 15, ColorUtils.rgba(0, 0, 0, 120), ColorUtils.rgba(0, 0, 0, 120));
        DisplayUtils.drawRoundedRect(posX, posY, totalW, totalH, totalH / 2f, mainBg);

        float currentX = posX + outerPad;
        float currentY = posY + outerPad;
        float textY = currentY + 6.5f;
        float iconY = currentY + (boxH - iconSize) / 2f;

        DisplayUtils.drawRoundedRect(currentX, currentY, boxH, boxH, 6, boxBg);
        DisplayUtils.drawImage(logo, currentX + (boxH - iconSize) / 2f, iconY, iconSize, iconSize, accent);
        currentX += boxH + gap;

        DisplayUtils.drawRoundedRect(currentX, currentY, userW, boxH, 6, boxBg);
        DisplayUtils.drawImage(user, currentX + innerPad, iconY, iconSize, iconSize, accent);
        Fonts.sfui.drawText(ms, userName, currentX + innerPad + iconSize + 4, textY, textC, fontSize);
        currentX += userW + gap;

        DisplayUtils.drawRoundedRect(currentX, currentY, fpsW, boxH, 6, boxBg);
        DisplayUtils.drawImage(display, currentX + innerPad, iconY, iconSize, iconSize, accent);
        float fpsNumW = Fonts.sfui.getWidth(fpsStr, fontSize);
        Fonts.sfui.drawText(ms, fpsStr, currentX + innerPad + iconSize + 3, textY, textC, fontSize);
        Fonts.sfui.drawText(ms, "fps", currentX + innerPad + iconSize + 3 + fpsNumW, textY, ColorUtils.rgba(180, 180, 180, 255), fontSize);
        currentX += fpsW + gap;

        DisplayUtils.drawRoundedRect(currentX, currentY, pingW, boxH, 6, boxBg);
        DisplayUtils.drawImage(signal, currentX + innerPad, iconY, iconSize, iconSize, accent);
        Fonts.sfui.drawText(ms, pingStr, currentX + innerPad + iconSize + 4, textY, textC, fontSize);
        currentX += pingW + gap;

        DisplayUtils.drawRoundedRect(currentX, currentY, coordsW, boxH, 6, boxBg);
        DisplayUtils.drawImage(compass, currentX + innerPad, iconY, iconSize, iconSize, accent);
        Fonts.sfui.drawText(ms, coordsStr, currentX + innerPad + iconSize + 4, textY, textC, fontSize);
    }
}
не плохо кстати
 
Сделал вроде +- норм вотермарку ( как для дурака ), может кому то надо - берите, пишите, если что-то мб поменять или добавить
Не обращайся внимания на иконки, я просто немного дурак

SS - Посмотреть вложение 330305

Code -
WatermarkRenderer:
Expand Collapse Copy
package im.expensive.ui.display.impl;

import com.mojang.blaze3d.matrix.MatrixStack;
import im.expensive.events.EventDisplay;
import im.expensive.ui.display.ElementRenderer;
import im.expensive.utils.render.ColorUtils;
import im.expensive.utils.render.DisplayUtils;
import im.expensive.utils.render.font.Fonts;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.experimental.FieldDefaults;
import net.minecraft.client.network.play.NetworkPlayerInfo;
import net.minecraft.util.ResourceLocation;

@FieldDefaults(level = AccessLevel.PRIVATE)
@RequiredArgsConstructor
public class WatermarkRenderer implements ElementRenderer {

    final ResourceLocation logo = new ResourceLocation("expensive/images/hud/logo.png");
    final ResourceLocation user = new ResourceLocation("expensive/images/hud/user.png");
    final ResourceLocation display = new ResourceLocation("expensive/images/hud/display.png");
    final ResourceLocation signal = new ResourceLocation("expensive/images/hud/signal.png");
    final ResourceLocation compass = new ResourceLocation("expensive/images/hud/compass.png");

    @Override
    public void render(EventDisplay eventDisplay) {
        if (mc.player == null) return;

        MatrixStack ms = eventDisplay.getMatrixStack();

        float posX = 4;
        float posY = 4;
        float fontSize = 7.5f;
        float iconSize = 9;

        int mainBg = ColorUtils.rgba(10, 10, 10, 140);
        int boxBg = ColorUtils.rgba(25, 25, 25, 170);
        int accent = ColorUtils.rgba(255, 255, 255, 255);
        int textC = ColorUtils.rgba(245, 245, 245, 255);
        int darkC = ColorUtils.rgba(20, 20, 20, 255);

        String userName = mc.getSession().getUsername();
        String fpsStr = String.valueOf(mc.getDebugFPS());

        int ping = 0;
        if (mc.getConnection() != null) {
            NetworkPlayerInfo info = mc.getConnection().getPlayerInfo(mc.player.getUniqueID());
            if (info != null) ping = info.getResponseTime();
        }
        String pingStr = ping + " ms";

        int px = (int) mc.player.getPosX();
        int py = (int) mc.player.getPosY();
        int pz = (int) mc.player.getPosZ();
        String coordsStr = px + ", " + py + ", " + pz;

        float innerPad = 6;
        float gap = 5;
        float outerPad = 4;
        float boxH = 20;

        float userW = innerPad * 2 + iconSize + 4 + Fonts.sfui.getWidth(userName, fontSize);
        float fpsW = innerPad * 2 + iconSize + 3 + Fonts.sfui.getWidth(fpsStr, fontSize) + Fonts.sfui.getWidth("fps", fontSize);
        float pingW = innerPad * 2 + iconSize + 4 + Fonts.sfui.getWidth(pingStr, fontSize);
        float coordsW = innerPad * 2 + iconSize + 4 + Fonts.sfui.getWidth(coordsStr, fontSize);

        float totalW = outerPad * 2 + boxH + gap + userW + gap + fpsW + gap + pingW + gap + coordsW;
        float totalH = boxH + outerPad * 2;

        DisplayUtils.drawShadow(posX, posY, totalW, totalH, 15, ColorUtils.rgba(0, 0, 0, 120), ColorUtils.rgba(0, 0, 0, 120));
        DisplayUtils.drawRoundedRect(posX, posY, totalW, totalH, totalH / 2f, mainBg);

        float currentX = posX + outerPad;
        float currentY = posY + outerPad;
        float textY = currentY + 6.5f;
        float iconY = currentY + (boxH - iconSize) / 2f;

        DisplayUtils.drawRoundedRect(currentX, currentY, boxH, boxH, 6, boxBg);
        DisplayUtils.drawImage(logo, currentX + (boxH - iconSize) / 2f, iconY, iconSize, iconSize, accent);
        currentX += boxH + gap;

        DisplayUtils.drawRoundedRect(currentX, currentY, userW, boxH, 6, boxBg);
        DisplayUtils.drawImage(user, currentX + innerPad, iconY, iconSize, iconSize, accent);
        Fonts.sfui.drawText(ms, userName, currentX + innerPad + iconSize + 4, textY, textC, fontSize);
        currentX += userW + gap;

        DisplayUtils.drawRoundedRect(currentX, currentY, fpsW, boxH, 6, boxBg);
        DisplayUtils.drawImage(display, currentX + innerPad, iconY, iconSize, iconSize, accent);
        float fpsNumW = Fonts.sfui.getWidth(fpsStr, fontSize);
        Fonts.sfui.drawText(ms, fpsStr, currentX + innerPad + iconSize + 3, textY, textC, fontSize);
        Fonts.sfui.drawText(ms, "fps", currentX + innerPad + iconSize + 3 + fpsNumW, textY, ColorUtils.rgba(180, 180, 180, 255), fontSize);
        currentX += fpsW + gap;

        DisplayUtils.drawRoundedRect(currentX, currentY, pingW, boxH, 6, boxBg);
        DisplayUtils.drawImage(signal, currentX + innerPad, iconY, iconSize, iconSize, accent);
        Fonts.sfui.drawText(ms, pingStr, currentX + innerPad + iconSize + 4, textY, textC, fontSize);
        currentX += pingW + gap;

        DisplayUtils.drawRoundedRect(currentX, currentY, coordsW, boxH, 6, boxBg);
        DisplayUtils.drawImage(compass, currentX + innerPad, iconY, iconSize, iconSize, accent);
        Fonts.sfui.drawText(ms, coordsStr, currentX + innerPad + iconSize + 4, textY, textC, fontSize);
    }
}
Это пиздец
 
Сделал вроде +- норм вотермарку ( как для дурака ), может кому то надо - берите, пишите, если что-то мб поменять или добавить
Не обращайся внимания на иконки, я просто немного дурак

SS - Посмотреть вложение 330305

Code -
WatermarkRenderer:
Expand Collapse Copy
package im.expensive.ui.display.impl;

import com.mojang.blaze3d.matrix.MatrixStack;
import im.expensive.events.EventDisplay;
import im.expensive.ui.display.ElementRenderer;
import im.expensive.utils.render.ColorUtils;
import im.expensive.utils.render.DisplayUtils;
import im.expensive.utils.render.font.Fonts;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.experimental.FieldDefaults;
import net.minecraft.client.network.play.NetworkPlayerInfo;
import net.minecraft.util.ResourceLocation;

@FieldDefaults(level = AccessLevel.PRIVATE)
@RequiredArgsConstructor
public class WatermarkRenderer implements ElementRenderer {

    final ResourceLocation logo = new ResourceLocation("expensive/images/hud/logo.png");
    final ResourceLocation user = new ResourceLocation("expensive/images/hud/user.png");
    final ResourceLocation display = new ResourceLocation("expensive/images/hud/display.png");
    final ResourceLocation signal = new ResourceLocation("expensive/images/hud/signal.png");
    final ResourceLocation compass = new ResourceLocation("expensive/images/hud/compass.png");

    @Override
    public void render(EventDisplay eventDisplay) {
        if (mc.player == null) return;

        MatrixStack ms = eventDisplay.getMatrixStack();

        float posX = 4;
        float posY = 4;
        float fontSize = 7.5f;
        float iconSize = 9;

        int mainBg = ColorUtils.rgba(10, 10, 10, 140);
        int boxBg = ColorUtils.rgba(25, 25, 25, 170);
        int accent = ColorUtils.rgba(255, 255, 255, 255);
        int textC = ColorUtils.rgba(245, 245, 245, 255);
        int darkC = ColorUtils.rgba(20, 20, 20, 255);

        String userName = mc.getSession().getUsername();
        String fpsStr = String.valueOf(mc.getDebugFPS());

        int ping = 0;
        if (mc.getConnection() != null) {
            NetworkPlayerInfo info = mc.getConnection().getPlayerInfo(mc.player.getUniqueID());
            if (info != null) ping = info.getResponseTime();
        }
        String pingStr = ping + " ms";

        int px = (int) mc.player.getPosX();
        int py = (int) mc.player.getPosY();
        int pz = (int) mc.player.getPosZ();
        String coordsStr = px + ", " + py + ", " + pz;

        float innerPad = 6;
        float gap = 5;
        float outerPad = 4;
        float boxH = 20;

        float userW = innerPad * 2 + iconSize + 4 + Fonts.sfui.getWidth(userName, fontSize);
        float fpsW = innerPad * 2 + iconSize + 3 + Fonts.sfui.getWidth(fpsStr, fontSize) + Fonts.sfui.getWidth("fps", fontSize);
        float pingW = innerPad * 2 + iconSize + 4 + Fonts.sfui.getWidth(pingStr, fontSize);
        float coordsW = innerPad * 2 + iconSize + 4 + Fonts.sfui.getWidth(coordsStr, fontSize);

        float totalW = outerPad * 2 + boxH + gap + userW + gap + fpsW + gap + pingW + gap + coordsW;
        float totalH = boxH + outerPad * 2;

        DisplayUtils.drawShadow(posX, posY, totalW, totalH, 15, ColorUtils.rgba(0, 0, 0, 120), ColorUtils.rgba(0, 0, 0, 120));
        DisplayUtils.drawRoundedRect(posX, posY, totalW, totalH, totalH / 2f, mainBg);

        float currentX = posX + outerPad;
        float currentY = posY + outerPad;
        float textY = currentY + 6.5f;
        float iconY = currentY + (boxH - iconSize) / 2f;

        DisplayUtils.drawRoundedRect(currentX, currentY, boxH, boxH, 6, boxBg);
        DisplayUtils.drawImage(logo, currentX + (boxH - iconSize) / 2f, iconY, iconSize, iconSize, accent);
        currentX += boxH + gap;

        DisplayUtils.drawRoundedRect(currentX, currentY, userW, boxH, 6, boxBg);
        DisplayUtils.drawImage(user, currentX + innerPad, iconY, iconSize, iconSize, accent);
        Fonts.sfui.drawText(ms, userName, currentX + innerPad + iconSize + 4, textY, textC, fontSize);
        currentX += userW + gap;

        DisplayUtils.drawRoundedRect(currentX, currentY, fpsW, boxH, 6, boxBg);
        DisplayUtils.drawImage(display, currentX + innerPad, iconY, iconSize, iconSize, accent);
        float fpsNumW = Fonts.sfui.getWidth(fpsStr, fontSize);
        Fonts.sfui.drawText(ms, fpsStr, currentX + innerPad + iconSize + 3, textY, textC, fontSize);
        Fonts.sfui.drawText(ms, "fps", currentX + innerPad + iconSize + 3 + fpsNumW, textY, ColorUtils.rgba(180, 180, 180, 255), fontSize);
        currentX += fpsW + gap;

        DisplayUtils.drawRoundedRect(currentX, currentY, pingW, boxH, 6, boxBg);
        DisplayUtils.drawImage(signal, currentX + innerPad, iconY, iconSize, iconSize, accent);
        Fonts.sfui.drawText(ms, pingStr, currentX + innerPad + iconSize + 4, textY, textC, fontSize);
        currentX += pingW + gap;

        DisplayUtils.drawRoundedRect(currentX, currentY, coordsW, boxH, 6, boxBg);
        DisplayUtils.drawImage(compass, currentX + innerPad, iconY, iconSize, iconSize, accent);
        Fonts.sfui.drawText(ms, coordsStr, currentX + innerPad + iconSize + 4, textY, textC, fontSize);
    }
}
это пиздец
 
Назад
Сверху Снизу