Исходник Potions Nursultan Nextgen 1.16.5 | Expensive 3.1 ready

Начинающий
Статус
Оффлайн
Регистрация
5 Ноя 2023
Сообщения
147
Реакции[?]
0
Поинты[?]
1K
ss -
Пожалуйста, авторизуйтесь для просмотра ссылки.


картинка -
Пожалуйста, авторизуйтесь для просмотра ссылки.


Код:
@FieldDefaults(level = AccessLevel.PRIVATE)
@RequiredArgsConstructor
public class PotionRenderer implements ElementRenderer {


    final Dragging dragging;
    final ResourceLocation logo = new ResourceLocation("cosmohack/images/hud/potion1.png");
    float iconSizeX = 10;
    float iconSizeY = 10;


    float width;
    float height;

    float width1;
    float height1;

    @Override
    public void render(EventDisplay eventDisplay) {
        MatrixStack ms = eventDisplay.getMatrixStack();

        float posX = dragging.getX();
        float posY = dragging.getY();
        float fontSize = 6.5f;
        float padding = 5;

        ITextComponent name = GradientUtil.gradient("Potions");
        String namemod = "Active Potions";

        float finalPosY = posY;
        drawStyledRect(posX, finalPosY, width + 5, height + -3, 3);

//        DisplayUtils.drawShadow(posX, posY, width, height, 15, ColorUtils.rgba(21,24,40,165));

        Scissor.push();
        Scissor.setFromComponentCoordinates(posX, posY, width, height);
        Fonts.sfui.drawText(ms, namemod, posX + padding + 17, posY + padding + -1, ColorUtils.rgb(255, 255, 255), fontSize);
        DisplayUtils.drawRectHorizontalW(posX + 17, posY + 3f, width1 + -9.5f,  9, ColorUtils.rgba(70, 70, 70, 255), ColorUtils.rgba(70, 70, 70, 255));

        posY += fontSize + padding * 2;

        float maxWidth = Fonts.sfMedium.getWidth(name, fontSize) + padding * 2;
        float localHeight = fontSize + padding * 2;

        for (EffectInstance ef : mc.player.getActivePotionEffects()) {
            int amp = ef.getAmplifier();

            String ampStr = "";

            if (amp >= 1 && amp <= 9) {
                ampStr = " " + I18n.format("enchantment.level." + (amp + 1));
            }
            String nameText = I18n.format(ef.getEffectName()) + ampStr;
            float nameWidth = Fonts.sfMedium.getWidth(nameText, fontSize);

            String bindText = EffectUtils.getPotionDurationString(ef, 1);
            float bindWidth = Fonts.sfMedium.getWidth(bindText, fontSize);

            float localWidth = nameWidth + bindWidth + padding * 3;

            Effect effect = ef.getPotion();

            Fonts.sfMedium.drawText(ms, nameText, posX + padding + 12, posY + 4, ColorUtils.rgba(255, 255, 255, 255), fontSize + -1);
            Fonts.sfMedium.drawText(ms, bindText, posX + width - padding - bindWidth + 3, posY + 3.5f, ColorUtils.rgba(255, 255, 255, 255), fontSize);

            DisplayUtils.drawRectHorizontalW(posX + 15, posY + 2.5f, width1 + -9.5f,  8, ColorUtils.rgba(70, 70, 70, 255), ColorUtils.rgba(70, 70, 70, 255));
            PotionSpriteUploader potionspriteuploader = mc.getPotionSpriteUploader();
            TextureAtlasSprite textureatlassprite = potionspriteuploader.getSprite(effect);
            mc.getTextureManager().bindTexture(textureatlassprite.getAtlasTexture().getTextureLocation());
            DisplayEffectsScreen.blit(ms, (int) (posX + padding + -2), (int) posY - -2, 14, 9, 9, textureatlassprite);
            if (localWidth > maxWidth) {
                maxWidth = localWidth;
            }

            if (localWidth > maxWidth) {
                maxWidth = localWidth;
            }

            posY += (fontSize + padding);
            localHeight += (fontSize + padding);
        }

        width = Math.max(maxWidth, 80);
        height = localHeight + 2.5f;
        width1 = 10;
        height1 = localHeight +  2.5f;
        dragging.setWidth(width);
        dragging.setHeight(height);

        float imagePosX = posX + 100 - iconSizeX - padding;
        DisplayUtils.drawImage(logo, imagePosX + -81.5f, finalPosY + 3f, iconSizeX , iconSizeY, ColorUtils.rgb(255, 255, 255));

        Scissor.unset();
        Scissor.pop();
    }

    private void drawStyledRect(
                                    float x,
                                float y,
                                float width,
                                float height,
                                float radius) {

        DisplayUtils.drawRoundedRect(x - 0.5f, y - 0.5f, 90, 17, radius + 0.5f, ColorUtils.rgba(0, 0, 0, (int) (255 * 1)));
        DisplayUtils.drawRoundedRect(x, y + 17, width1 + 78.5f, height1 + -19, radius, ColorUtils.rgba(0, 0, 0, 255));
    }
}
 
Последнее редактирование:
Начинающий
Статус
Оффлайн
Регистрация
26 Фев 2024
Сообщения
353
Реакции[?]
0
Поинты[?]
0
ss -
Пожалуйста, авторизуйтесь для просмотра ссылки.


картинка -
Пожалуйста, авторизуйтесь для просмотра ссылки.


Код:
@FieldDefaults(level = AccessLevel.PRIVATE)
@RequiredArgsConstructor
public class PotionRenderer implements ElementRenderer {


    final Dragging dragging;
    final ResourceLocation logo = new ResourceLocation("cosmohack/images/hud/potion1.png");
    float iconSizeX = 10;
    float iconSizeY = 10;


    float width;
    float height;

    float width1;
    float height1;

    @Override
    public void render(EventDisplay eventDisplay) {
        MatrixStack ms = eventDisplay.getMatrixStack();

        float posX = dragging.getX();
        float posY = dragging.getY();
        float fontSize = 6.5f;
        float padding = 5;

        ITextComponent name = GradientUtil.gradient("Potions");
        String namemod = "Active Potions";

        float finalPosY = posY;
        drawStyledRect(posX, finalPosY, width + 5, height + -3, 3);

//        DisplayUtils.drawShadow(posX, posY, width, height, 15, ColorUtils.rgba(21,24,40,165));

        Scissor.push();
        Scissor.setFromComponentCoordinates(posX, posY, width, height);
        Fonts.sfui.drawText(ms, namemod, posX + padding + 17, posY + padding + -1, ColorUtils.rgb(255, 255, 255), fontSize);
        DisplayUtils.drawRectHorizontalW(posX + 17, posY + 3f, width1 + -9.5f,  9, ColorUtils.rgba(70, 70, 70, 255), ColorUtils.rgba(70, 70, 70, 255));

        posY += fontSize + padding * 2;

        float maxWidth = Fonts.sfMedium.getWidth(name, fontSize) + padding * 2;
        float localHeight = fontSize + padding * 2;

        for (EffectInstance ef : mc.player.getActivePotionEffects()) {
            int amp = ef.getAmplifier();

            String ampStr = "";

            if (amp >= 1 && amp <= 9) {
                ampStr = " " + I18n.format("enchantment.level." + (amp + 1));
            }
            String nameText = I18n.format(ef.getEffectName()) + ampStr;
            float nameWidth = Fonts.sfMedium.getWidth(nameText, fontSize);

            String bindText = EffectUtils.getPotionDurationString(ef, 1);
            float bindWidth = Fonts.sfMedium.getWidth(bindText, fontSize);

            float localWidth = nameWidth + bindWidth + padding * 3;

            Effect effect = ef.getPotion();

            Fonts.sfMedium.drawText(ms, nameText, posX + padding + 12, posY + 4, ColorUtils.rgba(255, 255, 255, 255), fontSize + -1);
            Fonts.sfMedium.drawText(ms, bindText, posX + width - padding - bindWidth + 3, posY + 3.5f, ColorUtils.rgba(255, 255, 255, 255), fontSize);

            DisplayUtils.drawRectHorizontalW(posX + 15, posY + 2.5f, width1 + -9.5f,  8, ColorUtils.rgba(70, 70, 70, 255), ColorUtils.rgba(70, 70, 70, 255));
            PotionSpriteUploader potionspriteuploader = mc.getPotionSpriteUploader();
            TextureAtlasSprite textureatlassprite = potionspriteuploader.getSprite(effect);
            mc.getTextureManager().bindTexture(textureatlassprite.getAtlasTexture().getTextureLocation());
            DisplayEffectsScreen.blit(ms, (int) (posX + padding + -2), (int) posY - -2, 14, 9, 9, textureatlassprite);
            if (localWidth > maxWidth) {
                maxWidth = localWidth;
            }

            if (localWidth > maxWidth) {
                maxWidth = localWidth;
            }

            posY += (fontSize + padding);
            localHeight += (fontSize + padding);
        }

        width = Math.max(maxWidth, 80);
        height = localHeight + 2.5f;
        width1 = 10;
        height1 = localHeight +  2.5f;
        dragging.setWidth(width);
        dragging.setHeight(height);

        float imagePosX = posX + 100 - iconSizeX - padding;
        DisplayUtils.drawImage(logo, imagePosX + -81.5f, finalPosY + 3f, iconSizeX , iconSizeY, ColorUtils.rgb(255, 255, 255));

        Scissor.unset();
        Scissor.pop();
    }

    private void drawStyledRect(
                                    float x,
                                float y,
                                float width,
                                float height,
                                float radius) {

        DisplayUtils.drawRoundedRect(x - 0.5f, y - 0.5f, 90, 17, radius + 0.5f, ColorUtils.rgba(0, 0, 0, (int) (255 * 1)));
        DisplayUtils.drawRoundedRect(x, y + 17, width1 + 78.5f, height1 + -19, radius, ColorUtils.rgba(0, 0, 0, 255));
    }
}
бека
 
Начинающий
Статус
Оффлайн
Регистрация
16 Май 2024
Сообщения
137
Реакции[?]
1
Поинты[?]
1K
ss -
Пожалуйста, авторизуйтесь для просмотра ссылки.


картинка -
Пожалуйста, авторизуйтесь для просмотра ссылки.


Код:
@FieldDefaults(level = AccessLevel.PRIVATE)
@RequiredArgsConstructor
public class PotionRenderer implements ElementRenderer {


    final Dragging dragging;
    final ResourceLocation logo = new ResourceLocation("cosmohack/images/hud/potion1.png");
    float iconSizeX = 10;
    float iconSizeY = 10;


    float width;
    float height;

    float width1;
    float height1;

    @Override
    public void render(EventDisplay eventDisplay) {
        MatrixStack ms = eventDisplay.getMatrixStack();

        float posX = dragging.getX();
        float posY = dragging.getY();
        float fontSize = 6.5f;
        float padding = 5;

        ITextComponent name = GradientUtil.gradient("Potions");
        String namemod = "Active Potions";

        float finalPosY = posY;
        drawStyledRect(posX, finalPosY, width + 5, height + -3, 3);

//        DisplayUtils.drawShadow(posX, posY, width, height, 15, ColorUtils.rgba(21,24,40,165));

        Scissor.push();
        Scissor.setFromComponentCoordinates(posX, posY, width, height);
        Fonts.sfui.drawText(ms, namemod, posX + padding + 17, posY + padding + -1, ColorUtils.rgb(255, 255, 255), fontSize);
        DisplayUtils.drawRectHorizontalW(posX + 17, posY + 3f, width1 + -9.5f,  9, ColorUtils.rgba(70, 70, 70, 255), ColorUtils.rgba(70, 70, 70, 255));

        posY += fontSize + padding * 2;

        float maxWidth = Fonts.sfMedium.getWidth(name, fontSize) + padding * 2;
        float localHeight = fontSize + padding * 2;

        for (EffectInstance ef : mc.player.getActivePotionEffects()) {
            int amp = ef.getAmplifier();

            String ampStr = "";

            if (amp >= 1 && amp <= 9) {
                ampStr = " " + I18n.format("enchantment.level." + (amp + 1));
            }
            String nameText = I18n.format(ef.getEffectName()) + ampStr;
            float nameWidth = Fonts.sfMedium.getWidth(nameText, fontSize);

            String bindText = EffectUtils.getPotionDurationString(ef, 1);
            float bindWidth = Fonts.sfMedium.getWidth(bindText, fontSize);

            float localWidth = nameWidth + bindWidth + padding * 3;

            Effect effect = ef.getPotion();

            Fonts.sfMedium.drawText(ms, nameText, posX + padding + 12, posY + 4, ColorUtils.rgba(255, 255, 255, 255), fontSize + -1);
            Fonts.sfMedium.drawText(ms, bindText, posX + width - padding - bindWidth + 3, posY + 3.5f, ColorUtils.rgba(255, 255, 255, 255), fontSize);

            DisplayUtils.drawRectHorizontalW(posX + 15, posY + 2.5f, width1 + -9.5f,  8, ColorUtils.rgba(70, 70, 70, 255), ColorUtils.rgba(70, 70, 70, 255));
            PotionSpriteUploader potionspriteuploader = mc.getPotionSpriteUploader();
            TextureAtlasSprite textureatlassprite = potionspriteuploader.getSprite(effect);
            mc.getTextureManager().bindTexture(textureatlassprite.getAtlasTexture().getTextureLocation());
            DisplayEffectsScreen.blit(ms, (int) (posX + padding + -2), (int) posY - -2, 14, 9, 9, textureatlassprite);
            if (localWidth > maxWidth) {
                maxWidth = localWidth;
            }

            if (localWidth > maxWidth) {
                maxWidth = localWidth;
            }

            posY += (fontSize + padding);
            localHeight += (fontSize + padding);
        }

        width = Math.max(maxWidth, 80);
        height = localHeight + 2.5f;
        width1 = 10;
        height1 = localHeight +  2.5f;
        dragging.setWidth(width);
        dragging.setHeight(height);

        float imagePosX = posX + 100 - iconSizeX - padding;
        DisplayUtils.drawImage(logo, imagePosX + -81.5f, finalPosY + 3f, iconSizeX , iconSizeY, ColorUtils.rgb(255, 255, 255));

        Scissor.unset();
        Scissor.pop();
    }

    private void drawStyledRect(
                                    float x,
                                float y,
                                float width,
                                float height,
                                float radius) {

        DisplayUtils.drawRoundedRect(x - 0.5f, y - 0.5f, 90, 17, radius + 0.5f, ColorUtils.rgba(0, 0, 0, (int) (255 * 1)));
        DisplayUtils.drawRoundedRect(x, y + 17, width1 + 78.5f, height1 + -19, radius, ColorUtils.rgba(0, 0, 0, 255));
    }
}
+- нормально
 
Забаненный
Статус
Оффлайн
Регистрация
10 Ноя 2023
Сообщения
65
Реакции[?]
0
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
ss -
Пожалуйста, авторизуйтесь для просмотра ссылки.


картинка -
Пожалуйста, авторизуйтесь для просмотра ссылки.


Код:
@FieldDefaults(level = AccessLevel.PRIVATE)
@RequiredArgsConstructor
public class PotionRenderer implements ElementRenderer {


    final Dragging dragging;
    final ResourceLocation logo = new ResourceLocation("cosmohack/images/hud/potion1.png");
    float iconSizeX = 10;
    float iconSizeY = 10;


    float width;
    float height;

    float width1;
    float height1;

    @Override
    public void render(EventDisplay eventDisplay) {
        MatrixStack ms = eventDisplay.getMatrixStack();

        float posX = dragging.getX();
        float posY = dragging.getY();
        float fontSize = 6.5f;
        float padding = 5;

        ITextComponent name = GradientUtil.gradient("Potions");
        String namemod = "Active Potions";

        float finalPosY = posY;
        drawStyledRect(posX, finalPosY, width + 5, height + -3, 3);

//        DisplayUtils.drawShadow(posX, posY, width, height, 15, ColorUtils.rgba(21,24,40,165));

        Scissor.push();
        Scissor.setFromComponentCoordinates(posX, posY, width, height);
        Fonts.sfui.drawText(ms, namemod, posX + padding + 17, posY + padding + -1, ColorUtils.rgb(255, 255, 255), fontSize);
        DisplayUtils.drawRectHorizontalW(posX + 17, posY + 3f, width1 + -9.5f,  9, ColorUtils.rgba(70, 70, 70, 255), ColorUtils.rgba(70, 70, 70, 255));

        posY += fontSize + padding * 2;

        float maxWidth = Fonts.sfMedium.getWidth(name, fontSize) + padding * 2;
        float localHeight = fontSize + padding * 2;

        for (EffectInstance ef : mc.player.getActivePotionEffects()) {
            int amp = ef.getAmplifier();

            String ampStr = "";

            if (amp >= 1 && amp <= 9) {
                ampStr = " " + I18n.format("enchantment.level." + (amp + 1));
            }
            String nameText = I18n.format(ef.getEffectName()) + ampStr;
            float nameWidth = Fonts.sfMedium.getWidth(nameText, fontSize);

            String bindText = EffectUtils.getPotionDurationString(ef, 1);
            float bindWidth = Fonts.sfMedium.getWidth(bindText, fontSize);

            float localWidth = nameWidth + bindWidth + padding * 3;

            Effect effect = ef.getPotion();

            Fonts.sfMedium.drawText(ms, nameText, posX + padding + 12, posY + 4, ColorUtils.rgba(255, 255, 255, 255), fontSize + -1);
            Fonts.sfMedium.drawText(ms, bindText, posX + width - padding - bindWidth + 3, posY + 3.5f, ColorUtils.rgba(255, 255, 255, 255), fontSize);

            DisplayUtils.drawRectHorizontalW(posX + 15, posY + 2.5f, width1 + -9.5f,  8, ColorUtils.rgba(70, 70, 70, 255), ColorUtils.rgba(70, 70, 70, 255));
            PotionSpriteUploader potionspriteuploader = mc.getPotionSpriteUploader();
            TextureAtlasSprite textureatlassprite = potionspriteuploader.getSprite(effect);
            mc.getTextureManager().bindTexture(textureatlassprite.getAtlasTexture().getTextureLocation());
            DisplayEffectsScreen.blit(ms, (int) (posX + padding + -2), (int) posY - -2, 14, 9, 9, textureatlassprite);
            if (localWidth > maxWidth) {
                maxWidth = localWidth;
            }

            if (localWidth > maxWidth) {
                maxWidth = localWidth;
            }

            posY += (fontSize + padding);
            localHeight += (fontSize + padding);
        }

        width = Math.max(maxWidth, 80);
        height = localHeight + 2.5f;
        width1 = 10;
        height1 = localHeight +  2.5f;
        dragging.setWidth(width);
        dragging.setHeight(height);

        float imagePosX = posX + 100 - iconSizeX - padding;
        DisplayUtils.drawImage(logo, imagePosX + -81.5f, finalPosY + 3f, iconSizeX , iconSizeY, ColorUtils.rgb(255, 255, 255));

        Scissor.unset();
        Scissor.pop();
    }

    private void drawStyledRect(
                                    float x,
                                float y,
                                float width,
                                float height,
                                float radius) {

        DisplayUtils.drawRoundedRect(x - 0.5f, y - 0.5f, 90, 17, radius + 0.5f, ColorUtils.rgba(0, 0, 0, (int) (255 * 1)));
        DisplayUtils.drawRoundedRect(x, y + 17, width1 + 78.5f, height1 + -19, radius, ColorUtils.rgba(0, 0, 0, 255));
    }
}
Не плохо
 
Начинающий
Статус
Оффлайн
Регистрация
5 Ноя 2023
Сообщения
147
Реакции[?]
0
Поинты[?]
1K
Начинающий
Статус
Оффлайн
Регистрация
23 Апр 2024
Сообщения
181
Реакции[?]
0
Поинты[?]
1K
ss -
Пожалуйста, авторизуйтесь для просмотра ссылки.


картинка -
Пожалуйста, авторизуйтесь для просмотра ссылки.


Код:
@FieldDefaults(level = AccessLevel.PRIVATE)
@RequiredArgsConstructor
public class PotionRenderer implements ElementRenderer {


    final Dragging dragging;
    final ResourceLocation logo = new ResourceLocation("cosmohack/images/hud/potion1.png");
    float iconSizeX = 10;
    float iconSizeY = 10;


    float width;
    float height;

    float width1;
    float height1;

    @Override
    public void render(EventDisplay eventDisplay) {
        MatrixStack ms = eventDisplay.getMatrixStack();

        float posX = dragging.getX();
        float posY = dragging.getY();
        float fontSize = 6.5f;
        float padding = 5;

        ITextComponent name = GradientUtil.gradient("Potions");
        String namemod = "Active Potions";

        float finalPosY = posY;
        drawStyledRect(posX, finalPosY, width + 5, height + -3, 3);

//        DisplayUtils.drawShadow(posX, posY, width, height, 15, ColorUtils.rgba(21,24,40,165));

        Scissor.push();
        Scissor.setFromComponentCoordinates(posX, posY, width, height);
        Fonts.sfui.drawText(ms, namemod, posX + padding + 17, posY + padding + -1, ColorUtils.rgb(255, 255, 255), fontSize);
        DisplayUtils.drawRectHorizontalW(posX + 17, posY + 3f, width1 + -9.5f,  9, ColorUtils.rgba(70, 70, 70, 255), ColorUtils.rgba(70, 70, 70, 255));

        posY += fontSize + padding * 2;

        float maxWidth = Fonts.sfMedium.getWidth(name, fontSize) + padding * 2;
        float localHeight = fontSize + padding * 2;

        for (EffectInstance ef : mc.player.getActivePotionEffects()) {
            int amp = ef.getAmplifier();

            String ampStr = "";

            if (amp >= 1 && amp <= 9) {
                ampStr = " " + I18n.format("enchantment.level." + (amp + 1));
            }
            String nameText = I18n.format(ef.getEffectName()) + ampStr;
            float nameWidth = Fonts.sfMedium.getWidth(nameText, fontSize);

            String bindText = EffectUtils.getPotionDurationString(ef, 1);
            float bindWidth = Fonts.sfMedium.getWidth(bindText, fontSize);

            float localWidth = nameWidth + bindWidth + padding * 3;

            Effect effect = ef.getPotion();

            Fonts.sfMedium.drawText(ms, nameText, posX + padding + 12, posY + 4, ColorUtils.rgba(255, 255, 255, 255), fontSize + -1);
            Fonts.sfMedium.drawText(ms, bindText, posX + width - padding - bindWidth + 3, posY + 3.5f, ColorUtils.rgba(255, 255, 255, 255), fontSize);

            DisplayUtils.drawRectHorizontalW(posX + 15, posY + 2.5f, width1 + -9.5f,  8, ColorUtils.rgba(70, 70, 70, 255), ColorUtils.rgba(70, 70, 70, 255));
            PotionSpriteUploader potionspriteuploader = mc.getPotionSpriteUploader();
            TextureAtlasSprite textureatlassprite = potionspriteuploader.getSprite(effect);
            mc.getTextureManager().bindTexture(textureatlassprite.getAtlasTexture().getTextureLocation());
            DisplayEffectsScreen.blit(ms, (int) (posX + padding + -2), (int) posY - -2, 14, 9, 9, textureatlassprite);
            if (localWidth > maxWidth) {
                maxWidth = localWidth;
            }

            if (localWidth > maxWidth) {
                maxWidth = localWidth;
            }

            posY += (fontSize + padding);
            localHeight += (fontSize + padding);
        }

        width = Math.max(maxWidth, 80);
        height = localHeight + 2.5f;
        width1 = 10;
        height1 = localHeight +  2.5f;
        dragging.setWidth(width);
        dragging.setHeight(height);

        float imagePosX = posX + 100 - iconSizeX - padding;
        DisplayUtils.drawImage(logo, imagePosX + -81.5f, finalPosY + 3f, iconSizeX , iconSizeY, ColorUtils.rgb(255, 255, 255));

        Scissor.unset();
        Scissor.pop();
    }

    private void drawStyledRect(
                                    float x,
                                float y,
                                float width,
                                float height,
                                float radius) {

        DisplayUtils.drawRoundedRect(x - 0.5f, y - 0.5f, 90, 17, radius + 0.5f, ColorUtils.rgba(0, 0, 0, (int) (255 * 1)));
        DisplayUtils.drawRoundedRect(x, y + 17, width1 + 78.5f, height1 + -19, radius, ColorUtils.rgba(0, 0, 0, 255));
    }
}
а где нурсултан или что то похожее на него?
 
Начинающий
Статус
Оффлайн
Регистрация
3 Май 2024
Сообщения
182
Реакции[?]
0
Поинты[?]
0
ss -
Пожалуйста, авторизуйтесь для просмотра ссылки.


картинка -
Пожалуйста, авторизуйтесь для просмотра ссылки.


Код:
@FieldDefaults(level = AccessLevel.PRIVATE)
@RequiredArgsConstructor
public class PotionRenderer implements ElementRenderer {


    final Dragging dragging;
    final ResourceLocation logo = new ResourceLocation("cosmohack/images/hud/potion1.png");
    float iconSizeX = 10;
    float iconSizeY = 10;


    float width;
    float height;

    float width1;
    float height1;

    @Override
    public void render(EventDisplay eventDisplay) {
        MatrixStack ms = eventDisplay.getMatrixStack();

        float posX = dragging.getX();
        float posY = dragging.getY();
        float fontSize = 6.5f;
        float padding = 5;

        ITextComponent name = GradientUtil.gradient("Potions");
        String namemod = "Active Potions";

        float finalPosY = posY;
        drawStyledRect(posX, finalPosY, width + 5, height + -3, 3);

//        DisplayUtils.drawShadow(posX, posY, width, height, 15, ColorUtils.rgba(21,24,40,165));

        Scissor.push();
        Scissor.setFromComponentCoordinates(posX, posY, width, height);
        Fonts.sfui.drawText(ms, namemod, posX + padding + 17, posY + padding + -1, ColorUtils.rgb(255, 255, 255), fontSize);
        DisplayUtils.drawRectHorizontalW(posX + 17, posY + 3f, width1 + -9.5f,  9, ColorUtils.rgba(70, 70, 70, 255), ColorUtils.rgba(70, 70, 70, 255));

        posY += fontSize + padding * 2;

        float maxWidth = Fonts.sfMedium.getWidth(name, fontSize) + padding * 2;
        float localHeight = fontSize + padding * 2;

        for (EffectInstance ef : mc.player.getActivePotionEffects()) {
            int amp = ef.getAmplifier();

            String ampStr = "";

            if (amp >= 1 && amp <= 9) {
                ampStr = " " + I18n.format("enchantment.level." + (amp + 1));
            }
            String nameText = I18n.format(ef.getEffectName()) + ampStr;
            float nameWidth = Fonts.sfMedium.getWidth(nameText, fontSize);

            String bindText = EffectUtils.getPotionDurationString(ef, 1);
            float bindWidth = Fonts.sfMedium.getWidth(bindText, fontSize);

            float localWidth = nameWidth + bindWidth + padding * 3;

            Effect effect = ef.getPotion();

            Fonts.sfMedium.drawText(ms, nameText, posX + padding + 12, posY + 4, ColorUtils.rgba(255, 255, 255, 255), fontSize + -1);
            Fonts.sfMedium.drawText(ms, bindText, posX + width - padding - bindWidth + 3, posY + 3.5f, ColorUtils.rgba(255, 255, 255, 255), fontSize);

            DisplayUtils.drawRectHorizontalW(posX + 15, posY + 2.5f, width1 + -9.5f,  8, ColorUtils.rgba(70, 70, 70, 255), ColorUtils.rgba(70, 70, 70, 255));
            PotionSpriteUploader potionspriteuploader = mc.getPotionSpriteUploader();
            TextureAtlasSprite textureatlassprite = potionspriteuploader.getSprite(effect);
            mc.getTextureManager().bindTexture(textureatlassprite.getAtlasTexture().getTextureLocation());
            DisplayEffectsScreen.blit(ms, (int) (posX + padding + -2), (int) posY - -2, 14, 9, 9, textureatlassprite);
            if (localWidth > maxWidth) {
                maxWidth = localWidth;
            }

            if (localWidth > maxWidth) {
                maxWidth = localWidth;
            }

            posY += (fontSize + padding);
            localHeight += (fontSize + padding);
        }

        width = Math.max(maxWidth, 80);
        height = localHeight + 2.5f;
        width1 = 10;
        height1 = localHeight +  2.5f;
        dragging.setWidth(width);
        dragging.setHeight(height);

        float imagePosX = posX + 100 - iconSizeX - padding;
        DisplayUtils.drawImage(logo, imagePosX + -81.5f, finalPosY + 3f, iconSizeX , iconSizeY, ColorUtils.rgb(255, 255, 255));

        Scissor.unset();
        Scissor.pop();
    }

    private void drawStyledRect(
                                    float x,
                                float y,
                                float width,
                                float height,
                                float radius) {

        DisplayUtils.drawRoundedRect(x - 0.5f, y - 0.5f, 90, 17, radius + 0.5f, ColorUtils.rgba(0, 0, 0, (int) (255 * 1)));
        DisplayUtils.drawRoundedRect(x, y + 17, width1 + 78.5f, height1 + -19, radius, ColorUtils.rgba(0, 0, 0, 255));
    }
}
крута
 
Начинающий
Статус
Оффлайн
Регистрация
5 Ноя 2023
Сообщения
147
Реакции[?]
0
Поинты[?]
1K
а где нурсултан или что то похожее на него?
ну я старался + единственный +- норм потион худ с иконкам (я не говорю что другие говно просто мой понравился мне больше других)
 
Начинающий
Статус
Оффлайн
Регистрация
6 Апр 2024
Сообщения
190
Реакции[?]
5
Поинты[?]
4K
ss -
Пожалуйста, авторизуйтесь для просмотра ссылки.


картинка -
Пожалуйста, авторизуйтесь для просмотра ссылки.


Код:
@FieldDefaults(level = AccessLevel.PRIVATE)
@RequiredArgsConstructor
public class PotionRenderer implements ElementRenderer {


    final Dragging dragging;
    final ResourceLocation logo = new ResourceLocation("cosmohack/images/hud/potion1.png");
    float iconSizeX = 10;
    float iconSizeY = 10;


    float width;
    float height;

    float width1;
    float height1;

    @Override
    public void render(EventDisplay eventDisplay) {
        MatrixStack ms = eventDisplay.getMatrixStack();

        float posX = dragging.getX();
        float posY = dragging.getY();
        float fontSize = 6.5f;
        float padding = 5;

        ITextComponent name = GradientUtil.gradient("Potions");
        String namemod = "Active Potions";

        float finalPosY = posY;
        drawStyledRect(posX, finalPosY, width + 5, height + -3, 3);

//        DisplayUtils.drawShadow(posX, posY, width, height, 15, ColorUtils.rgba(21,24,40,165));

        Scissor.push();
        Scissor.setFromComponentCoordinates(posX, posY, width, height);
        Fonts.sfui.drawText(ms, namemod, posX + padding + 17, posY + padding + -1, ColorUtils.rgb(255, 255, 255), fontSize);
        DisplayUtils.drawRectHorizontalW(posX + 17, posY + 3f, width1 + -9.5f,  9, ColorUtils.rgba(70, 70, 70, 255), ColorUtils.rgba(70, 70, 70, 255));

        posY += fontSize + padding * 2;

        float maxWidth = Fonts.sfMedium.getWidth(name, fontSize) + padding * 2;
        float localHeight = fontSize + padding * 2;

        for (EffectInstance ef : mc.player.getActivePotionEffects()) {
            int amp = ef.getAmplifier();

            String ampStr = "";

            if (amp >= 1 && amp <= 9) {
                ampStr = " " + I18n.format("enchantment.level." + (amp + 1));
            }
            String nameText = I18n.format(ef.getEffectName()) + ampStr;
            float nameWidth = Fonts.sfMedium.getWidth(nameText, fontSize);

            String bindText = EffectUtils.getPotionDurationString(ef, 1);
            float bindWidth = Fonts.sfMedium.getWidth(bindText, fontSize);

            float localWidth = nameWidth + bindWidth + padding * 3;

            Effect effect = ef.getPotion();

            Fonts.sfMedium.drawText(ms, nameText, posX + padding + 12, posY + 4, ColorUtils.rgba(255, 255, 255, 255), fontSize + -1);
            Fonts.sfMedium.drawText(ms, bindText, posX + width - padding - bindWidth + 3, posY + 3.5f, ColorUtils.rgba(255, 255, 255, 255), fontSize);

            DisplayUtils.drawRectHorizontalW(posX + 15, posY + 2.5f, width1 + -9.5f,  8, ColorUtils.rgba(70, 70, 70, 255), ColorUtils.rgba(70, 70, 70, 255));
            PotionSpriteUploader potionspriteuploader = mc.getPotionSpriteUploader();
            TextureAtlasSprite textureatlassprite = potionspriteuploader.getSprite(effect);
            mc.getTextureManager().bindTexture(textureatlassprite.getAtlasTexture().getTextureLocation());
            DisplayEffectsScreen.blit(ms, (int) (posX + padding + -2), (int) posY - -2, 14, 9, 9, textureatlassprite);
            if (localWidth > maxWidth) {
                maxWidth = localWidth;
            }

            if (localWidth > maxWidth) {
                maxWidth = localWidth;
            }

            posY += (fontSize + padding);
            localHeight += (fontSize + padding);
        }

        width = Math.max(maxWidth, 80);
        height = localHeight + 2.5f;
        width1 = 10;
        height1 = localHeight +  2.5f;
        dragging.setWidth(width);
        dragging.setHeight(height);

        float imagePosX = posX + 100 - iconSizeX - padding;
        DisplayUtils.drawImage(logo, imagePosX + -81.5f, finalPosY + 3f, iconSizeX , iconSizeY, ColorUtils.rgb(255, 255, 255));

        Scissor.unset();
        Scissor.pop();
    }

    private void drawStyledRect(
                                    float x,
                                float y,
                                float width,
                                float height,
                                float radius) {

        DisplayUtils.drawRoundedRect(x - 0.5f, y - 0.5f, 90, 17, radius + 0.5f, ColorUtils.rgba(0, 0, 0, (int) (255 * 1)));
        DisplayUtils.drawRoundedRect(x, y + 17, width1 + 78.5f, height1 + -19, radius, ColorUtils.rgba(0, 0, 0, 255));
    }
}
ща мне темку одобряд покажу что такое +- нурик
 
Начинающий
Статус
Оффлайн
Регистрация
22 Май 2023
Сообщения
39
Реакции[?]
0
Поинты[?]
0
ss -
Пожалуйста, авторизуйтесь для просмотра ссылки.


картинка -
Пожалуйста, авторизуйтесь для просмотра ссылки.


Код:
@FieldDefaults(level = AccessLevel.PRIVATE)
@RequiredArgsConstructor
public class PotionRenderer implements ElementRenderer {


    final Dragging dragging;
    final ResourceLocation logo = new ResourceLocation("cosmohack/images/hud/potion1.png");
    float iconSizeX = 10;
    float iconSizeY = 10;


    float width;
    float height;

    float width1;
    float height1;

    @Override
    public void render(EventDisplay eventDisplay) {
        MatrixStack ms = eventDisplay.getMatrixStack();

        float posX = dragging.getX();
        float posY = dragging.getY();
        float fontSize = 6.5f;
        float padding = 5;

        ITextComponent name = GradientUtil.gradient("Potions");
        String namemod = "Active Potions";

        float finalPosY = posY;
        drawStyledRect(posX, finalPosY, width + 5, height + -3, 3);

//        DisplayUtils.drawShadow(posX, posY, width, height, 15, ColorUtils.rgba(21,24,40,165));

        Scissor.push();
        Scissor.setFromComponentCoordinates(posX, posY, width, height);
        Fonts.sfui.drawText(ms, namemod, posX + padding + 17, posY + padding + -1, ColorUtils.rgb(255, 255, 255), fontSize);
        DisplayUtils.drawRectHorizontalW(posX + 17, posY + 3f, width1 + -9.5f,  9, ColorUtils.rgba(70, 70, 70, 255), ColorUtils.rgba(70, 70, 70, 255));

        posY += fontSize + padding * 2;

        float maxWidth = Fonts.sfMedium.getWidth(name, fontSize) + padding * 2;
        float localHeight = fontSize + padding * 2;

        for (EffectInstance ef : mc.player.getActivePotionEffects()) {
            int amp = ef.getAmplifier();

            String ampStr = "";

            if (amp >= 1 && amp <= 9) {
                ampStr = " " + I18n.format("enchantment.level." + (amp + 1));
            }
            String nameText = I18n.format(ef.getEffectName()) + ampStr;
            float nameWidth = Fonts.sfMedium.getWidth(nameText, fontSize);

            String bindText = EffectUtils.getPotionDurationString(ef, 1);
            float bindWidth = Fonts.sfMedium.getWidth(bindText, fontSize);

            float localWidth = nameWidth + bindWidth + padding * 3;

            Effect effect = ef.getPotion();

            Fonts.sfMedium.drawText(ms, nameText, posX + padding + 12, posY + 4, ColorUtils.rgba(255, 255, 255, 255), fontSize + -1);
            Fonts.sfMedium.drawText(ms, bindText, posX + width - padding - bindWidth + 3, posY + 3.5f, ColorUtils.rgba(255, 255, 255, 255), fontSize);

            DisplayUtils.drawRectHorizontalW(posX + 15, posY + 2.5f, width1 + -9.5f,  8, ColorUtils.rgba(70, 70, 70, 255), ColorUtils.rgba(70, 70, 70, 255));
            PotionSpriteUploader potionspriteuploader = mc.getPotionSpriteUploader();
            TextureAtlasSprite textureatlassprite = potionspriteuploader.getSprite(effect);
            mc.getTextureManager().bindTexture(textureatlassprite.getAtlasTexture().getTextureLocation());
            DisplayEffectsScreen.blit(ms, (int) (posX + padding + -2), (int) posY - -2, 14, 9, 9, textureatlassprite);
            if (localWidth > maxWidth) {
                maxWidth = localWidth;
            }

            if (localWidth > maxWidth) {
                maxWidth = localWidth;
            }

            posY += (fontSize + padding);
            localHeight += (fontSize + padding);
        }

        width = Math.max(maxWidth, 80);
        height = localHeight + 2.5f;
        width1 = 10;
        height1 = localHeight +  2.5f;
        dragging.setWidth(width);
        dragging.setHeight(height);

        float imagePosX = posX + 100 - iconSizeX - padding;
        DisplayUtils.drawImage(logo, imagePosX + -81.5f, finalPosY + 3f, iconSizeX , iconSizeY, ColorUtils.rgb(255, 255, 255));

        Scissor.unset();
        Scissor.pop();
    }

    private void drawStyledRect(
                                    float x,
                                float y,
                                float width,
                                float height,
                                float radius) {

        DisplayUtils.drawRoundedRect(x - 0.5f, y - 0.5f, 90, 17, radius + 0.5f, ColorUtils.rgba(0, 0, 0, (int) (255 * 1)));
        DisplayUtils.drawRoundedRect(x, y + 17, width1 + 78.5f, height1 + -19, radius, ColorUtils.rgba(0, 0, 0, 255));
    }
}
жду фулл худ
 
Сверху Снизу