Начинающий
- Статус
- Оффлайн
- Регистрация
- 5 Окт 2025
- Сообщения
- 22
- Реакции
- 0
- Выберите загрузчик игры
- Прочие моды
Дарова югейм, решил вам написать ватермарку под Expensive 3.1
Она с дефолт импортами и пакетами.
Ее изи будет
ctrl + c и ctrl + v
SS:
DW:
Она с дефолт импортами и пакетами.
Ее изи будет
ctrl + c и ctrl + v
SS:
DW:
watermark:
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 net.minecraft.client.Minecraft;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.StringTextComponent;
public class WatermarkRenderer implements ElementRenderer {
/*
Created by "m3mentyd3ad"
ватермарк на 3.1
удачного пастинга
сори за говно код
*/
private long lastUpdateTime;
private int currentFps;
@Override
public void render(EventDisplay eventDisplay) {
MatrixStack ms = eventDisplay.getMatrixStack();
float posX = 4;
float posY = 4;
float padding = 6;
float fontSize = 8f;
updateFps();
String clientName = "Fenorium";
String version = "Release";
String fpsText = "FPS: " + currentFps;
float separatorWidth = Fonts.sfui.getWidth(" | ", fontSize);
float totalWidth1 = Fonts.sfui.getWidth(clientName, fontSize) +
separatorWidth +
Fonts.sfui.getWidth(version, fontSize) +
separatorWidth +
Fonts.sfui.getWidth(fpsText, fontSize) +
padding * 2;
float height = fontSize + padding;
DisplayUtils.drawRoundedRect(posX, posY, totalWidth1, height, 6, ColorUtils.rgba(30, 30, 40, 180));
float textX = posX + padding;
float textY = posY + height / 2 - fontSize / 2 + 1f;
Fonts.sfui.drawText(ms, new StringTextComponent(clientName), textX, textY, fontSize, ColorUtils.rgb(255, 255, 255));
textX += Fonts.sfui.getWidth(clientName, fontSize);
Fonts.sfui.drawText(ms, new StringTextComponent(" | "), textX, textY, fontSize, ColorUtils.rgb(150, 150, 150));
textX += separatorWidth;
Fonts.sfui.drawText(ms, new StringTextComponent(version), textX, textY, fontSize, ColorUtils.rgb(255, 255, 255));
textX += Fonts.sfui.getWidth(version, fontSize);
Fonts.sfui.drawText(ms, new StringTextComponent(" | "), textX, textY, fontSize, ColorUtils.rgba(150, 150, 150, 255));
textX += separatorWidth;
Fonts.sfui.drawText(ms, new StringTextComponent(fpsText), textX, textY, fontSize, ColorUtils.rgb(255, 255, 255));
if (Minecraft.getInstance().player != null) {
BlockPos playerPos = Minecraft.getInstance().player.getPosition();
String playerInfo = "POS: " + playerPos.getX() + " " + playerPos.getY() + " " + playerPos.getZ();
float totalWidth2 = Fonts.sfui.getWidth(playerInfo, fontSize) + padding * 2;
float posY2 = posY + height + 2;
DisplayUtils.drawRoundedRect(posX, posY2, totalWidth2, height, 6, ColorUtils.rgba(30, 30, 40, 180));
float textX2 = posX + padding;
float textY2 = posY2 + height / 2 - fontSize / 2 + 1f;
Fonts.sfui.drawText(ms, new StringTextComponent(playerInfo), textX2, textY2, fontSize, ColorUtils.rgb(255, 255, 255));
}
}
private void updateFps() {
long currentTime = System.currentTimeMillis();
if (currentTime - lastUpdateTime > 500) {
try {
currentFps = Minecraft.getInstance().debugFPS;
} catch (Exception e) {
currentFps = 60;
}
lastUpdateTime = currentTime;
}
}
}