public static final Color aqua = new Color(0x55FFFF);
    public static final Color light_purple = new Color(0xFF55FF);
    public static final Color yellow = new Color(0xFFFF55);
    public static final Color white = new Color(0xFFFFFF);
private float drawStyledComponent(Matrix4f matrix4f, ITextComponent textComponent, ItemStack stack, float f, float f2, int n) {
        if (textComponent == null) {
            return 0.0f;
        }
        Style style = textComponent.getStyle();
        //пот
        Color rarity = switch (stack.getRarity()) {
            case COMMON -> white;
            case UNCOMMON -> yellow;
            case RARE -> aqua;
            case EPIC -> light_purple;
        };
        int defaultColor = style.getColor() == null ? rarity.getRGB() : ColorUtils.setAlpha(-16777216, n) | ColorUtils.setAlpha(style.getColor().getColor(), n);
        int currentColor = defaultColor;
        String text = textComponent.getSiblings().isEmpty()
                ? textComponent.getString()
                : textComponent.getUnformattedComponentText();
        char[] chars = text.toCharArray();
        for (int i = 0; i < chars.length; ++i) {
            char currentChar = chars[i];
            if (currentChar == '§' && i + 1 < chars.length) {
                char formatChar = Character.toLowerCase(chars[i + 1]);
                TextFormatting format = TextFormatting.fromFormattingCode(formatChar);
                if (format != null) {
                    if (format.isColor()) {
                        currentColor = 0xFF000000 | format.getColor();
                    } else if (format == TextFormatting.RESET) {
                        currentColor = defaultColor;
                    }
                    ++i;
                    continue;
                }
            }
            Glyph glyph = this.locateGlyph(currentChar);
            if (glyph != null &&  /*модер пи^^^*/ glyph.value() != ' ') {
                ResourceLocation texture = glyph.owner().bindToTexture;
                DrawEntry drawEntry = new DrawEntry(f, f2, currentColor, glyph);
                this.GLYPH_PAGE_CACHE.computeIfAbsent(texture, k -> new ObjectArrayList<>()).add(drawEntry);
            }
            if (glyph != null) {
                f += (float)glyph.width();
            }
        }
        if (!textComponent.getSiblings().isEmpty()) {
            for (ITextComponent sibling : textComponent.getSiblings()) {
                f = this.drawStyledComponent(matrix4f, sibling, stack, f, f2, n);
            }
        }
        return f;
    }