Подпишитесь на наш Telegram-канал, чтобы всегда быть в курсе важных обновлений! Перейти

Вопрос Box for Itemesp

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
17 Мар 2023
Сообщения
81
Реакции
1
захотел сделать бокс для itemesp белый такой но получился полный пиздец он улетает в небеса
ss так выглядит обычный айтемесп что рект под шрифтом
rect.png






и вот так с боксом когда включаю елемент бокс в itemesp то рект пропадает но появляеться бокс на хуй пойми что
ss далее ниже оставлю код знающие люди скажите как сделать


box.png



знающие подскажите
бокс начинаеться со строк 28-35
Java:
Expand Collapse Copy
    public MultiBooleanSetting elements = new MultiBooleanSetting("Elements", Arrays.asList("Box"));
    @EventTarget
    public void onDisplay(EventRender2D eventRender2D) {
        for (Entity entity : ItemESP.mc.world.loadedEntityList) {
            if (!(entity instanceof EntityItem) || !RenderUtility.isInViewFrustum(entity)) continue;
            double x = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double)mc.getRenderPartialTicks();
            double y = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double)mc.getRenderPartialTicks();
            double z = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * (double)mc.getRenderPartialTicks();
            double width = (double)entity.width / 1.5;
            double height = entity.height + 0.2f;
            AxisAlignedBB aabb = new AxisAlignedBB(x - width, y, z - width, x + width, y + height, z + width);
            Vec3d[] vectors = new Vec3d[]{new Vec3d(aabb.minX, aabb.minY, aabb.minZ), new Vec3d(aabb.minX, aabb.maxY, aabb.minZ), new Vec3d(aabb.maxX, aabb.minY, aabb.minZ), new Vec3d(aabb.maxX, aabb.maxY, aabb.minZ), new Vec3d(aabb.minX, aabb.minY, aabb.maxZ), new Vec3d(aabb.minX, aabb.maxY, aabb.maxZ), new Vec3d(aabb.maxX, aabb.minY, aabb.maxZ), new Vec3d(aabb.maxX, aabb.maxY, aabb.maxZ)};
            ItemESP.mc.entityRenderer.setupCameraTransform(mc.getRenderPartialTicks(), 0);
            ScaledResolution sr = eventRender2D.getResolution();
            Vector4f position = null;
            for (Vec3d vector : vectors) {
                vector = RenderUtility.project2D(2, vector.x - ItemESP.mc.getRenderManager().renderPosX, vector.y - ItemESP.mc.getRenderManager().renderPosY, vector.z - ItemESP.mc.getRenderManager().renderPosZ);
                if (vector == null || !(vector.z > 0.0) || !(vector.z < 1.0)) continue;
                if (position == null) {
                    position = new Vector4f((float)vector.x, (float)vector.y, (float)vector.z, 0.0f);
                }
                    if (this.elements.get(0)) {
                    ItemESP.mc.entityRenderer.setupOverlayRendering(2);
                    double posX = position.x;
                    double posY = position.y;
                    double endPosX = position.z;
                    double endPosY = position.w;
                    RenderUtility.drawRectNoWH(posX - 1.0, posY, posX + 0.5, endPosY + 0.5, Color.black.getRGB());
                    RenderUtility.drawRectNoWH(posX - 1.0, posY - 0.5, endPosX + 0.5, posY + 0.5 + 0.5, Color.black.getRGB());
                    RenderUtility.drawRectNoWH(endPosX - 0.5 - 0.5, posY, endPosX + 0.5, endPosY + 0.5, Color.black.getRGB());
                    RenderUtility.drawRectNoWH(posX - 1.0, endPosY - 0.5 - 0.5, endPosX + 0.5, endPosY + 0.5, Color.black.getRGB());
                    RenderUtility.drawRectNoWH(posX - 0.5, posY, posX + 0.5 - 0.5, endPosY, -1);
                    RenderUtility.drawRectNoWH(posX, endPosY - 0.5, endPosX, endPosY, -1);
                    RenderUtility.drawRectNoWH(posX - 0.5, posY, endPosX, posY + 0.5, -1);
                    RenderUtility.drawRectNoWH(endPosX - 0.5, posY, endPosX, endPosY, -1);
                }
                position.x = (float)Math.min(vector.x, (double)position.x);
                position.y = (float)Math.min(vector.y, (double)position.y);
                position.z = (float)Math.max(vector.x, (double)position.z);
                position.w = (float)Math.max(vector.y, (double)position.w);
            }
            if (position != null) {
                ItemESP.mc.entityRenderer.setupOverlayRendering(2);
                double posX = position.x;
                double posY = position.y;
                double endPosX = position.z;
                int build = -1;
                int bgWidth = Fonts.mntsb13.getStringWidth(((EntityItem)entity).getItem().getDisplayName() + ((EntityItem)entity).getItem().stackSize) + 11;
                String tag = ((EntityItem)entity).getItem().getDisplayName().toLowerCase() + (((EntityItem)entity).getItem().stackSize < 1 ? " " : "  x" + ((EntityItem)entity).getItem().stackSize);
                RenderUtility.drawRoundedRect((float)(posX + ((endPosX - posX) / 2.0 - 3.0) - (double)(Fonts.mntsb12.getStringWidth(tag) / 2)), (float)(posY - 13.0), bgWidth, Fonts.mntsb12.getFontHeight() + 7, 3.0f, new Color(28, 28, 28, 128).getRGB());
                Fonts.mntsb12.drawStringWithOutline(tag, (float)(posX + (endPosX - posX) / 2.0 - (double)(Fonts.mntsb12.getStringWidth(tag) / 2)), (float)(posY - 9.0), build);
            }
            GlStateManager.enableBlend();
            ItemESP.mc.entityRenderer.setupOverlayRendering();
        }
    }
}
 
Ты блять начни писать нормальный код и все баги мигом пройдут, как в этом ДЕРЬМЕ можно хоть что-то разобрать
 
Назад
Сверху Снизу