Начинающий
Начинающий
- Статус
- Онлайн
- Регистрация
- 23 Мар 2025
- Сообщения
- 73
- Реакции
- 0
- Выберите загрузчик игры
- Fabric
Всем привет, вообщем было скучно, решил скачать еву что-то написать
гпт нету, код чистый и понятный
гпт нету, код чистый и понятный
Пожалуйста, авторизуйтесь для просмотра ссылки.
Код:
package sweetie.evaware.client.ui.widget.overlay;
import net.minecraft.client.util.math.MatrixStack;
import sweetie.evaware.api.system.backend.ClientInfo;
import sweetie.evaware.api.utils.color.UIColors;
import sweetie.evaware.api.utils.render.RenderUtil;
import sweetie.evaware.api.utils.render.fonts.Font;
import sweetie.evaware.client.ui.widget.Widget;
import java.awt.*;
public class WatermarkWidget extends Widget {
private float watermarkWidth = 0f;
@Override
public String getName() {
return "Watermark";
}
public WatermarkWidget() {
super(3f, 3f);
}
@Override
public void render(MatrixStack matrixStack) {
float x = getDraggable().getX();
float y = getDraggable().getY();
float gap = getGap();
float width = 0f;
float height = 0f;
float headSize = scaled(24f);
float headX = x;
Font font = getMediumFont();
float maxBarWidth = headSize * 2 - 6;
String armorcolvo = "" + mc.player.getArmor();
String armor = "ARMOR:";
float armorcolvoF = mc.player.getArmor();
float maxArmor = 20f;
float armorBarPercent = Math.clamp(armorcolvoF / maxArmor, 0f, 1f
);
float armorBarWidth = maxBarWidth * armorBarPercent;
String hpcolvo = "" + (int) mc.player.getHealth();
String hp = "HP:";
float maxHpColvo = (int) mc.player.getMaxHealth();
float hpcolvoF = (int) mc.player.getHealth();
float healthBarPercent = Math.max(0f, Math.min(1f, hpcolvoF / maxHpColvo));
float helathBarWidth = maxBarWidth * healthBarPercent;
//ARMOR
RenderUtil.BLUR_RECT.draw(matrixStack, x + headSize - 6, y + 4, headSize * 2 + 4f + font.getWidth(armor + armorcolvo, 6f), 8f, 2f, UIColors.widgetBlur());
RenderUtil.BLUR_RECT.draw(matrixStack, x + headSize, y + 6, maxBarWidth, 4f, 1f, new Color(14, 14, 14));
if (armorBarWidth > 0.5) {
RenderUtil.BLUR_RECT.draw(matrixStack, x + headSize, y + 6, armorBarWidth, 4f, 1f, new Color(58, 83, 129));
}
font.drawText(matrixStack, armor + armorcolvo, x + headSize * 3 - 4, y + 5.5f, 6, UIColors.textColor());
//HEALTH
RenderUtil.BLUR_RECT.draw(matrixStack, x + headSize - 6, y + 16, headSize * 2 + 4f + font.getWidth(hp + hpcolvo, 6), 8f, 2f, UIColors.widgetBlur());
RenderUtil.BLUR_RECT.draw(matrixStack, x + headSize, y + 18, headSize * 2 - 6, 4f, 1f, new Color(14, 14, 14));
if (helathBarWidth > 0.5f) {
RenderUtil.BLUR_RECT.draw(matrixStack, x + headSize, y + 18, helathBarWidth, 4f, 1f, new Color(47, 135, 55));
}
font.drawText(matrixStack, hp + hpcolvo, x + headSize * 3 - 4, y + 17.5f, 6, UIColors.textColor());
//HEAD
RenderUtil.BLUR_RECT.draw(matrixStack, x, y, headSize, headSize, 12f, UIColors.widgetBlur());
RenderUtil.TEXTURE_RECT.drawHead(matrixStack, mc.player, headX, y, headSize, headSize, getGap() / 2f, 11f, Color.WHITE);
width += headSize * 2 + 24f + font.getWidth(armor + armorcolvo, 6f) + gap;
height += headSize;
getDraggable().setWidth(width);
getDraggable().setHeight(height);
}
}