Начинающий
- Статус
- Оффлайн
- Регистрация
- 31 Авг 2024
- Сообщения
- 16
- Реакции
- 0
как заренеймить название в ватермаркеМне нечего было делать да и ваще я вайбкодер которому лишь бы базочку на фабрик хорошую и чатгпт,
кому надо возьмут и доделают остальное
SS - Посмотреть вложение 324881
WaterMark:
WaterMark: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.client.ui.widget.Widget; import java.awt.Color; import java.time.LocalTime; import java.time.format.DateTimeFormatter; public class WatermarkWidget extends Widget { public WatermarkWidget() { super(4f, 4f); } @Override public String getName() { return "Watermark"; } @Override public void render(MatrixStack ms) { float x = getDraggable().getX(), y = getDraggable().getY(), h = scaled(18), p = scaled(5), gap = scaled(3); String ver = "v3 1.21.4", fps = mc.getCurrentFps() + " FPS", time = LocalTime.now().format(DateTimeFormatter.ofPattern("HH:mm:ss")), sep = "|"; Color bg = new Color(12, 12, 18, 240), sepC = new Color(150, 150, 150); float fS = scaled(8), headS = scaled(13); float wName = getSemiBoldFont().getWidth(ClientInfo.NAME, fS), wVer = getMediumFont().getWidth(ver, fS); float wSep = getMediumFont().getWidth(sep, fS), wUser = getSemiBoldFont().getWidth(mc.getSession().getUsername(), fS); float wFps = getMediumFont().getWidth(fps, fS), wTime = getMediumFont().getWidth(time, fS); float w1 = p + wName + p + wVer + p; RenderUtil.BLUR_RECT.draw(ms, x, y, w1, h, 2, bg); getSemiBoldFont().drawGradientText(ms, ClientInfo.NAME, x + p, y + h/2 - fS/2 + 1, fS, UIColors.primary(), UIColors.secondary(), wName); getMediumFont().drawText(ms, ver, x + p + wName + p, y + h/2 - fS/2 + 1, fS, sepC); float x2 = x + w1 + gap; float w2 = p + headS + p + wUser + p + wSep + p + wFps + p + wSep + p + wTime + p; RenderUtil.BLUR_RECT.draw(ms, x2, y, w2, h, 2, bg); float cX = x2 + p, tY = y + h/2 - fS/2 + 1; RenderUtil.TEXTURE_RECT.drawHead(ms, mc.player, cX, y + h/2 - headS/2, headS, headS, 2, 1f, Color.WHITE); cX += headS + p; getSemiBoldFont().drawText(ms, mc.getSession().getUsername(), cX, tY, fS, UIColors.textColor()); cX += wUser + p; getMediumFont().drawText(ms, sep, cX, tY, fS, sepC); cX += wSep + p; getMediumFont().drawText(ms, fps, cX, tY, fS, UIColors.textColor()); cX += wFps + p; getMediumFont().drawText(ms, sep, cX, tY, fS, sepC); cX += wSep + p; getMediumFont().drawText(ms, time, cX, tY, fS, UIColors.textColor()); getDraggable().setWidth(w1 + gap + w2); getDraggable().setHeight(h); } }
KeyBinds:
GeyBinds:package sweetie.evaware.client.ui.widget.overlay; import net.minecraft.client.util.math.MatrixStack; import sweetie.evaware.api.module.Module; import sweetie.evaware.api.module.ModuleManager; import sweetie.evaware.api.system.backend.KeyStorage; import sweetie.evaware.api.utils.color.UIColors; import sweetie.evaware.api.utils.render.RenderUtil; import sweetie.evaware.client.ui.widget.ContainerWidget; import java.awt.Color; import java.util.*; public class KeybindsWidget extends ContainerWidget { private final Map<Module, Float> animMap = new HashMap<>(); public KeybindsWidget() { super(3f, 120f); } @Override public String getName() { return "Keybinds"; } @Override protected Map<String, ContainerElement.ColoredString> getCurrentData() { return null; } @Override public void render(MatrixStack ms) { ModuleManager.getInstance().getModules().forEach(m -> { boolean t = m.isEnabled() && m.hasBind(); float cur = animMap.getOrDefault(m, 0f); animMap.put(m, cur + ((t ? 1f : 0f) - cur) * 0.15f); }); animMap.entrySet().removeIf(e -> e.getValue() < 0.05f && !e.getKey().isEnabled()); float x = getDraggable().getX(), y = getDraggable().getY(); float h = scaled(11), p = scaled(3f), gap = scaled(1), fS = scaled(6f); Color bg = new Color(12, 12, 18, 240); String title = "Hotkeys"; float titleW = getSemiBoldFont().getWidth(title, fS); float maxW = titleW + p * 4; for (Map.Entry<Module, Float> e : animMap.entrySet()) { float w = getMediumFont().getWidth(e.getKey().getName(), fS) + getMediumFont().getWidth(KeyStorage.getBind(e.getKey().getBind()), fS) + p * 4; if (w > maxW) maxW = w; } RenderUtil.BLUR_RECT.draw(ms, x, y, maxW, h, 1, bg); getSemiBoldFont().drawGradientText(ms, title, x + (maxW - titleW) / 2f, y + h/2 - fS/2 + 0.5f, fS, UIColors.primary(), UIColors.secondary(), titleW); float cY = y + h + gap; for (Module m : ModuleManager.getInstance().getModules()) { if (!animMap.containsKey(m)) continue; float anim = animMap.get(m); ms.push(); ms.translate(x + maxW/2, cY + h/2, 0); ms.scale(anim, anim, 1f); ms.translate(-(x + maxW/2), -(cY + h/2), 0); int alpha = (int)(200 * anim); if (alpha < 5) alpha = 5; RenderUtil.BLUR_RECT.draw(ms, x, cY, maxW, h, 1, new Color(12, 12, 18, alpha)); int textAlpha = (int)(255 * anim); if (textAlpha < 5) textAlpha = 5; Color txtC = new Color(255, 255, 255, textAlpha); String key = KeyStorage.getBind(m.getBind()); float tY = cY + h/2 - fS/2 + 0.5f; getMediumFont().drawText(ms, m.getName(), x + p, tY, fS, txtC); float kW = getMediumFont().getWidth(key, fS); getMediumFont().drawText(ms, key, x + maxW - p - kW, tY, fS, txtC); ms.pop(); cY += (h + gap) * anim; } getDraggable().setWidth(maxW); getDraggable().setHeight(cY - y); } }
Potions:
Potions:package sweetie.evaware.client.ui.widget.overlay; import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.util.Identifier; import net.minecraft.util.Language; import sweetie.evaware.api.utils.color.UIColors; import sweetie.evaware.api.utils.other.TextUtil; import sweetie.evaware.api.utils.render.RenderUtil; import sweetie.evaware.client.ui.widget.ContainerWidget; import java.awt.Color; import java.util.*; public class PotionsWidget extends ContainerWidget { private final Map<String, Float> animMap = new HashMap<>(); public PotionsWidget() { super(3f, 120f); } @Override public String getName() { return "Potions"; } @Override protected Map<String, ContainerElement.ColoredString> getCurrentData() { return null; } private static final Set<String> BAD = Set.of("wither", "poison", "slowness", "weakness", "mining_fatigue", "nausea", "blindness", "hunger", "levitation", "unluck"); private static final Set<String> GOOD = Set.of("speed", "strength", "regeneration", "fire_resistance", "absorption"); @Override public void render(MatrixStack ms) { Collection<StatusEffectInstance> effects = mc.player.getActiveStatusEffects().values(); effects.forEach(e -> { String k = e.getTranslationKey(); animMap.put(k, animMap.getOrDefault(k, 0f) + (1f - animMap.getOrDefault(k, 0f)) * 0.15f); }); animMap.entrySet().removeIf(e -> mc.player.getActiveStatusEffects().values().stream().noneMatch(ef -> ef.getTranslationKey().equals(e.getKey())) && e.getValue() < 0.05f); float x = getDraggable().getX(), y = getDraggable().getY(); float h = scaled(11), p = scaled(3f), gap = scaled(1), fS = scaled(6f), iconS = scaled(7); Color bg = new Color(12, 12, 18, 240); String title = "Effects"; float titleW = getSemiBoldFont().getWidth(title, fS); float maxW = titleW + p * 6; for (StatusEffectInstance e : effects) { String name = Language.getInstance().get(e.getTranslationKey()) + (e.getAmplifier() > 0 ? " " + (e.getAmplifier() + 1) : ""); float w = p + iconS + p + getMediumFont().getWidth(name, fS) + p + getMediumFont().getWidth(TextUtil.getDurationText(e.getDuration()), fS) + p; if (w > maxW) maxW = w; } RenderUtil.BLUR_RECT.draw(ms, x, y, maxW, h, 1, bg); getSemiBoldFont().drawGradientText(ms, title, x + (maxW - titleW) / 2f, y + h/2 - fS/2 + 0.5f, fS, UIColors.primary(), UIColors.secondary(), titleW); float cY = y + h + gap; for (StatusEffectInstance e : effects) { String k = e.getTranslationKey(); if (!animMap.containsKey(k)) continue; float anim = animMap.get(k); ms.push(); ms.translate(x + maxW/2, cY + h/2, 0); ms.scale(anim, anim, 1f); ms.translate(-(x + maxW/2), -(cY + h/2), 0); int alpha = (int)(200 * anim); if (alpha < 5) alpha = 5; RenderUtil.BLUR_RECT.draw(ms, x, cY, maxW, h, 1, new Color(12, 12, 18, alpha)); int tAlpha = (int)(255 * anim); if (tAlpha < 5) tAlpha = 5; String id = e.getEffectType().getKey().get().getValue().getPath(); Color nameC = BAD.contains(id) ? UIColors.negativeColor() : GOOD.contains(id) ? UIColors.positiveColor() : UIColors.textColor(); nameC = new Color(nameC.getRed(), nameC.getGreen(), nameC.getBlue(), tAlpha); Identifier tex = Identifier.of("minecraft", "textures/mob_effect/" + id + ".png"); int texId = mc.getTextureManager().getTexture(tex).getGlId(); RenderSystem.setShaderColor(1f, 1f, 1f, anim); RenderUtil.TEXTURE_RECT.draw(ms, x + p, cY + h/2 - iconS/2, iconS, iconS, 0f, new Color(255, 255, 255, tAlpha), 0f, 0f, 1f, 1f, texId); RenderSystem.setShaderColor(1f, 1f, 1f, 1f); String name = Language.getInstance().get(k) + (e.getAmplifier() > 0 ? " " + (e.getAmplifier() + 1) : ""); String dur = TextUtil.getDurationText(e.getDuration()); float tY = cY + h/2 - fS/2 + 0.5f; getMediumFont().drawText(ms, name, x + p + iconS + p, tY, fS, nameC); float dW = getMediumFont().getWidth(dur, fS); getMediumFont().drawText(ms, dur, x + maxW - p - dW, tY, fS, new Color(255, 255, 255, tAlpha)); ms.pop(); cY += (h + gap) * anim; } getDraggable().setWidth(maxW); getDraggable().setHeight(cY - y); } }