Вопрос Как убрать майнкрафтовский ник когда включены Tags I exp 3.1

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
22 Сен 2024
Сообщения
136
Реакции
0

Перед прочтением основного контента ниже, пожалуйста, обратите внимание на обновление внутри секции Майна на нашем форуме. У нас появились:

  • бесплатные читы для Майнкрафт — любое использование на свой страх и риск;
  • маркетплейс Майнкрафт — абсолютно любая коммерция, связанная с игрой, за исключением продажи читов (аккаунты, предоставления услуг, поиск кодеров читов и так далее);
  • приватные читы для Minecraft — в этом разделе только платные хаки для игры, покупайте группу "Продавец" и выставляйте на продажу свой софт;
  • обсуждения и гайды — всё тот же раздел с вопросами, но теперь модернизированный: поиск нужных хаков, пати с игроками-читерами и другая полезная информация.

Спасибо!

вот код надеюсь поможете

Код:
Expand Collapse Copy
package im.expensive.functions.impl.render;

import com.google.common.eventbus.Subscribe;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
import im.expensive.command.friends.FriendStorage;
import im.expensive.events.EventDisplay;
import im.expensive.events.WorldEvent;
import im.expensive.functions.api.Category;
import im.expensive.functions.api.Function;
import im.expensive.functions.api.FunctionRegister;
import im.expensive.functions.impl.combat.AntiBot;
import im.expensive.functions.settings.impl.BooleanSetting;
import im.expensive.functions.settings.impl.ColorSetting;
import im.expensive.functions.settings.impl.ModeListSetting;
import im.expensive.functions.settings.impl.ModeSetting;
import im.expensive.utils.math.MathUtil;
import im.expensive.utils.math.Vector4i;
import im.expensive.utils.projections.ProjectionUtil;
import im.expensive.utils.render.ColorUtils;
import im.expensive.utils.render.DisplayUtils;
import im.expensive.utils.render.font.Font;
import im.expensive.utils.render.font.Fonts;
import im.expensive.utils.text.GradientUtil;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.client.resources.I18n;
import net.minecraft.client.settings.PointOfView;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.item.ItemEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.ListNBT;
import net.minecraft.potion.EffectInstance;
import net.minecraft.potion.EffectUtils;
import net.minecraft.scoreboard.Score;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector2f;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.util.math.vector.Vector4f;
import net.minecraft.util.text.*;
import org.lwjgl.opengl.GL11;

import java.util.*;


import static net.minecraft.client.renderer.WorldRenderer.frustum;
import static org.lwjgl.opengl.GL11.glScalef;
import static org.lwjgl.opengl.GL11.glTranslatef;

@FunctionRegister(name = "Tags", type = Category.Render)
public class Tags extends Function {
    public ModeListSetting remove = new ModeListSetting("Включить", new BooleanSetting("Предметы", true), new BooleanSetting("Текст хп", true),new BooleanSetting("Индикация предметов",false));
    private final ModeSetting colores = new ModeSetting("Тип", "Клиент", "Клиент","Свой");
    public ColorSetting colordeft = new ColorSetting("Цвет",ColorUtils.rgb(255,255,255)).setVisible(() -> colores.is("Свой"));
    public ColorSetting colorfr = new ColorSetting("Цвет друга",ColorUtils.rgb(255,255,255)).setVisible(() -> colores.is("Свой"));
    public Tags() {
        addSettings(remove,colores,colordeft,colorfr);
    }

    private final HashMap<Entity, Vector4f> positions = new HashMap<>();

    public ColorSetting color = new ColorSetting("Color", -1);

    @Subscribe
    public void onDisplay(EventDisplay e) {
        // Проверяем, что мир загружен и тип события - PRE
        if (mc.world == null || e.getType() != EventDisplay.Type.PRE) {
            return;
        }

        positions.clear(); // Очищаем список позиций

        // Получаем цвета для отображения
        Vector4i colors = new Vector4i(
                HUD.getColor(0, 1),
                HUD.getColor(90, 1),
                HUD.getColor(180, 1),
                HUD.getColor(270, 1)
        );

        Vector4i friendColors = new Vector4i(
                HUD.getColor(ColorUtils.rgb(144, 238, 144), ColorUtils.rgb(0, 139, 0), 0, 1),
                HUD.getColor(ColorUtils.rgb(144, 238, 144), ColorUtils.rgb(0, 139, 0), 90, 1),
                HUD.getColor(ColorUtils.rgb(144, 238, 144), ColorUtils.rgb(0, 139, 0), 180, 1),
                HUD.getColor(ColorUtils.rgb(144, 238, 144), ColorUtils.rgb(0, 139, 0), 270, 1)
        );

        // Проходим по всем сущностям в мире
        for (Entity entity : mc.world.getAllEntities()) {
            // Проверяем валидность сущности
            if (!isValid(entity)) continue;

            // Проверяем, что это игрок или предмет
            if (!(entity instanceof PlayerEntity) && !(entity instanceof ItemEntity)) continue;

            // Пропускаем игрока в первом лице
            if (entity == mc.player && (mc.gameSettings.getPointOfView() == PointOfView.FIRST_PERSON)) continue;

            // Интерполяция позиции сущности
            double x = MathUtil.interpolate(entity.getPosX(), entity.lastTickPosX, e.getPartialTicks());
            double y = MathUtil.interpolate(entity.getPosY(), entity.lastTickPosY, e.getPartialTicks());
            double z = MathUtil.interpolate(entity.getPosZ(), entity.lastTickPosZ, e.getPartialTicks());

            // Получаем размер сущности
            Vector3d size = new Vector3d(
                    entity.getBoundingBox().maxX - entity.getBoundingBox().minX,
                    entity.getBoundingBox().maxY - entity.getBoundingBox().minY,
                    entity.getBoundingBox().maxZ - entity.getBoundingBox().minZ
            );

            // Создаем AxisAlignedBB для сущности
            AxisAlignedBB aabb = new AxisAlignedBB(
                    x - size.x / 1.5f,
                    y,
                    z - size.z / 1.5f,
                    x + size.x / 1.5f,
                    y + size.y + 0.1f,
                    z + size.z / 1.5f
            );

            Vector4f position = null;

            // Проектируем углы AABB
            for (int i = 0; i < 8; i++) {
                Vector2f vector = ProjectionUtil.project(
                        i % 2 == 0 ? aabb.minX : aabb.maxX,
                        (i / 2) % 2 == 0 ? aabb.minY : aabb.maxY,
                        (i / 4) % 2 == 0 ? aabb.minZ : aabb.maxZ
                );

                // Обновляем позицию
                if (position == null) {
                    position = new Vector4f(vector.x, vector.y, 1, 1.0f);
                } else {
                    position.x = Math.min(vector.x, position.x);
                    position.y = Math.min(vector.y, position.y);
                    position.z = Math.max(vector.x, position.z);
                    position.w = Math.max(vector.y, position.w);
                }
            }

            // Сохраняем позицию для сущности
            positions.put(entity, position);
        }



        RenderSystem.enableBlend();
        RenderSystem.disableTexture();
        RenderSystem.defaultBlendFunc();
        RenderSystem.shadeModel(7425);
        buffer.endVertex();
        buffer.begin(7, DefaultVertexFormats.POSITION_COLOR);
        for (Map.Entry<Entity, Vector4f> entry : positions.entrySet()) {
            Vector4f position = entry.getValue();
            if (entry.getKey() instanceof LivingEntity entity) {







            }
        }
        Tessellator.getInstance().draw();
        RenderSystem.shadeModel(7424);
        RenderSystem.enableTexture();
        RenderSystem.disableBlend();

        for (Map.Entry<Entity, Vector4f> entry : positions.entrySet()) {
            Entity entity = entry.getKey();

            if (entity instanceof LivingEntity living) {
                Score score = mc.world.getScoreboard().getOrCreateScore(living.getScoreboardName(), mc.world.getScoreboard().getObjectiveInDisplaySlot(2));
                float hp = living.getHealth();
                float maxHp = living.getMaxHealth();

                String header = mc.ingameGUI.getTabList().header == null ? " " : mc.ingameGUI.getTabList().header.getString().toLowerCase();


                if (mc.getCurrentServerData() != null && mc.getCurrentServerData().serverIP.contains("funtime") && (header.contains("анархия") || header.contains("гриферский"))) {
                    hp = score.getScorePoints();
                    maxHp = 20;
                }

                Vector4f position = entry.getValue();
                float width = position.z - position.x;

                String hpText = (int) hp + "HP";
                float hpWidth = Fonts.montserrat.getWidth(hpText, 5);

                float hpPercent = MathHelper.clamp(hp / maxHp, 0, 1);
                float hpPosY = position.y + (position.w - position.y) * (1 - hpPercent);
                if (remove.getValueByName("Текст хп").get()) {
                    Fonts.montserrat.drawText(e.getMatrixStack(), hpText, position.x - hpWidth - 6, hpPosY, -1, 0, 0.05f);
                }
                String hptext1 =  (int) hp + "";
                ITextComponent text = entity.getDisplayName();
                TextComponent name = (TextComponent)text;
                name.append(new StringTextComponent(" [" + TextFormatting.GREEN + (int) hp + TextFormatting.WHITE + "]"));
                float length = mc.fontRenderer.getStringPropertyWidth(name);
                GL11.glPushMatrix();
                glCenteredScale(position.x + width / 2f - length / 2f, position.y - 7, length, 10, 0.5f);
                if(FriendStorage.isFriend(entity.getName().getString())) {
                    DisplayUtils.drawRoundedRect(position.x - 2 + width / 2.0F - length / 1.9f, position.y - 16, length + 8, 14, 2, ColorUtils.rgba(10, 92, 1, 150));
                }else {
                    DisplayUtils.drawRoundedRect(position.x - 2 + width / 2.0F - length / 1.9f , position.y - 16, length + 8, 14, 2, ColorUtils.rgba(10, 10, 10, 100));
                }
                mc.fontRenderer.func_243246_a(e.getMatrixStack(), name, position.x + width/2.0f - length / 2f , position.y - 13, -1);
                if(entity instanceof PlayerEntity player){
                    if(remove.getValueByName("Индикация предметов").get()) {
                        ItemStack stack = player.getHeldItemOffhand();
                        String nameS = "";

                        String itemName = stack.getDisplayName().getString();
                        if (stack.getItem() == Items.PLAYER_HEAD) {
                            CompoundNBT tag = stack.getTag();

                            if (tag != null && tag.contains("display", 10)) {
                                CompoundNBT display = tag.getCompound("display");

                                if (display.contains("Lore", 9)) {
                                    ListNBT lore = display.getList("Lore", 8);

                                    if (!lore.isEmpty()) {
                                        String firstLore = lore.getString(0);

                                        int levelIndex = firstLore.indexOf("Уровень");
                                        if (levelIndex != -1) {
                                            String levelString = firstLore.substring(levelIndex + "Уровень".length()).trim();
                                            String gat = levelString;
                                            if (gat.contains("1/3")) {
                                                nameS = "- 1/3]";
                                            } else if (gat.contains("2/3")) {
                                                nameS = "- 2/3]";
                                            } else if (gat.contains("MAX")) {
                                                nameS = "- MAX]";
                                            } else {
                                                nameS = "";
                                            }
                                        }
                                    }
                                }
                            }
                            if (itemName.contains("Пандо")) {
                                itemName = "[PANDORA ";
                            } else if (itemName.contains("Аполл")) {
                                itemName = "[APOLLON ";
                            } else if (itemName.contains("Тит")) {
                                itemName = "[TITANA ";
                            } else if (itemName.contains("Осир")) {
                                itemName = "[OSIRIS ";
                            } else if (itemName.contains("Андро")) {
                                itemName = "[ANDROMEDA";
                            } else if (itemName.contains("Хим")) {
                                itemName = "[XIMERA ";
                            } else if (itemName.contains("Астр")) {
                                itemName = "[ASTREYA ";
                            }
                            Fonts.sfMedium.drawText(e.getMatrixStack(), itemName + nameS, (float) position.x - 15, position.y - 55, ColorUtils.rgb(255, 255,255), 10.5f, 0.0001f);
                        }
                    }
                }GL11.glPopMatrix();

                drawItems(e.getMatrixStack(), living, (int) (position.x + width / 2f), (int) (position.y - 20));
            } else if (entity instanceof ItemEntity item) {
                MatrixStack stack = new MatrixStack();
                if (remove.getValueByName("Предметы").get()) {
                    GL11.glPushMatrix();
                    Vector4f position = entry.getValue();


                    float width = position.z - position.x;

                    ITextComponent textComponent = item.getItem().getDisplayName();
                    TextComponent tag = (TextComponent)textComponent;
                    tag.append(new StringTextComponent(item.getItem().getCount() < 1 ? "" : " x" + item.getItem().getCount()));
                    float length = mc.fontRenderer.getStringPropertyWidth(tag);
                    glCenteredScale(position.x + width / 2f - length / 2f, position.y - 7, length, 10, 0.5f);
                    DisplayUtils.drawRoundedRect(position.x - 5 + width / 2f - length / 2f, position.y - 16, length + 10, 16, 2, ColorUtils.rgba(10, 10, 10, 150));
                    mc.fontRenderer.func_243246_a(e.getMatrixStack(), tag, position.x + width/2.0f - length / 2f, position.y - 12, -1);
                    //Fonts.sfui.drawText(e.getMatrixStack(),tag,position.x + width/2.0f - length / 2f, position.y - 14,13,255);
                    GL11.glPopMatrix();
                }
            }
        }
    }
    public static int getHealthColor(final LivingEntity entity, final int c1, final int c2) {
        final float health = entity.getHealth();
        final float maxHealth = entity.getMaxHealth();
        final float hpPercentage = health / maxHealth;
        final int red = (int) ((c2 >> 16 & 0xFF) * hpPercentage + (c1 >> 16 & 0xFF) * (1.0f - hpPercentage));
        final int green = (int) ((c2 >> 8 & 0xFF) * hpPercentage + (c1 >> 8 & 0xFF) * (1.0f - hpPercentage));
        final int blue = (int) ((c2 & 0xFF) * hpPercentage + (c1 & 0xFF) * (1.0f - hpPercentage));
        return new java.awt.Color(red, green, blue).getRGB();
    }
    public ModeListSetting getRemove() {
        return remove;
    }

    public HashMap<Entity, Vector4f> getPositions() {
        return positions;
    }

    public ColorSetting getColor() {
        return color;
    }

    public boolean isInView(Entity ent) {

        if (mc.getRenderViewEntity() == null) {
            return false;
        }
        frustum.setCameraPosition(mc.getRenderManager().info.getProjectedView().x, mc.getRenderManager().info.getProjectedView().y, mc.getRenderManager().info.getProjectedView().z);
        return frustum.isBoundingBoxInFrustum(ent.getBoundingBox()) || ent.ignoreFrustumCheck;
    }

    private void drawPotions(MatrixStack matrixStack, LivingEntity entity, float posX, float posY) {
        for (EffectInstance pot : entity.getActivePotionEffects()) {
            int amp = pot.getAmplifier();

            String ampStr = "";

            if (amp >= 1 && amp <= 9) {
                ampStr = " " + I18n.format("" + (amp + 1));
            }

            String text = I18n.format(pot.getEffectName()) + ampStr + " - " + EffectUtils.getPotionDurationString(pot, 1);

            Fonts.consolas.drawText(matrixStack, text, posX, posY, -1, 5, 0.05f);

            posY += Fonts.consolas.getHeight(6);
        }
    }

    private void drawItems(MatrixStack matrixStack, LivingEntity entity, int posX, int posY) {
        int size = 8;
        int padding = 6;

        float fontHeight = Fonts.consolas.getHeight(6);

        List<ItemStack> items = new ArrayList<>();

        ItemStack mainStack = entity.getHeldItemMainhand();

        if (!mainStack.isEmpty()) {
            items.add(mainStack);
        }

        for (ItemStack itemStack : entity.getArmorInventoryList()) {
            if (itemStack.isEmpty()) continue;
            items.add(itemStack);
        }

        ItemStack offStack = entity.getHeldItemOffhand();

        if (!offStack.isEmpty()) {
            items.add(offStack);
        }

        posX -= (items.size() * (size + padding)) / 2f;

        for (ItemStack itemStack : items) {
            if (itemStack.isEmpty()) continue;

            GL11.glPushMatrix();

            glCenteredScale(posX, posY, size / 2f, size / 2f, 0.5f);

            mc.getItemRenderer().renderItemAndEffectIntoGUI(itemStack, posX, posY);
            mc.getItemRenderer().renderItemOverlayIntoGUI(mc.fontRenderer, itemStack, posX, posY, null);

            GL11.glPopMatrix();

        }
    }
    public boolean isValid(Entity e) {
        if (AntiBot.isBot(e)) return false;

        return isInView(e);
    }

    public void glCenteredScale(final float x, final float y, final float w, final float h, final float f) {
        glTranslatef(x + w / 2, y + h / 2, 0);
        glScalef(f, f, 1);
        glTranslatef(-x - w / 2, -y - h / 2, 0);
    }
    public static void drawMcRect(
            double left,
            double top,
            double right,
            double bottom,
            int color) {
        if (left < right) {
            double i = left;
            left = right;
            right = i;
        }

        if (top < bottom) {
            double j = top;
            top = bottom;
            bottom = j;
        }

        float f3 = (float) (color >> 24 & 255) / 255.0F;
        float f = (float) (color >> 16 & 255) / 255.0F;
        float f1 = (float) (color >> 8 & 255) / 255.0F;
        float f2 = (float) (color & 255) / 255.0F;
        BufferBuilder bufferbuilder = Tessellator.getInstance().getBuffer();

        bufferbuilder.pos(left, bottom, 1.0F).color(f, f1, f2, f3).endVertex();
        bufferbuilder.pos(right, bottom, 1.0F).color(f, f1, f2, f3).endVertex();
        bufferbuilder.pos(right, top, 1.0F).color(f, f1, f2, f3).endVertex();
        bufferbuilder.pos(left, top, 1.0F).color(f, f1, f2, f3).endVertex();

    }
}
 
в EntityRenderer
 
вот код надеюсь поможете

Код:
Expand Collapse Copy
package im.expensive.functions.impl.render;

import com.google.common.eventbus.Subscribe;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
import im.expensive.command.friends.FriendStorage;
import im.expensive.events.EventDisplay;
import im.expensive.events.WorldEvent;
import im.expensive.functions.api.Category;
import im.expensive.functions.api.Function;
import im.expensive.functions.api.FunctionRegister;
import im.expensive.functions.impl.combat.AntiBot;
import im.expensive.functions.settings.impl.BooleanSetting;
import im.expensive.functions.settings.impl.ColorSetting;
import im.expensive.functions.settings.impl.ModeListSetting;
import im.expensive.functions.settings.impl.ModeSetting;
import im.expensive.utils.math.MathUtil;
import im.expensive.utils.math.Vector4i;
import im.expensive.utils.projections.ProjectionUtil;
import im.expensive.utils.render.ColorUtils;
import im.expensive.utils.render.DisplayUtils;
import im.expensive.utils.render.font.Font;
import im.expensive.utils.render.font.Fonts;
import im.expensive.utils.text.GradientUtil;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.client.resources.I18n;
import net.minecraft.client.settings.PointOfView;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.item.ItemEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.ListNBT;
import net.minecraft.potion.EffectInstance;
import net.minecraft.potion.EffectUtils;
import net.minecraft.scoreboard.Score;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector2f;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.util.math.vector.Vector4f;
import net.minecraft.util.text.*;
import org.lwjgl.opengl.GL11;

import java.util.*;


import static net.minecraft.client.renderer.WorldRenderer.frustum;
import static org.lwjgl.opengl.GL11.glScalef;
import static org.lwjgl.opengl.GL11.glTranslatef;

@FunctionRegister(name = "Tags", type = Category.Render)
public class Tags extends Function {
    public ModeListSetting remove = new ModeListSetting("Включить", new BooleanSetting("Предметы", true), new BooleanSetting("Текст хп", true),new BooleanSetting("Индикация предметов",false));
    private final ModeSetting colores = new ModeSetting("Тип", "Клиент", "Клиент","Свой");
    public ColorSetting colordeft = new ColorSetting("Цвет",ColorUtils.rgb(255,255,255)).setVisible(() -> colores.is("Свой"));
    public ColorSetting colorfr = new ColorSetting("Цвет друга",ColorUtils.rgb(255,255,255)).setVisible(() -> colores.is("Свой"));
    public Tags() {
        addSettings(remove,colores,colordeft,colorfr);
    }

    private final HashMap<Entity, Vector4f> positions = new HashMap<>();

    public ColorSetting color = new ColorSetting("Color", -1);

    @Subscribe
    public void onDisplay(EventDisplay e) {
        // Проверяем, что мир загружен и тип события - PRE
        if (mc.world == null || e.getType() != EventDisplay.Type.PRE) {
            return;
        }

        positions.clear(); // Очищаем список позиций

        // Получаем цвета для отображения
        Vector4i colors = new Vector4i(
                HUD.getColor(0, 1),
                HUD.getColor(90, 1),
                HUD.getColor(180, 1),
                HUD.getColor(270, 1)
        );

        Vector4i friendColors = new Vector4i(
                HUD.getColor(ColorUtils.rgb(144, 238, 144), ColorUtils.rgb(0, 139, 0), 0, 1),
                HUD.getColor(ColorUtils.rgb(144, 238, 144), ColorUtils.rgb(0, 139, 0), 90, 1),
                HUD.getColor(ColorUtils.rgb(144, 238, 144), ColorUtils.rgb(0, 139, 0), 180, 1),
                HUD.getColor(ColorUtils.rgb(144, 238, 144), ColorUtils.rgb(0, 139, 0), 270, 1)
        );

        // Проходим по всем сущностям в мире
        for (Entity entity : mc.world.getAllEntities()) {
            // Проверяем валидность сущности
            if (!isValid(entity)) continue;

            // Проверяем, что это игрок или предмет
            if (!(entity instanceof PlayerEntity) && !(entity instanceof ItemEntity)) continue;

            // Пропускаем игрока в первом лице
            if (entity == mc.player && (mc.gameSettings.getPointOfView() == PointOfView.FIRST_PERSON)) continue;

            // Интерполяция позиции сущности
            double x = MathUtil.interpolate(entity.getPosX(), entity.lastTickPosX, e.getPartialTicks());
            double y = MathUtil.interpolate(entity.getPosY(), entity.lastTickPosY, e.getPartialTicks());
            double z = MathUtil.interpolate(entity.getPosZ(), entity.lastTickPosZ, e.getPartialTicks());

            // Получаем размер сущности
            Vector3d size = new Vector3d(
                    entity.getBoundingBox().maxX - entity.getBoundingBox().minX,
                    entity.getBoundingBox().maxY - entity.getBoundingBox().minY,
                    entity.getBoundingBox().maxZ - entity.getBoundingBox().minZ
            );

            // Создаем AxisAlignedBB для сущности
            AxisAlignedBB aabb = new AxisAlignedBB(
                    x - size.x / 1.5f,
                    y,
                    z - size.z / 1.5f,
                    x + size.x / 1.5f,
                    y + size.y + 0.1f,
                    z + size.z / 1.5f
            );

            Vector4f position = null;

            // Проектируем углы AABB
            for (int i = 0; i < 8; i++) {
                Vector2f vector = ProjectionUtil.project(
                        i % 2 == 0 ? aabb.minX : aabb.maxX,
                        (i / 2) % 2 == 0 ? aabb.minY : aabb.maxY,
                        (i / 4) % 2 == 0 ? aabb.minZ : aabb.maxZ
                );

                // Обновляем позицию
                if (position == null) {
                    position = new Vector4f(vector.x, vector.y, 1, 1.0f);
                } else {
                    position.x = Math.min(vector.x, position.x);
                    position.y = Math.min(vector.y, position.y);
                    position.z = Math.max(vector.x, position.z);
                    position.w = Math.max(vector.y, position.w);
                }
            }

            // Сохраняем позицию для сущности
            positions.put(entity, position);
        }



        RenderSystem.enableBlend();
        RenderSystem.disableTexture();
        RenderSystem.defaultBlendFunc();
        RenderSystem.shadeModel(7425);
        buffer.endVertex();
        buffer.begin(7, DefaultVertexFormats.POSITION_COLOR);
        for (Map.Entry<Entity, Vector4f> entry : positions.entrySet()) {
            Vector4f position = entry.getValue();
            if (entry.getKey() instanceof LivingEntity entity) {







            }
        }
        Tessellator.getInstance().draw();
        RenderSystem.shadeModel(7424);
        RenderSystem.enableTexture();
        RenderSystem.disableBlend();

        for (Map.Entry<Entity, Vector4f> entry : positions.entrySet()) {
            Entity entity = entry.getKey();

            if (entity instanceof LivingEntity living) {
                Score score = mc.world.getScoreboard().getOrCreateScore(living.getScoreboardName(), mc.world.getScoreboard().getObjectiveInDisplaySlot(2));
                float hp = living.getHealth();
                float maxHp = living.getMaxHealth();

                String header = mc.ingameGUI.getTabList().header == null ? " " : mc.ingameGUI.getTabList().header.getString().toLowerCase();


                if (mc.getCurrentServerData() != null && mc.getCurrentServerData().serverIP.contains("funtime") && (header.contains("анархия") || header.contains("гриферский"))) {
                    hp = score.getScorePoints();
                    maxHp = 20;
                }

                Vector4f position = entry.getValue();
                float width = position.z - position.x;

                String hpText = (int) hp + "HP";
                float hpWidth = Fonts.montserrat.getWidth(hpText, 5);

                float hpPercent = MathHelper.clamp(hp / maxHp, 0, 1);
                float hpPosY = position.y + (position.w - position.y) * (1 - hpPercent);
                if (remove.getValueByName("Текст хп").get()) {
                    Fonts.montserrat.drawText(e.getMatrixStack(), hpText, position.x - hpWidth - 6, hpPosY, -1, 0, 0.05f);
                }
                String hptext1 =  (int) hp + "";
                ITextComponent text = entity.getDisplayName();
                TextComponent name = (TextComponent)text;
                name.append(new StringTextComponent(" [" + TextFormatting.GREEN + (int) hp + TextFormatting.WHITE + "]"));
                float length = mc.fontRenderer.getStringPropertyWidth(name);
                GL11.glPushMatrix();
                glCenteredScale(position.x + width / 2f - length / 2f, position.y - 7, length, 10, 0.5f);
                if(FriendStorage.isFriend(entity.getName().getString())) {
                    DisplayUtils.drawRoundedRect(position.x - 2 + width / 2.0F - length / 1.9f, position.y - 16, length + 8, 14, 2, ColorUtils.rgba(10, 92, 1, 150));
                }else {
                    DisplayUtils.drawRoundedRect(position.x - 2 + width / 2.0F - length / 1.9f , position.y - 16, length + 8, 14, 2, ColorUtils.rgba(10, 10, 10, 100));
                }
                mc.fontRenderer.func_243246_a(e.getMatrixStack(), name, position.x + width/2.0f - length / 2f , position.y - 13, -1);
                if(entity instanceof PlayerEntity player){
                    if(remove.getValueByName("Индикация предметов").get()) {
                        ItemStack stack = player.getHeldItemOffhand();
                        String nameS = "";

                        String itemName = stack.getDisplayName().getString();
                        if (stack.getItem() == Items.PLAYER_HEAD) {
                            CompoundNBT tag = stack.getTag();

                            if (tag != null && tag.contains("display", 10)) {
                                CompoundNBT display = tag.getCompound("display");

                                if (display.contains("Lore", 9)) {
                                    ListNBT lore = display.getList("Lore", 8);

                                    if (!lore.isEmpty()) {
                                        String firstLore = lore.getString(0);

                                        int levelIndex = firstLore.indexOf("Уровень");
                                        if (levelIndex != -1) {
                                            String levelString = firstLore.substring(levelIndex + "Уровень".length()).trim();
                                            String gat = levelString;
                                            if (gat.contains("1/3")) {
                                                nameS = "- 1/3]";
                                            } else if (gat.contains("2/3")) {
                                                nameS = "- 2/3]";
                                            } else if (gat.contains("MAX")) {
                                                nameS = "- MAX]";
                                            } else {
                                                nameS = "";
                                            }
                                        }
                                    }
                                }
                            }
                            if (itemName.contains("Пандо")) {
                                itemName = "[PANDORA ";
                            } else if (itemName.contains("Аполл")) {
                                itemName = "[APOLLON ";
                            } else if (itemName.contains("Тит")) {
                                itemName = "[TITANA ";
                            } else if (itemName.contains("Осир")) {
                                itemName = "[OSIRIS ";
                            } else if (itemName.contains("Андро")) {
                                itemName = "[ANDROMEDA";
                            } else if (itemName.contains("Хим")) {
                                itemName = "[XIMERA ";
                            } else if (itemName.contains("Астр")) {
                                itemName = "[ASTREYA ";
                            }
                            Fonts.sfMedium.drawText(e.getMatrixStack(), itemName + nameS, (float) position.x - 15, position.y - 55, ColorUtils.rgb(255, 255,255), 10.5f, 0.0001f);
                        }
                    }
                }GL11.glPopMatrix();

                drawItems(e.getMatrixStack(), living, (int) (position.x + width / 2f), (int) (position.y - 20));
            } else if (entity instanceof ItemEntity item) {
                MatrixStack stack = new MatrixStack();
                if (remove.getValueByName("Предметы").get()) {
                    GL11.glPushMatrix();
                    Vector4f position = entry.getValue();


                    float width = position.z - position.x;

                    ITextComponent textComponent = item.getItem().getDisplayName();
                    TextComponent tag = (TextComponent)textComponent;
                    tag.append(new StringTextComponent(item.getItem().getCount() < 1 ? "" : " x" + item.getItem().getCount()));
                    float length = mc.fontRenderer.getStringPropertyWidth(tag);
                    glCenteredScale(position.x + width / 2f - length / 2f, position.y - 7, length, 10, 0.5f);
                    DisplayUtils.drawRoundedRect(position.x - 5 + width / 2f - length / 2f, position.y - 16, length + 10, 16, 2, ColorUtils.rgba(10, 10, 10, 150));
                    mc.fontRenderer.func_243246_a(e.getMatrixStack(), tag, position.x + width/2.0f - length / 2f, position.y - 12, -1);
                    //Fonts.sfui.drawText(e.getMatrixStack(),tag,position.x + width/2.0f - length / 2f, position.y - 14,13,255);
                    GL11.glPopMatrix();
                }
            }
        }
    }
    public static int getHealthColor(final LivingEntity entity, final int c1, final int c2) {
        final float health = entity.getHealth();
        final float maxHealth = entity.getMaxHealth();
        final float hpPercentage = health / maxHealth;
        final int red = (int) ((c2 >> 16 & 0xFF) * hpPercentage + (c1 >> 16 & 0xFF) * (1.0f - hpPercentage));
        final int green = (int) ((c2 >> 8 & 0xFF) * hpPercentage + (c1 >> 8 & 0xFF) * (1.0f - hpPercentage));
        final int blue = (int) ((c2 & 0xFF) * hpPercentage + (c1 & 0xFF) * (1.0f - hpPercentage));
        return new java.awt.Color(red, green, blue).getRGB();
    }
    public ModeListSetting getRemove() {
        return remove;
    }

    public HashMap<Entity, Vector4f> getPositions() {
        return positions;
    }

    public ColorSetting getColor() {
        return color;
    }

    public boolean isInView(Entity ent) {

        if (mc.getRenderViewEntity() == null) {
            return false;
        }
        frustum.setCameraPosition(mc.getRenderManager().info.getProjectedView().x, mc.getRenderManager().info.getProjectedView().y, mc.getRenderManager().info.getProjectedView().z);
        return frustum.isBoundingBoxInFrustum(ent.getBoundingBox()) || ent.ignoreFrustumCheck;
    }

    private void drawPotions(MatrixStack matrixStack, LivingEntity entity, float posX, float posY) {
        for (EffectInstance pot : entity.getActivePotionEffects()) {
            int amp = pot.getAmplifier();

            String ampStr = "";

            if (amp >= 1 && amp <= 9) {
                ampStr = " " + I18n.format("" + (amp + 1));
            }

            String text = I18n.format(pot.getEffectName()) + ampStr + " - " + EffectUtils.getPotionDurationString(pot, 1);

            Fonts.consolas.drawText(matrixStack, text, posX, posY, -1, 5, 0.05f);

            posY += Fonts.consolas.getHeight(6);
        }
    }

    private void drawItems(MatrixStack matrixStack, LivingEntity entity, int posX, int posY) {
        int size = 8;
        int padding = 6;

        float fontHeight = Fonts.consolas.getHeight(6);

        List<ItemStack> items = new ArrayList<>();

        ItemStack mainStack = entity.getHeldItemMainhand();

        if (!mainStack.isEmpty()) {
            items.add(mainStack);
        }

        for (ItemStack itemStack : entity.getArmorInventoryList()) {
            if (itemStack.isEmpty()) continue;
            items.add(itemStack);
        }

        ItemStack offStack = entity.getHeldItemOffhand();

        if (!offStack.isEmpty()) {
            items.add(offStack);
        }

        posX -= (items.size() * (size + padding)) / 2f;

        for (ItemStack itemStack : items) {
            if (itemStack.isEmpty()) continue;

            GL11.glPushMatrix();

            glCenteredScale(posX, posY, size / 2f, size / 2f, 0.5f);

            mc.getItemRenderer().renderItemAndEffectIntoGUI(itemStack, posX, posY);
            mc.getItemRenderer().renderItemOverlayIntoGUI(mc.fontRenderer, itemStack, posX, posY, null);

            GL11.glPopMatrix();

        }
    }
    public boolean isValid(Entity e) {
        if (AntiBot.isBot(e)) return false;

        return isInView(e);
    }

    public void glCenteredScale(final float x, final float y, final float w, final float h, final float f) {
        glTranslatef(x + w / 2, y + h / 2, 0);
        glScalef(f, f, 1);
        glTranslatef(-x - w / 2, -y - h / 2, 0);
    }
    public static void drawMcRect(
            double left,
            double top,
            double right,
            double bottom,
            int color) {
        if (left < right) {
            double i = left;
            left = right;
            right = i;
        }

        if (top < bottom) {
            double j = top;
            top = bottom;
            bottom = j;
        }

        float f3 = (float) (color >> 24 & 255) / 255.0F;
        float f = (float) (color >> 16 & 255) / 255.0F;
        float f1 = (float) (color >> 8 & 255) / 255.0F;
        float f2 = (float) (color & 255) / 255.0F;
        BufferBuilder bufferbuilder = Tessellator.getInstance().getBuffer();

        bufferbuilder.pos(left, bottom, 1.0F).color(f, f1, f2, f3).endVertex();
        bufferbuilder.pos(right, bottom, 1.0F).color(f, f1, f2, f3).endVertex();
        bufferbuilder.pos(right, top, 1.0F).color(f, f1, f2, f3).endVertex();
        bufferbuilder.pos(left, top, 1.0F).color(f, f1, f2, f3).endVertex();

    }
}
Java:
Expand Collapse Copy
package ru.prodlasio.mixin;

import net.minecraft.client.render.entity.PlayerEntityRenderer;
import net.minecraft.entity.LivingEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import ru.prodlasio.feature.FeatureManager;
import ru.prodlasio.feature.in.render.NameTags;

@Mixin(PlayerEntityRenderer.class)
public class MixinPlayerEntityRender<T extends LivingEntity> {
    @Inject(method = "renderLabelIfPresent*", at = @At("HEAD"), cancellable = true)
    private void renderLabelIfPresent(CallbackInfo ci) {
        if (FeatureManager.get(NameTags.class).isState()) {
            ci.cancel();
        }
    }
}
 
В миксине отменяй если функция включена
 
как убрать майнкрафторские мазги
 
Назад
Сверху Снизу