- Выберите загрузчик игры
- Прочие моды
Минималистическая ватермарка, если чтто то изменить то выйдет катлаван
ss(прикреп)
Код снизу
Моя первая работа, не закидуйте камнями
Шрифт можно не менять он и так подошел красиво вроде
ss(прикреп)
Код снизу
JavaScript:
package log.evcalipse.ui.display.impl;
import log.evcalipse.events.EventDisplay;
import log.evcalipse.modules.impl.render.Theme;
import log.evcalipse.ui.display.ElementRenderer;
import log.evcalipse.utils.animations.Animation;
import log.evcalipse.utils.animations.Direction;
import log.evcalipse.utils.animations.easing.CompactAnimation;
import log.evcalipse.utils.animations.easing.Easing;
import log.evcalipse.utils.animations.impl.DecelerateAnimation;
import log.evcalipse.utils.drag.Dragging;
import log.evcalipse.utils.render.color.ColorUtils;
import log.evcalipse.utils.render.font.Fonts;
import log.evcalipse.utils.render.rect.RenderUtility;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.Minecraft;
import net.minecraft.util.math.vector.Vector4f;
import org.lwjgl.opengl.GL11;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
public class WatermarkRenderer implements ElementRenderer {
private final Dragging dragging;
private final CompactAnimation widthAnimation = new CompactAnimation(Easing.EASE_OUT_QUART, 100);
private final CompactAnimation heightAnimation = new CompactAnimation(Easing.EASE_OUT_QUART, 100);
final Animation alphaAnimation = new DecelerateAnimation(300, 1, Direction.FORWARDS);
float width, height;
float animatedX = -1, animatedY = -1;
float dragSpeed = 0.15f;
boolean isFirstRender = true;
private final DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern("HH:mm");
private static final Minecraft mc = Minecraft.getInstance();
public WatermarkRenderer(Dragging dragging) {
this.dragging = dragging;
}
@Override
public void render(EventDisplay eventDisplay) {
MatrixStack ms = eventDisplay.getMatrixStack();
if (isFirstRender) {
animatedX = dragging.getX();
animatedY = dragging.getY();
isFirstRender = false;
}
float targetX = dragging.getX();
float targetY = dragging.getY();
if (Math.abs(targetX - animatedX) > 0.01f || Math.abs(targetY - animatedY) > 0.01f) {
animatedX += (targetX - animatedX) * dragSpeed;
animatedY += (targetY - animatedY) * dragSpeed;
if (Math.abs(targetX - animatedX) < 0.1f) animatedX = targetX;
dragging.setX(animatedX);
dragging.setY(animatedY);
}
float posX = animatedX, posY = animatedY;
float fontSize = 7.5f;
float padding = 4;
float rectHeight = 15;
float cornerRadius = 6;
float finalAlpha = (float) alphaAnimation.getOutput();
String infoText = String.format("Evcalipse | %d FPS | %d ms | %s",
mc.debugFPS,
getPing(),
getCurrentMskTime());
float textWidth = Fonts.sfuy.getWidth(infoText, fontSize);
float totalWidth = textWidth + 2 * padding;
widthAnimation.run(totalWidth);
heightAnimation.run(rectHeight);
width = (float) widthAnimation.getValue();
height = (float) heightAnimation.getValue();
int alpha = (int) (245 * finalAlpha);
alpha = Math.max(1, alpha);
int mainColor = ColorUtils.rgba(15, 15, 22, alpha);
int themeColor1 = Theme.MainColor(0);
mainColor = ColorUtils.interpolateColor(mainColor, themeColor1, 0.05f);
GL11.glPushMatrix();
GL11.glTranslatef(posX, posY, 0);
RenderUtility.drawRoundedRect(0, 0, width, height,
new Vector4f(cornerRadius, cornerRadius, cornerRadius, cornerRadius),
mainColor);
float textY = (rectHeight - fontSize) / 2;
Fonts.sfuy.drawText(ms, infoText, padding, textY,
ColorUtils.rgba(255, 255, 255, (int)(255 * finalAlpha)), fontSize);
GL11.glPopMatrix();
dragging.setWidth(width);
dragging.setHeight(height);
}
private int getPing() {
return mc.getConnection() != null ?
mc.getConnection().getPlayerInfo(mc.player.getUniqueID()).getResponseTime() : 0;
}
private String getCurrentMskTime() {
return ZonedDateTime.now(ZoneId.of("Europe/Moscow")).format(timeFormatter);
}
}
Шрифт можно не менять он и так подошел красиво вроде