Визуальная часть FontRender Color Items MCP 1.16.5

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
8 Мар 2024
Сообщения
844
Реакции
3
Выберите загрузчик игры
  1. OptiFine

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

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

Спасибо!

(класс рендера фонта):
Expand Collapse Copy
  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;
    }


тутор как юзать:
Expand Collapse Copy
     Fonts.getSize(14, Fonts.Type.MEDIUM).drawStringItem(
                event.getMatrixStack(),
                displayComponent,
                stack,/* ItemStack stack = itemEntity.getItem();*/
                screenPos.x - totalWidth / 2.0f - 1.0f,
                screenPos.y,   
                0xFFFFFFFF
        );
ss-
1749789560780.png

надеюсь этот шедевр будет в пасте под именем монотон)
 
(класс рендера фонта):
Expand Collapse Copy
  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;
    }


тутор как юзать:
Expand Collapse Copy
     Fonts.getSize(14, Fonts.Type.MEDIUM).drawStringItem(
                event.getMatrixStack(),
                displayComponent,
                stack,/* ItemStack stack = itemEntity.getItem();*/
                screenPos.x - totalWidth / 2.0f - 1.0f,
                screenPos.y,  
                0xFFFFFFFF
        );
ss-Посмотреть вложение 308767
надеюсь этот шедевр будет в пасте под именем монотон)
up
 
ебать криво и хуева
 
Пиздец братишка
 
(класс рендера фонта):
Expand Collapse Copy
  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;
    }


тутор как юзать:
Expand Collapse Copy
     Fonts.getSize(14, Fonts.Type.MEDIUM).drawStringItem(
                event.getMatrixStack(),
                displayComponent,
                stack,/* ItemStack stack = itemEntity.getItem();*/
                screenPos.x - totalWidth / 2.0f - 1.0f,
                screenPos.y,  
                0xFFFFFFFF
        );
ss-Посмотреть вложение 308767
надеюсь этот шедевр будет в пасте под именем монотон)
пиздец какойта...
 
(класс рендера фонта):
Expand Collapse Copy
  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;
    }


тутор как юзать:
Expand Collapse Copy
     Fonts.getSize(14, Fonts.Type.MEDIUM).drawStringItem(
                event.getMatrixStack(),
                displayComponent,
                stack,/* ItemStack stack = itemEntity.getItem();*/
                screenPos.x - totalWidth / 2.0f - 1.0f,
                screenPos.y,  
                0xFFFFFFFF
        );
ss-Посмотреть вложение 308767
надеюсь этот шедевр будет в пасте под именем монотон)
/del
 
да ебать вы все ищаки :expressionless:

скажешь че не так?
это можно сделать не создавая лишние методы по типу drawStyledComponentnITextdmsapkfjpaisdg типа того, для тебе же там всё готово 😥
 
drawStringItem, сука какой позорной нахуй, кодером монотана на тебя похуй
 
drawStringItem, сука какой позорной нахуй, кодером монотана на тебя похуй
ты даун? монотон мне член сосать за функции,армор дурабилити у меня спастили)
drawStringItem, сука какой позорной нахуй, кодером монотана на тебя похуй
а че не так то скажи????????
это можно сделать не создавая лишние методы по типу drawStyledComponentnITextdmsapkfjpaisdg типа того, для тебе же там всё готово 😥
нет
 
Последнее редактирование:
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
насрал говна :bayan: :bayan:
 
мне нравиться
 
Назад
Сверху Снизу