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

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

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
12 Мар 2026
Сообщения
26
Реакции
0
Выберите загрузчик игры
  1. Vanilla
  2. OptiFine
Сделал еще одну вотермарку под exp 3.1, вроде выглядит прикольно, только не знаю голова вписывается или нет
Дайте идей что можно еще сделать / на какой базе. По спине сильно не бейте

SS -
1773526646954.png


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

import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
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.Stencil;
import im.expensive.utils.render.font.Fonts;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.experimental.FieldDefaults;
import net.minecraft.client.gui.AbstractGui;
import net.minecraft.client.network.play.NetworkPlayerInfo;
import net.minecraft.util.ResourceLocation;

import java.text.SimpleDateFormat;
import java.util.Date;

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

    final ResourceLocation userIcon = new ResourceLocation("expensive/images/hud/user.png");
    final ResourceLocation fpsIcon = new ResourceLocation("expensive/images/hud/display.png");
    final ResourceLocation pingIcon = new ResourceLocation("expensive/images/hud/signal.png");
    final ResourceLocation xyzIcon = new ResourceLocation("expensive/images/hud/compass.png");
    final ResourceLocation timeIcon = new ResourceLocation("expensive/images/hud/time.png");

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

        MatrixStack ms = eventDisplay.getMatrixStack();

        float x = 4;
        float y = 4;
        float gap = 4;
        float h = 18;
        float head = (h * 2) + gap;

        int bg = ColorUtils.rgba(15, 15, 15, 140);
        int shd = ColorUtils.rgba(0, 0, 0, 100);

        DisplayUtils.drawShadow(x, y, head, head, 12, shd, shd);
        DisplayUtils.drawRoundedRect(x, y, head, head, 6, bg);

        Stencil.initStencilToWrite();
        DisplayUtils.drawRoundedRect(x + 3, y + 3, head - 6, head - 6, 4, -1);
        Stencil.readStencilBuffer(1);
        RenderSystem.enableBlend();
        RenderSystem.color4f(1, 1, 1, 1);
        mc.getTextureManager().bindTexture(mc.player.getLocationSkin());
        AbstractGui.drawScaledCustomSizeModalRect((int)(x + 3), (int)(y + 3), 8, 8, 8, 8, (int)head - 6, (int)head - 6, 64, 64);
        AbstractGui.drawScaledCustomSizeModalRect((int)(x + 3), (int)(y + 3), 40, 8, 8, 8, (int)head - 6, (int)head - 6, 64, 64);
        Stencil.uninitStencilBuffer();

        String name = mc.getSession().getUsername();
        String fps = "FPS " + mc.getDebugFPS();
        String time = new SimpleDateFormat("HH:mm").format(new Date());
        String xyz = String.format("XYZ %d, %d, %d", (int)mc.player.getPosX(), (int)mc.player.getPosY(), (int)mc.player.getPosZ());

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

        float startX = x + head + gap;

        draw(ms, startX, y, h, bg, shd,
                new ResourceLocation[]{userIcon, fpsIcon, timeIcon},
                new String[]{name, fps, time});

        float row2X = startX;
        row2X += draw(ms, row2X, y + h + gap, h, bg, shd,
                new ResourceLocation[]{xyzIcon},
                new String[]{xyz}) + gap;

        draw(ms, row2X, y + h + gap, h, bg, shd,
                new ResourceLocation[]{pingIcon},
                new String[]{ping});
    }

    private float draw(MatrixStack ms, float x, float y, float h, int bg, int shd, ResourceLocation[] icons, String[] texts) {
        float p = 6;
        float s = 9;
        float g = 3;
        float eg = 10;

        float w = p * 2;
        for (int i = 0; i < texts.length; i++) {
            w += s + g + Fonts.sfMedium.getWidth(texts[i], 7.5f);
            if (i < texts.length - 1) w += eg;
        }

        DisplayUtils.drawShadow(x, y, w, h, 10, shd, shd);
        DisplayUtils.drawRoundedRect(x, y, w, h, 4, bg);

        float curX = x + p;
        for (int i = 0; i < texts.length; i++) {
            DisplayUtils.drawImage(icons[i], curX, y + (h - s) / 2f, s, s, ColorUtils.rgba(200, 200, 200, 255));
            Fonts.sfMedium.drawText(ms, texts[i], curX + s + g, y + (h - Fonts.sfMedium.getHeight(7.5f)) / 2f + 1, -1, 7.5f);
            curX += s + g + Fonts.sfMedium.getWidth(texts[i], 7.5f) + eg;
        }
        return w;
    }
}
Код:
Expand Collapse Copy
 
Сделал еще одну вотермарку под exp 3.1, вроде выглядит прикольно, только не знаю голова вписывается или нет
Дайте идей что можно еще сделать / на какой базе. По спине сильно не бейте

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

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

import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
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.Stencil;
import im.expensive.utils.render.font.Fonts;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.experimental.FieldDefaults;
import net.minecraft.client.gui.AbstractGui;
import net.minecraft.client.network.play.NetworkPlayerInfo;
import net.minecraft.util.ResourceLocation;

import java.text.SimpleDateFormat;
import java.util.Date;

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

    final ResourceLocation userIcon = new ResourceLocation("expensive/images/hud/user.png");
    final ResourceLocation fpsIcon = new ResourceLocation("expensive/images/hud/display.png");
    final ResourceLocation pingIcon = new ResourceLocation("expensive/images/hud/signal.png");
    final ResourceLocation xyzIcon = new ResourceLocation("expensive/images/hud/compass.png");
    final ResourceLocation timeIcon = new ResourceLocation("expensive/images/hud/time.png");

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

        MatrixStack ms = eventDisplay.getMatrixStack();

        float x = 4;
        float y = 4;
        float gap = 4;
        float h = 18;
        float head = (h * 2) + gap;

        int bg = ColorUtils.rgba(15, 15, 15, 140);
        int shd = ColorUtils.rgba(0, 0, 0, 100);

        DisplayUtils.drawShadow(x, y, head, head, 12, shd, shd);
        DisplayUtils.drawRoundedRect(x, y, head, head, 6, bg);

        Stencil.initStencilToWrite();
        DisplayUtils.drawRoundedRect(x + 3, y + 3, head - 6, head - 6, 4, -1);
        Stencil.readStencilBuffer(1);
        RenderSystem.enableBlend();
        RenderSystem.color4f(1, 1, 1, 1);
        mc.getTextureManager().bindTexture(mc.player.getLocationSkin());
        AbstractGui.drawScaledCustomSizeModalRect((int)(x + 3), (int)(y + 3), 8, 8, 8, 8, (int)head - 6, (int)head - 6, 64, 64);
        AbstractGui.drawScaledCustomSizeModalRect((int)(x + 3), (int)(y + 3), 40, 8, 8, 8, (int)head - 6, (int)head - 6, 64, 64);
        Stencil.uninitStencilBuffer();

        String name = mc.getSession().getUsername();
        String fps = "FPS " + mc.getDebugFPS();
        String time = new SimpleDateFormat("HH:mm").format(new Date());
        String xyz = String.format("XYZ %d, %d, %d", (int)mc.player.getPosX(), (int)mc.player.getPosY(), (int)mc.player.getPosZ());

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

        float startX = x + head + gap;

        draw(ms, startX, y, h, bg, shd,
                new ResourceLocation[]{userIcon, fpsIcon, timeIcon},
                new String[]{name, fps, time});

        float row2X = startX;
        row2X += draw(ms, row2X, y + h + gap, h, bg, shd,
                new ResourceLocation[]{xyzIcon},
                new String[]{xyz}) + gap;

        draw(ms, row2X, y + h + gap, h, bg, shd,
                new ResourceLocation[]{pingIcon},
                new String[]{ping});
    }

    private float draw(MatrixStack ms, float x, float y, float h, int bg, int shd, ResourceLocation[] icons, String[] texts) {
        float p = 6;
        float s = 9;
        float g = 3;
        float eg = 10;

        float w = p * 2;
        for (int i = 0; i < texts.length; i++) {
            w += s + g + Fonts.sfMedium.getWidth(texts[i], 7.5f);
            if (i < texts.length - 1) w += eg;
        }

        DisplayUtils.drawShadow(x, y, w, h, 10, shd, shd);
        DisplayUtils.drawRoundedRect(x, y, w, h, 4, bg);

        float curX = x + p;
        for (int i = 0; i < texts.length; i++) {
            DisplayUtils.drawImage(icons[i], curX, y + (h - s) / 2f, s, s, ColorUtils.rgba(200, 200, 200, 255));
            Fonts.sfMedium.drawText(ms, texts[i], curX + s + g, y + (h - Fonts.sfMedium.getHeight(7.5f)) / 2f + 1, -1, 7.5f);
            curX += s + g + Fonts.sfMedium.getWidth(texts[i], 7.5f) + eg;
        }
        return w;
    }
}
Код:
Expand Collapse Copy
че иконки черные? + как то голова не к месту
 
Сделал еще одну вотермарку под exp 3.1, вроде выглядит прикольно, только не знаю голова вписывается или нет
Дайте идей что можно еще сделать / на какой базе. По спине сильно не бейте

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

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

import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
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.Stencil;
import im.expensive.utils.render.font.Fonts;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.experimental.FieldDefaults;
import net.minecraft.client.gui.AbstractGui;
import net.minecraft.client.network.play.NetworkPlayerInfo;
import net.minecraft.util.ResourceLocation;

import java.text.SimpleDateFormat;
import java.util.Date;

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

    final ResourceLocation userIcon = new ResourceLocation("expensive/images/hud/user.png");
    final ResourceLocation fpsIcon = new ResourceLocation("expensive/images/hud/display.png");
    final ResourceLocation pingIcon = new ResourceLocation("expensive/images/hud/signal.png");
    final ResourceLocation xyzIcon = new ResourceLocation("expensive/images/hud/compass.png");
    final ResourceLocation timeIcon = new ResourceLocation("expensive/images/hud/time.png");

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

        MatrixStack ms = eventDisplay.getMatrixStack();

        float x = 4;
        float y = 4;
        float gap = 4;
        float h = 18;
        float head = (h * 2) + gap;

        int bg = ColorUtils.rgba(15, 15, 15, 140);
        int shd = ColorUtils.rgba(0, 0, 0, 100);

        DisplayUtils.drawShadow(x, y, head, head, 12, shd, shd);
        DisplayUtils.drawRoundedRect(x, y, head, head, 6, bg);

        Stencil.initStencilToWrite();
        DisplayUtils.drawRoundedRect(x + 3, y + 3, head - 6, head - 6, 4, -1);
        Stencil.readStencilBuffer(1);
        RenderSystem.enableBlend();
        RenderSystem.color4f(1, 1, 1, 1);
        mc.getTextureManager().bindTexture(mc.player.getLocationSkin());
        AbstractGui.drawScaledCustomSizeModalRect((int)(x + 3), (int)(y + 3), 8, 8, 8, 8, (int)head - 6, (int)head - 6, 64, 64);
        AbstractGui.drawScaledCustomSizeModalRect((int)(x + 3), (int)(y + 3), 40, 8, 8, 8, (int)head - 6, (int)head - 6, 64, 64);
        Stencil.uninitStencilBuffer();

        String name = mc.getSession().getUsername();
        String fps = "FPS " + mc.getDebugFPS();
        String time = new SimpleDateFormat("HH:mm").format(new Date());
        String xyz = String.format("XYZ %d, %d, %d", (int)mc.player.getPosX(), (int)mc.player.getPosY(), (int)mc.player.getPosZ());

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

        float startX = x + head + gap;

        draw(ms, startX, y, h, bg, shd,
                new ResourceLocation[]{userIcon, fpsIcon, timeIcon},
                new String[]{name, fps, time});

        float row2X = startX;
        row2X += draw(ms, row2X, y + h + gap, h, bg, shd,
                new ResourceLocation[]{xyzIcon},
                new String[]{xyz}) + gap;

        draw(ms, row2X, y + h + gap, h, bg, shd,
                new ResourceLocation[]{pingIcon},
                new String[]{ping});
    }

    private float draw(MatrixStack ms, float x, float y, float h, int bg, int shd, ResourceLocation[] icons, String[] texts) {
        float p = 6;
        float s = 9;
        float g = 3;
        float eg = 10;

        float w = p * 2;
        for (int i = 0; i < texts.length; i++) {
            w += s + g + Fonts.sfMedium.getWidth(texts[i], 7.5f);
            if (i < texts.length - 1) w += eg;
        }

        DisplayUtils.drawShadow(x, y, w, h, 10, shd, shd);
        DisplayUtils.drawRoundedRect(x, y, w, h, 4, bg);

        float curX = x + p;
        for (int i = 0; i < texts.length; i++) {
            DisplayUtils.drawImage(icons[i], curX, y + (h - s) / 2f, s, s, ColorUtils.rgba(200, 200, 200, 255));
            Fonts.sfMedium.drawText(ms, texts[i], curX + s + g, y + (h - Fonts.sfMedium.getHeight(7.5f)) / 2f + 1, -1, 7.5f);
            curX += s + g + Fonts.sfMedium.getWidth(texts[i], 7.5f) + eg;
        }
        return w;
    }
}
Код:
Expand Collapse Copy
норм бегу пастить
 
Сделал еще одну вотермарку под exp 3.1, вроде выглядит прикольно, только не знаю голова вписывается или нет
Дайте идей что можно еще сделать / на какой базе. По спине сильно не бейте

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

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

import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
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.Stencil;
import im.expensive.utils.render.font.Fonts;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.experimental.FieldDefaults;
import net.minecraft.client.gui.AbstractGui;
import net.minecraft.client.network.play.NetworkPlayerInfo;
import net.minecraft.util.ResourceLocation;

import java.text.SimpleDateFormat;
import java.util.Date;

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

    final ResourceLocation userIcon = new ResourceLocation("expensive/images/hud/user.png");
    final ResourceLocation fpsIcon = new ResourceLocation("expensive/images/hud/display.png");
    final ResourceLocation pingIcon = new ResourceLocation("expensive/images/hud/signal.png");
    final ResourceLocation xyzIcon = new ResourceLocation("expensive/images/hud/compass.png");
    final ResourceLocation timeIcon = new ResourceLocation("expensive/images/hud/time.png");

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

        MatrixStack ms = eventDisplay.getMatrixStack();

        float x = 4;
        float y = 4;
        float gap = 4;
        float h = 18;
        float head = (h * 2) + gap;

        int bg = ColorUtils.rgba(15, 15, 15, 140);
        int shd = ColorUtils.rgba(0, 0, 0, 100);

        DisplayUtils.drawShadow(x, y, head, head, 12, shd, shd);
        DisplayUtils.drawRoundedRect(x, y, head, head, 6, bg);

        Stencil.initStencilToWrite();
        DisplayUtils.drawRoundedRect(x + 3, y + 3, head - 6, head - 6, 4, -1);
        Stencil.readStencilBuffer(1);
        RenderSystem.enableBlend();
        RenderSystem.color4f(1, 1, 1, 1);
        mc.getTextureManager().bindTexture(mc.player.getLocationSkin());
        AbstractGui.drawScaledCustomSizeModalRect((int)(x + 3), (int)(y + 3), 8, 8, 8, 8, (int)head - 6, (int)head - 6, 64, 64);
        AbstractGui.drawScaledCustomSizeModalRect((int)(x + 3), (int)(y + 3), 40, 8, 8, 8, (int)head - 6, (int)head - 6, 64, 64);
        Stencil.uninitStencilBuffer();

        String name = mc.getSession().getUsername();
        String fps = "FPS " + mc.getDebugFPS();
        String time = new SimpleDateFormat("HH:mm").format(new Date());
        String xyz = String.format("XYZ %d, %d, %d", (int)mc.player.getPosX(), (int)mc.player.getPosY(), (int)mc.player.getPosZ());

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

        float startX = x + head + gap;

        draw(ms, startX, y, h, bg, shd,
                new ResourceLocation[]{userIcon, fpsIcon, timeIcon},
                new String[]{name, fps, time});

        float row2X = startX;
        row2X += draw(ms, row2X, y + h + gap, h, bg, shd,
                new ResourceLocation[]{xyzIcon},
                new String[]{xyz}) + gap;

        draw(ms, row2X, y + h + gap, h, bg, shd,
                new ResourceLocation[]{pingIcon},
                new String[]{ping});
    }

    private float draw(MatrixStack ms, float x, float y, float h, int bg, int shd, ResourceLocation[] icons, String[] texts) {
        float p = 6;
        float s = 9;
        float g = 3;
        float eg = 10;

        float w = p * 2;
        for (int i = 0; i < texts.length; i++) {
            w += s + g + Fonts.sfMedium.getWidth(texts[i], 7.5f);
            if (i < texts.length - 1) w += eg;
        }

        DisplayUtils.drawShadow(x, y, w, h, 10, shd, shd);
        DisplayUtils.drawRoundedRect(x, y, w, h, 4, bg);

        float curX = x + p;
        for (int i = 0; i < texts.length; i++) {
            DisplayUtils.drawImage(icons[i], curX, y + (h - s) / 2f, s, s, ColorUtils.rgba(200, 200, 200, 255));
            Fonts.sfMedium.drawText(ms, texts[i], curX + s + g, y + (h - Fonts.sfMedium.getHeight(7.5f)) / 2f + 1, -1, 7.5f);
            curX += s + g + Fonts.sfMedium.getWidth(texts[i], 7.5f) + eg;
        }
        return w;
    }
}
Код:
Expand Collapse Copy
не понял где авы сами залей
 
Сделал еще одну вотермарку под exp 3.1, вроде выглядит прикольно, только не знаю голова вписывается или нет
Дайте идей что можно еще сделать / на какой базе. По спине сильно не бейте

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

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

import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
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.Stencil;
import im.expensive.utils.render.font.Fonts;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.experimental.FieldDefaults;
import net.minecraft.client.gui.AbstractGui;
import net.minecraft.client.network.play.NetworkPlayerInfo;
import net.minecraft.util.ResourceLocation;

import java.text.SimpleDateFormat;
import java.util.Date;

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

    final ResourceLocation userIcon = new ResourceLocation("expensive/images/hud/user.png");
    final ResourceLocation fpsIcon = new ResourceLocation("expensive/images/hud/display.png");
    final ResourceLocation pingIcon = new ResourceLocation("expensive/images/hud/signal.png");
    final ResourceLocation xyzIcon = new ResourceLocation("expensive/images/hud/compass.png");
    final ResourceLocation timeIcon = new ResourceLocation("expensive/images/hud/time.png");

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

        MatrixStack ms = eventDisplay.getMatrixStack();

        float x = 4;
        float y = 4;
        float gap = 4;
        float h = 18;
        float head = (h * 2) + gap;

        int bg = ColorUtils.rgba(15, 15, 15, 140);
        int shd = ColorUtils.rgba(0, 0, 0, 100);

        DisplayUtils.drawShadow(x, y, head, head, 12, shd, shd);
        DisplayUtils.drawRoundedRect(x, y, head, head, 6, bg);

        Stencil.initStencilToWrite();
        DisplayUtils.drawRoundedRect(x + 3, y + 3, head - 6, head - 6, 4, -1);
        Stencil.readStencilBuffer(1);
        RenderSystem.enableBlend();
        RenderSystem.color4f(1, 1, 1, 1);
        mc.getTextureManager().bindTexture(mc.player.getLocationSkin());
        AbstractGui.drawScaledCustomSizeModalRect((int)(x + 3), (int)(y + 3), 8, 8, 8, 8, (int)head - 6, (int)head - 6, 64, 64);
        AbstractGui.drawScaledCustomSizeModalRect((int)(x + 3), (int)(y + 3), 40, 8, 8, 8, (int)head - 6, (int)head - 6, 64, 64);
        Stencil.uninitStencilBuffer();

        String name = mc.getSession().getUsername();
        String fps = "FPS " + mc.getDebugFPS();
        String time = new SimpleDateFormat("HH:mm").format(new Date());
        String xyz = String.format("XYZ %d, %d, %d", (int)mc.player.getPosX(), (int)mc.player.getPosY(), (int)mc.player.getPosZ());

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

        float startX = x + head + gap;

        draw(ms, startX, y, h, bg, shd,
                new ResourceLocation[]{userIcon, fpsIcon, timeIcon},
                new String[]{name, fps, time});

        float row2X = startX;
        row2X += draw(ms, row2X, y + h + gap, h, bg, shd,
                new ResourceLocation[]{xyzIcon},
                new String[]{xyz}) + gap;

        draw(ms, row2X, y + h + gap, h, bg, shd,
                new ResourceLocation[]{pingIcon},
                new String[]{ping});
    }

    private float draw(MatrixStack ms, float x, float y, float h, int bg, int shd, ResourceLocation[] icons, String[] texts) {
        float p = 6;
        float s = 9;
        float g = 3;
        float eg = 10;

        float w = p * 2;
        for (int i = 0; i < texts.length; i++) {
            w += s + g + Fonts.sfMedium.getWidth(texts[i], 7.5f);
            if (i < texts.length - 1) w += eg;
        }

        DisplayUtils.drawShadow(x, y, w, h, 10, shd, shd);
        DisplayUtils.drawRoundedRect(x, y, w, h, 4, bg);

        float curX = x + p;
        for (int i = 0; i < texts.length; i++) {
            DisplayUtils.drawImage(icons[i], curX, y + (h - s) / 2f, s, s, ColorUtils.rgba(200, 200, 200, 255));
            Fonts.sfMedium.drawText(ms, texts[i], curX + s + g, y + (h - Fonts.sfMedium.getHeight(7.5f)) / 2f + 1, -1, 7.5f);
            curX += s + g + Fonts.sfMedium.getWidth(texts[i], 7.5f) + eg;
        }
        return w;
    }
}
Код:
Expand Collapse Copy
пиздец у тебя нету AE чтобы заполнить черные иконки?
нахуй голова игрока типо рендер которая ничего не делает мог бы сделать вместо головы блять лого
 
Назад
Сверху Снизу