Визуальная часть HotBarUpgrade | Expensive 3.1 Ready

Read Only
Read Only
Статус
Оффлайн
Регистрация
23 Сен 2024
Сообщения
255
Реакции
0
Выберите загрузчик игры
  1. Прочие моды

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

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

Спасибо!

Сразу скажу = deep seek, но вышло прикольно
SS: ниже
renderHotBar:
Expand Collapse Copy
static int targetSlot = 0;
    static float currentPosition = 0;
    static long lastUpdateTime = System.currentTimeMillis();
    protected void renderHotbar(float partialTicks, MatrixStack matrixStack) {
        PlayerEntity playerentity = this.getRenderViewPlayer();
        if (playerentity != null) {
            RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
            this.mc.getTextureManager().bindTexture(WIDGETS_TEX_PATH);
            ItemStack itemstack = playerentity.getHeldItemOffhand();
            HandSide handside = playerentity.getPrimaryHand().opposite();
            int i = this.scaledWidth / 2;
            int j = this.getBlitOffset();
            boolean k = true;
            boolean l = true;
            int firstColor = ColorUtils.getColor(0);
            int secondColor = ColorUtils.getColor(90);
            ModuleRegistry functionRegistry = LunaWare.getInstance().getFunctionRegistry();
            BetterMinecraft hotbar = functionRegistry.getBetterMinecraft();
            boolean customHotbar = hotbar.isState() && (Boolean)hotbar.hotBar.get();
            int blitStandartY = this.scaledHeight - 22;
            int blitItemY = blitStandartY + 3;
            this.setBlitOffset(-90);
            byte x2 = 0;

            // Добавляем переменные для анимации


            // Обновляем целевую позицию
            int newTargetSlot = playerentity.inventory.currentItem;
            if (newTargetSlot != targetSlot) {
                targetSlot = newTargetSlot;
                lastUpdateTime = System.currentTimeMillis();
            }

            // Вычисляем текущую позицию с плавным переходом
            long currentTime = System.currentTimeMillis();
            float delta = (currentTime - lastUpdateTime) / 1000f; // 200ms - время анимации
            delta = Math.min(delta, 1.0f); // Ограничиваем до 1.0
            currentPosition = lerp(currentPosition, targetSlot, delta);

            if (customHotbar) {
                int i2 = i - 91;
                int k2 = 182;
                int l1 = 22;
                int finalL = l1;
                int finalI = i2;
                Runnable var10000 = () -> DisplayUtils.drawRoundedRect((float) finalI, (float)blitStandartY, (float)k2, (float)(finalL - 2), 3.0F, java.awt.Color.WHITE.getRGB());
                if ((Boolean)hotbar.hotBarBlur.get()) {
                    GaussianBlur.startBlur();
                    DisplayUtils.drawRoundedRect((float)i2, (float)blitStandartY, (float)k2, (float)(l1 - 2), 3.0F, (new java.awt.Color(0, 0, 0, 255)).getRGB());
                    GaussianBlur.endBlur(3.0F, 1.0F);
                    DisplayUtils.drawRoundedRect((float)i2, (float)blitStandartY, (float)k2, (float)(l1 - 2), 3.0F, (new java.awt.Color(0, 0, 0, 150)).getRGB());
                    DisplayUtils.drawRoundedRect((float)(i2 + 2), (float)(blitStandartY + 2), (float)(x2 - 4), (float)(l1 - 4), 6.0F, ColorUtils.getColor(90));
                } else {
                    DisplayUtils.drawRoundedRect((float)i2, (float)blitStandartY, (float)k2, (float)(l1 - 2), 4.0F, (new java.awt.Color(0, 0, 0, 150)).getRGB());
                    DisplayUtils.drawRoundedRect((float)(i2 + 2), (float)(blitStandartY + 2), (float)(x2 - 4), (float)(l1 - 4), 7.0F, ColorUtils.getColor(90));
                }

                // Используем currentPosition вместо playerentity.inventory.currentItem для плавного перемещения
                i2 = (int)(i - 91 - 1 + currentPosition * 20);
                int j2 = blitStandartY - 1;
                x2 = 24;
                l1 = 22;
                if ((Boolean)hotbar.hotBarBlur.get()) {
                    GaussianBlur.startBlur();
                    DisplayUtils.drawRoundedRect((float)(i2 + 2), (float)(j2 + 2), (float)(x2 - 4), (float)(l1 - 4), 2.0F, (new java.awt.Color(0, 0, 0, 255)).getRGB());
                    GaussianBlur.endBlur(1.0F, 4.0F);
                    DisplayUtils.drawRoundedRectOutline((float)(i2 + 2), (float)(j2 + 2), (float)(x2 - 4), (float)(l1 - 4), 2.0F, 1.2F, InterFace.getColor(0));
                } else {
                    DisplayUtils.drawRoundedRectOutline((float)(i2 + 2), (float)(j2 + 2), (float)(x2 - 4), (float)(l1 - 4), 2.0F, 1.2F, InterFace.getColor(0));
                }
            } else {
                this.blit(matrixStack, i - 91, blitStandartY, 0, 0, 182, 22);
                this.blit(matrixStack, (int)(i - 91 - 1 + currentPosition * 20), blitStandartY - 1, 0, 22, 24, 22);
            }

            // Остальной код остается без изменений
            if (!itemstack.isEmpty()) {
                if (handside == HandSide.LEFT) {
                    if (!customHotbar) {
                        this.blit(matrixStack, i - 91 - 29, blitStandartY - 1, 24, 22, 29, 24);
                    } else {
                        int i2 = i - 91 - 28;
                        x2 = 20;
                        int l1 = 21;
                        byte finalX = x2;
                        Runnable var40 = () -> DisplayUtils.drawRoundedRect((float)i2, (float)blitStandartY, (float) finalX, (float)(l1 - 1), 3.0F, java.awt.Color.WHITE.getRGB());
                        DisplayUtils.drawRoundedRect((float)i2, (float)blitStandartY, (float)x2, (float)(l1 - 1), 3.0F, ColorUtils.rgba(0, 0, 0, 150));
                    }
                } else {
                    this.blit(matrixStack, i + 91, blitStandartY - 1, 53, 22, 29, 24);
                }
            }

            this.setBlitOffset(j);
            RenderSystem.enableRescaleNormal();
            RenderSystem.enableBlend();
            RenderSystem.defaultBlendFunc();
            GL11.glEnable(2929);
            CustomItems.setRenderOffHand(false);

            for(int i2 = 0; i2 < 9; ++i2) {
                int j2 = i - 90 + i2 * 20 + 2;
                int k2 = blitItemY - 1;
                this.renderHotbarItem(j2, k2, partialTicks, playerentity, (ItemStack)playerentity.inventory.mainInventory.get(i2));
            }

            if (!itemstack.isEmpty()) {
                CustomItems.setRenderOffHand(true);
                int finalI = blitItemY - 1;
                if (handside == HandSide.LEFT) {
                    this.renderHotbarItem(i - 91 - 26, finalI, partialTicks, playerentity, itemstack);
                } else {
                    this.renderHotbarItem(i + 91 + 10, finalI, partialTicks, playerentity, itemstack);
                }

                CustomItems.setRenderOffHand(false);
            }

            if (this.mc.gameSettings.attackIndicator == AttackIndicatorStatus.HOTBAR) {
                Minecraft var41 = this.mc;
                float f = Minecraft.player.getCooledAttackStrength(0.0F);
                if (f < 1.0F) {
                    int j2 = blitStandartY - 2;
                    int k2 = i + 91 + 6;
                    if (handside == HandSide.RIGHT) {
                        k2 = i - 91 - 22;
                    }

                    this.mc.getTextureManager().bindTexture(AbstractGui.GUI_ICONS_LOCATION);
                    int l1 = (int)(f * 19.0F);
                    RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
                    this.blit(matrixStack, k2, j2, 0, 94, 18, 18);
                    this.blit(matrixStack, k2, j2 + 18 - l1, 18, 112 - l1, 18, l1);
                }
            }

            RenderSystem.disableRescaleNormal();
            RenderSystem.disableBlend();
        }
    }

    // Метод для линейной интерполяции
    private float lerp(float start, float end, float delta) {
        return start + (end - start) * delta;
    }
    // Добавьте эти поля в ваш класс:
    private int lastHotbarSlot = 0;
    private float lastAnimatedPos = 0;
    private float animationProgress = 1.0f;

    // Метод для линейной интерполяции
Желаю удачки вам в пастинге
 

Вложения

  • 1748097829502.png
    1748097829502.png
    8.7 KB · Просмотры: 697
+rep годные темки появились
в какой класс сувать это надо а то я хз(
 
В какой класс это сувать?
 
1748262920410.png
 
Сразу скажу = deep seek, но вышло прикольно
SS: ниже
renderHotBar:
Expand Collapse Copy
static int targetSlot = 0;
    static float currentPosition = 0;
    static long lastUpdateTime = System.currentTimeMillis();
    protected void renderHotbar(float partialTicks, MatrixStack matrixStack) {
        PlayerEntity playerentity = this.getRenderViewPlayer();
        if (playerentity != null) {
            RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
            this.mc.getTextureManager().bindTexture(WIDGETS_TEX_PATH);
            ItemStack itemstack = playerentity.getHeldItemOffhand();
            HandSide handside = playerentity.getPrimaryHand().opposite();
            int i = this.scaledWidth / 2;
            int j = this.getBlitOffset();
            boolean k = true;
            boolean l = true;
            int firstColor = ColorUtils.getColor(0);
            int secondColor = ColorUtils.getColor(90);
            ModuleRegistry functionRegistry = LunaWare.getInstance().getFunctionRegistry();
            BetterMinecraft hotbar = functionRegistry.getBetterMinecraft();
            boolean customHotbar = hotbar.isState() && (Boolean)hotbar.hotBar.get();
            int blitStandartY = this.scaledHeight - 22;
            int blitItemY = blitStandartY + 3;
            this.setBlitOffset(-90);
            byte x2 = 0;

            // Добавляем переменные для анимации


            // Обновляем целевую позицию
            int newTargetSlot = playerentity.inventory.currentItem;
            if (newTargetSlot != targetSlot) {
                targetSlot = newTargetSlot;
                lastUpdateTime = System.currentTimeMillis();
            }

            // Вычисляем текущую позицию с плавным переходом
            long currentTime = System.currentTimeMillis();
            float delta = (currentTime - lastUpdateTime) / 1000f; // 200ms - время анимации
            delta = Math.min(delta, 1.0f); // Ограничиваем до 1.0
            currentPosition = lerp(currentPosition, targetSlot, delta);

            if (customHotbar) {
                int i2 = i - 91;
                int k2 = 182;
                int l1 = 22;
                int finalL = l1;
                int finalI = i2;
                Runnable var10000 = () -> DisplayUtils.drawRoundedRect((float) finalI, (float)blitStandartY, (float)k2, (float)(finalL - 2), 3.0F, java.awt.Color.WHITE.getRGB());
                if ((Boolean)hotbar.hotBarBlur.get()) {
                    GaussianBlur.startBlur();
                    DisplayUtils.drawRoundedRect((float)i2, (float)blitStandartY, (float)k2, (float)(l1 - 2), 3.0F, (new java.awt.Color(0, 0, 0, 255)).getRGB());
                    GaussianBlur.endBlur(3.0F, 1.0F);
                    DisplayUtils.drawRoundedRect((float)i2, (float)blitStandartY, (float)k2, (float)(l1 - 2), 3.0F, (new java.awt.Color(0, 0, 0, 150)).getRGB());
                    DisplayUtils.drawRoundedRect((float)(i2 + 2), (float)(blitStandartY + 2), (float)(x2 - 4), (float)(l1 - 4), 6.0F, ColorUtils.getColor(90));
                } else {
                    DisplayUtils.drawRoundedRect((float)i2, (float)blitStandartY, (float)k2, (float)(l1 - 2), 4.0F, (new java.awt.Color(0, 0, 0, 150)).getRGB());
                    DisplayUtils.drawRoundedRect((float)(i2 + 2), (float)(blitStandartY + 2), (float)(x2 - 4), (float)(l1 - 4), 7.0F, ColorUtils.getColor(90));
                }

                // Используем currentPosition вместо playerentity.inventory.currentItem для плавного перемещения
                i2 = (int)(i - 91 - 1 + currentPosition * 20);
                int j2 = blitStandartY - 1;
                x2 = 24;
                l1 = 22;
                if ((Boolean)hotbar.hotBarBlur.get()) {
                    GaussianBlur.startBlur();
                    DisplayUtils.drawRoundedRect((float)(i2 + 2), (float)(j2 + 2), (float)(x2 - 4), (float)(l1 - 4), 2.0F, (new java.awt.Color(0, 0, 0, 255)).getRGB());
                    GaussianBlur.endBlur(1.0F, 4.0F);
                    DisplayUtils.drawRoundedRectOutline((float)(i2 + 2), (float)(j2 + 2), (float)(x2 - 4), (float)(l1 - 4), 2.0F, 1.2F, InterFace.getColor(0));
                } else {
                    DisplayUtils.drawRoundedRectOutline((float)(i2 + 2), (float)(j2 + 2), (float)(x2 - 4), (float)(l1 - 4), 2.0F, 1.2F, InterFace.getColor(0));
                }
            } else {
                this.blit(matrixStack, i - 91, blitStandartY, 0, 0, 182, 22);
                this.blit(matrixStack, (int)(i - 91 - 1 + currentPosition * 20), blitStandartY - 1, 0, 22, 24, 22);
            }

            // Остальной код остается без изменений
            if (!itemstack.isEmpty()) {
                if (handside == HandSide.LEFT) {
                    if (!customHotbar) {
                        this.blit(matrixStack, i - 91 - 29, blitStandartY - 1, 24, 22, 29, 24);
                    } else {
                        int i2 = i - 91 - 28;
                        x2 = 20;
                        int l1 = 21;
                        byte finalX = x2;
                        Runnable var40 = () -> DisplayUtils.drawRoundedRect((float)i2, (float)blitStandartY, (float) finalX, (float)(l1 - 1), 3.0F, java.awt.Color.WHITE.getRGB());
                        DisplayUtils.drawRoundedRect((float)i2, (float)blitStandartY, (float)x2, (float)(l1 - 1), 3.0F, ColorUtils.rgba(0, 0, 0, 150));
                    }
                } else {
                    this.blit(matrixStack, i + 91, blitStandartY - 1, 53, 22, 29, 24);
                }
            }

            this.setBlitOffset(j);
            RenderSystem.enableRescaleNormal();
            RenderSystem.enableBlend();
            RenderSystem.defaultBlendFunc();
            GL11.glEnable(2929);
            CustomItems.setRenderOffHand(false);

            for(int i2 = 0; i2 < 9; ++i2) {
                int j2 = i - 90 + i2 * 20 + 2;
                int k2 = blitItemY - 1;
                this.renderHotbarItem(j2, k2, partialTicks, playerentity, (ItemStack)playerentity.inventory.mainInventory.get(i2));
            }

            if (!itemstack.isEmpty()) {
                CustomItems.setRenderOffHand(true);
                int finalI = blitItemY - 1;
                if (handside == HandSide.LEFT) {
                    this.renderHotbarItem(i - 91 - 26, finalI, partialTicks, playerentity, itemstack);
                } else {
                    this.renderHotbarItem(i + 91 + 10, finalI, partialTicks, playerentity, itemstack);
                }

                CustomItems.setRenderOffHand(false);
            }

            if (this.mc.gameSettings.attackIndicator == AttackIndicatorStatus.HOTBAR) {
                Minecraft var41 = this.mc;
                float f = Minecraft.player.getCooledAttackStrength(0.0F);
                if (f < 1.0F) {
                    int j2 = blitStandartY - 2;
                    int k2 = i + 91 + 6;
                    if (handside == HandSide.RIGHT) {
                        k2 = i - 91 - 22;
                    }

                    this.mc.getTextureManager().bindTexture(AbstractGui.GUI_ICONS_LOCATION);
                    int l1 = (int)(f * 19.0F);
                    RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
                    this.blit(matrixStack, k2, j2, 0, 94, 18, 18);
                    this.blit(matrixStack, k2, j2 + 18 - l1, 18, 112 - l1, 18, l1);
                }
            }

            RenderSystem.disableRescaleNormal();
            RenderSystem.disableBlend();
        }
    }

    // Метод для линейной интерполяции
    private float lerp(float start, float end, float delta) {
        return start + (end - start) * delta;
    }
    // Добавьте эти поля в ваш класс:
    private int lastHotbarSlot = 0;
    private float lastAnimatedPos = 0;
    private float animationProgress = 1.0f;

    // Метод для линейной интерполяции
Желаю удачки вам в пастинге
пасты схавают
 
Сразу скажу = deep seek, но вышло прикольно
SS: ниже
renderHotBar:
Expand Collapse Copy
static int targetSlot = 0;
    static float currentPosition = 0;
    static long lastUpdateTime = System.currentTimeMillis();
    protected void renderHotbar(float partialTicks, MatrixStack matrixStack) {
        PlayerEntity playerentity = this.getRenderViewPlayer();
        if (playerentity != null) {
            RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
            this.mc.getTextureManager().bindTexture(WIDGETS_TEX_PATH);
            ItemStack itemstack = playerentity.getHeldItemOffhand();
            HandSide handside = playerentity.getPrimaryHand().opposite();
            int i = this.scaledWidth / 2;
            int j = this.getBlitOffset();
            boolean k = true;
            boolean l = true;
            int firstColor = ColorUtils.getColor(0);
            int secondColor = ColorUtils.getColor(90);
            ModuleRegistry functionRegistry = LunaWare.getInstance().getFunctionRegistry();
            BetterMinecraft hotbar = functionRegistry.getBetterMinecraft();
            boolean customHotbar = hotbar.isState() && (Boolean)hotbar.hotBar.get();
            int blitStandartY = this.scaledHeight - 22;
            int blitItemY = blitStandartY + 3;
            this.setBlitOffset(-90);
            byte x2 = 0;

            // Добавляем переменные для анимации


            // Обновляем целевую позицию
            int newTargetSlot = playerentity.inventory.currentItem;
            if (newTargetSlot != targetSlot) {
                targetSlot = newTargetSlot;
                lastUpdateTime = System.currentTimeMillis();
            }

            // Вычисляем текущую позицию с плавным переходом
            long currentTime = System.currentTimeMillis();
            float delta = (currentTime - lastUpdateTime) / 1000f; // 200ms - время анимации
            delta = Math.min(delta, 1.0f); // Ограничиваем до 1.0
            currentPosition = lerp(currentPosition, targetSlot, delta);

            if (customHotbar) {
                int i2 = i - 91;
                int k2 = 182;
                int l1 = 22;
                int finalL = l1;
                int finalI = i2;
                Runnable var10000 = () -> DisplayUtils.drawRoundedRect((float) finalI, (float)blitStandartY, (float)k2, (float)(finalL - 2), 3.0F, java.awt.Color.WHITE.getRGB());
                if ((Boolean)hotbar.hotBarBlur.get()) {
                    GaussianBlur.startBlur();
                    DisplayUtils.drawRoundedRect((float)i2, (float)blitStandartY, (float)k2, (float)(l1 - 2), 3.0F, (new java.awt.Color(0, 0, 0, 255)).getRGB());
                    GaussianBlur.endBlur(3.0F, 1.0F);
                    DisplayUtils.drawRoundedRect((float)i2, (float)blitStandartY, (float)k2, (float)(l1 - 2), 3.0F, (new java.awt.Color(0, 0, 0, 150)).getRGB());
                    DisplayUtils.drawRoundedRect((float)(i2 + 2), (float)(blitStandartY + 2), (float)(x2 - 4), (float)(l1 - 4), 6.0F, ColorUtils.getColor(90));
                } else {
                    DisplayUtils.drawRoundedRect((float)i2, (float)blitStandartY, (float)k2, (float)(l1 - 2), 4.0F, (new java.awt.Color(0, 0, 0, 150)).getRGB());
                    DisplayUtils.drawRoundedRect((float)(i2 + 2), (float)(blitStandartY + 2), (float)(x2 - 4), (float)(l1 - 4), 7.0F, ColorUtils.getColor(90));
                }

                // Используем currentPosition вместо playerentity.inventory.currentItem для плавного перемещения
                i2 = (int)(i - 91 - 1 + currentPosition * 20);
                int j2 = blitStandartY - 1;
                x2 = 24;
                l1 = 22;
                if ((Boolean)hotbar.hotBarBlur.get()) {
                    GaussianBlur.startBlur();
                    DisplayUtils.drawRoundedRect((float)(i2 + 2), (float)(j2 + 2), (float)(x2 - 4), (float)(l1 - 4), 2.0F, (new java.awt.Color(0, 0, 0, 255)).getRGB());
                    GaussianBlur.endBlur(1.0F, 4.0F);
                    DisplayUtils.drawRoundedRectOutline((float)(i2 + 2), (float)(j2 + 2), (float)(x2 - 4), (float)(l1 - 4), 2.0F, 1.2F, InterFace.getColor(0));
                } else {
                    DisplayUtils.drawRoundedRectOutline((float)(i2 + 2), (float)(j2 + 2), (float)(x2 - 4), (float)(l1 - 4), 2.0F, 1.2F, InterFace.getColor(0));
                }
            } else {
                this.blit(matrixStack, i - 91, blitStandartY, 0, 0, 182, 22);
                this.blit(matrixStack, (int)(i - 91 - 1 + currentPosition * 20), blitStandartY - 1, 0, 22, 24, 22);
            }

            // Остальной код остается без изменений
            if (!itemstack.isEmpty()) {
                if (handside == HandSide.LEFT) {
                    if (!customHotbar) {
                        this.blit(matrixStack, i - 91 - 29, blitStandartY - 1, 24, 22, 29, 24);
                    } else {
                        int i2 = i - 91 - 28;
                        x2 = 20;
                        int l1 = 21;
                        byte finalX = x2;
                        Runnable var40 = () -> DisplayUtils.drawRoundedRect((float)i2, (float)blitStandartY, (float) finalX, (float)(l1 - 1), 3.0F, java.awt.Color.WHITE.getRGB());
                        DisplayUtils.drawRoundedRect((float)i2, (float)blitStandartY, (float)x2, (float)(l1 - 1), 3.0F, ColorUtils.rgba(0, 0, 0, 150));
                    }
                } else {
                    this.blit(matrixStack, i + 91, blitStandartY - 1, 53, 22, 29, 24);
                }
            }

            this.setBlitOffset(j);
            RenderSystem.enableRescaleNormal();
            RenderSystem.enableBlend();
            RenderSystem.defaultBlendFunc();
            GL11.glEnable(2929);
            CustomItems.setRenderOffHand(false);

            for(int i2 = 0; i2 < 9; ++i2) {
                int j2 = i - 90 + i2 * 20 + 2;
                int k2 = blitItemY - 1;
                this.renderHotbarItem(j2, k2, partialTicks, playerentity, (ItemStack)playerentity.inventory.mainInventory.get(i2));
            }

            if (!itemstack.isEmpty()) {
                CustomItems.setRenderOffHand(true);
                int finalI = blitItemY - 1;
                if (handside == HandSide.LEFT) {
                    this.renderHotbarItem(i - 91 - 26, finalI, partialTicks, playerentity, itemstack);
                } else {
                    this.renderHotbarItem(i + 91 + 10, finalI, partialTicks, playerentity, itemstack);
                }

                CustomItems.setRenderOffHand(false);
            }

            if (this.mc.gameSettings.attackIndicator == AttackIndicatorStatus.HOTBAR) {
                Minecraft var41 = this.mc;
                float f = Minecraft.player.getCooledAttackStrength(0.0F);
                if (f < 1.0F) {
                    int j2 = blitStandartY - 2;
                    int k2 = i + 91 + 6;
                    if (handside == HandSide.RIGHT) {
                        k2 = i - 91 - 22;
                    }

                    this.mc.getTextureManager().bindTexture(AbstractGui.GUI_ICONS_LOCATION);
                    int l1 = (int)(f * 19.0F);
                    RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
                    this.blit(matrixStack, k2, j2, 0, 94, 18, 18);
                    this.blit(matrixStack, k2, j2 + 18 - l1, 18, 112 - l1, 18, l1);
                }
            }

            RenderSystem.disableRescaleNormal();
            RenderSystem.disableBlend();
        }
    }

    // Метод для линейной интерполяции
    private float lerp(float start, float end, float delta) {
        return start + (end - start) * delta;
    }
    // Добавьте эти поля в ваш класс:
    private int lastHotbarSlot = 0;
    private float lastAnimatedPos = 0;
    private float animationProgress = 1.0f;

    // Метод для линейной интерполяции
Желаю удачки вам в пастинге
хуета
 
Сразу скажу = deep seek, но вышло прикольно
SS: ниже
renderHotBar:
Expand Collapse Copy
static int targetSlot = 0;
    static float currentPosition = 0;
    static long lastUpdateTime = System.currentTimeMillis();
    protected void renderHotbar(float partialTicks, MatrixStack matrixStack) {
        PlayerEntity playerentity = this.getRenderViewPlayer();
        if (playerentity != null) {
            RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
            this.mc.getTextureManager().bindTexture(WIDGETS_TEX_PATH);
            ItemStack itemstack = playerentity.getHeldItemOffhand();
            HandSide handside = playerentity.getPrimaryHand().opposite();
            int i = this.scaledWidth / 2;
            int j = this.getBlitOffset();
            boolean k = true;
            boolean l = true;
            int firstColor = ColorUtils.getColor(0);
            int secondColor = ColorUtils.getColor(90);
            ModuleRegistry functionRegistry = LunaWare.getInstance().getFunctionRegistry();
            BetterMinecraft hotbar = functionRegistry.getBetterMinecraft();
            boolean customHotbar = hotbar.isState() && (Boolean)hotbar.hotBar.get();
            int blitStandartY = this.scaledHeight - 22;
            int blitItemY = blitStandartY + 3;
            this.setBlitOffset(-90);
            byte x2 = 0;

            // Добавляем переменные для анимации


            // Обновляем целевую позицию
            int newTargetSlot = playerentity.inventory.currentItem;
            if (newTargetSlot != targetSlot) {
                targetSlot = newTargetSlot;
                lastUpdateTime = System.currentTimeMillis();
            }

            // Вычисляем текущую позицию с плавным переходом
            long currentTime = System.currentTimeMillis();
            float delta = (currentTime - lastUpdateTime) / 1000f; // 200ms - время анимации
            delta = Math.min(delta, 1.0f); // Ограничиваем до 1.0
            currentPosition = lerp(currentPosition, targetSlot, delta);

            if (customHotbar) {
                int i2 = i - 91;
                int k2 = 182;
                int l1 = 22;
                int finalL = l1;
                int finalI = i2;
                Runnable var10000 = () -> DisplayUtils.drawRoundedRect((float) finalI, (float)blitStandartY, (float)k2, (float)(finalL - 2), 3.0F, java.awt.Color.WHITE.getRGB());
                if ((Boolean)hotbar.hotBarBlur.get()) {
                    GaussianBlur.startBlur();
                    DisplayUtils.drawRoundedRect((float)i2, (float)blitStandartY, (float)k2, (float)(l1 - 2), 3.0F, (new java.awt.Color(0, 0, 0, 255)).getRGB());
                    GaussianBlur.endBlur(3.0F, 1.0F);
                    DisplayUtils.drawRoundedRect((float)i2, (float)blitStandartY, (float)k2, (float)(l1 - 2), 3.0F, (new java.awt.Color(0, 0, 0, 150)).getRGB());
                    DisplayUtils.drawRoundedRect((float)(i2 + 2), (float)(blitStandartY + 2), (float)(x2 - 4), (float)(l1 - 4), 6.0F, ColorUtils.getColor(90));
                } else {
                    DisplayUtils.drawRoundedRect((float)i2, (float)blitStandartY, (float)k2, (float)(l1 - 2), 4.0F, (new java.awt.Color(0, 0, 0, 150)).getRGB());
                    DisplayUtils.drawRoundedRect((float)(i2 + 2), (float)(blitStandartY + 2), (float)(x2 - 4), (float)(l1 - 4), 7.0F, ColorUtils.getColor(90));
                }

                // Используем currentPosition вместо playerentity.inventory.currentItem для плавного перемещения
                i2 = (int)(i - 91 - 1 + currentPosition * 20);
                int j2 = blitStandartY - 1;
                x2 = 24;
                l1 = 22;
                if ((Boolean)hotbar.hotBarBlur.get()) {
                    GaussianBlur.startBlur();
                    DisplayUtils.drawRoundedRect((float)(i2 + 2), (float)(j2 + 2), (float)(x2 - 4), (float)(l1 - 4), 2.0F, (new java.awt.Color(0, 0, 0, 255)).getRGB());
                    GaussianBlur.endBlur(1.0F, 4.0F);
                    DisplayUtils.drawRoundedRectOutline((float)(i2 + 2), (float)(j2 + 2), (float)(x2 - 4), (float)(l1 - 4), 2.0F, 1.2F, InterFace.getColor(0));
                } else {
                    DisplayUtils.drawRoundedRectOutline((float)(i2 + 2), (float)(j2 + 2), (float)(x2 - 4), (float)(l1 - 4), 2.0F, 1.2F, InterFace.getColor(0));
                }
            } else {
                this.blit(matrixStack, i - 91, blitStandartY, 0, 0, 182, 22);
                this.blit(matrixStack, (int)(i - 91 - 1 + currentPosition * 20), blitStandartY - 1, 0, 22, 24, 22);
            }

            // Остальной код остается без изменений
            if (!itemstack.isEmpty()) {
                if (handside == HandSide.LEFT) {
                    if (!customHotbar) {
                        this.blit(matrixStack, i - 91 - 29, blitStandartY - 1, 24, 22, 29, 24);
                    } else {
                        int i2 = i - 91 - 28;
                        x2 = 20;
                        int l1 = 21;
                        byte finalX = x2;
                        Runnable var40 = () -> DisplayUtils.drawRoundedRect((float)i2, (float)blitStandartY, (float) finalX, (float)(l1 - 1), 3.0F, java.awt.Color.WHITE.getRGB());
                        DisplayUtils.drawRoundedRect((float)i2, (float)blitStandartY, (float)x2, (float)(l1 - 1), 3.0F, ColorUtils.rgba(0, 0, 0, 150));
                    }
                } else {
                    this.blit(matrixStack, i + 91, blitStandartY - 1, 53, 22, 29, 24);
                }
            }

            this.setBlitOffset(j);
            RenderSystem.enableRescaleNormal();
            RenderSystem.enableBlend();
            RenderSystem.defaultBlendFunc();
            GL11.glEnable(2929);
            CustomItems.setRenderOffHand(false);

            for(int i2 = 0; i2 < 9; ++i2) {
                int j2 = i - 90 + i2 * 20 + 2;
                int k2 = blitItemY - 1;
                this.renderHotbarItem(j2, k2, partialTicks, playerentity, (ItemStack)playerentity.inventory.mainInventory.get(i2));
            }

            if (!itemstack.isEmpty()) {
                CustomItems.setRenderOffHand(true);
                int finalI = blitItemY - 1;
                if (handside == HandSide.LEFT) {
                    this.renderHotbarItem(i - 91 - 26, finalI, partialTicks, playerentity, itemstack);
                } else {
                    this.renderHotbarItem(i + 91 + 10, finalI, partialTicks, playerentity, itemstack);
                }

                CustomItems.setRenderOffHand(false);
            }

            if (this.mc.gameSettings.attackIndicator == AttackIndicatorStatus.HOTBAR) {
                Minecraft var41 = this.mc;
                float f = Minecraft.player.getCooledAttackStrength(0.0F);
                if (f < 1.0F) {
                    int j2 = blitStandartY - 2;
                    int k2 = i + 91 + 6;
                    if (handside == HandSide.RIGHT) {
                        k2 = i - 91 - 22;
                    }

                    this.mc.getTextureManager().bindTexture(AbstractGui.GUI_ICONS_LOCATION);
                    int l1 = (int)(f * 19.0F);
                    RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
                    this.blit(matrixStack, k2, j2, 0, 94, 18, 18);
                    this.blit(matrixStack, k2, j2 + 18 - l1, 18, 112 - l1, 18, l1);
                }
            }

            RenderSystem.disableRescaleNormal();
            RenderSystem.disableBlend();
        }
    }

    // Метод для линейной интерполяции
    private float lerp(float start, float end, float delta) {
        return start + (end - start) * delta;
    }
    // Добавьте эти поля в ваш класс:
    private int lastHotbarSlot = 0;
    private float lastAnimatedPos = 0;
    private float animationProgress = 1.0f;

    // Метод для линейной интерполяции
Желаю удачки вам в пастинге
я эту хуйню сделал давно еще
 
Сразу скажу = deep seek, но вышло прикольно
SS: ниже
renderHotBar:
Expand Collapse Copy
static int targetSlot = 0;
    static float currentPosition = 0;
    static long lastUpdateTime = System.currentTimeMillis();
    protected void renderHotbar(float partialTicks, MatrixStack matrixStack) {
        PlayerEntity playerentity = this.getRenderViewPlayer();
        if (playerentity != null) {
            RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
            this.mc.getTextureManager().bindTexture(WIDGETS_TEX_PATH);
            ItemStack itemstack = playerentity.getHeldItemOffhand();
            HandSide handside = playerentity.getPrimaryHand().opposite();
            int i = this.scaledWidth / 2;
            int j = this.getBlitOffset();
            boolean k = true;
            boolean l = true;
            int firstColor = ColorUtils.getColor(0);
            int secondColor = ColorUtils.getColor(90);
            ModuleRegistry functionRegistry = LunaWare.getInstance().getFunctionRegistry();
            BetterMinecraft hotbar = functionRegistry.getBetterMinecraft();
            boolean customHotbar = hotbar.isState() && (Boolean)hotbar.hotBar.get();
            int blitStandartY = this.scaledHeight - 22;
            int blitItemY = blitStandartY + 3;
            this.setBlitOffset(-90);
            byte x2 = 0;

            // Добавляем переменные для анимации


            // Обновляем целевую позицию
            int newTargetSlot = playerentity.inventory.currentItem;
            if (newTargetSlot != targetSlot) {
                targetSlot = newTargetSlot;
                lastUpdateTime = System.currentTimeMillis();
            }

            // Вычисляем текущую позицию с плавным переходом
            long currentTime = System.currentTimeMillis();
            float delta = (currentTime - lastUpdateTime) / 1000f; // 200ms - время анимации
            delta = Math.min(delta, 1.0f); // Ограничиваем до 1.0
            currentPosition = lerp(currentPosition, targetSlot, delta);

            if (customHotbar) {
                int i2 = i - 91;
                int k2 = 182;
                int l1 = 22;
                int finalL = l1;
                int finalI = i2;
                Runnable var10000 = () -> DisplayUtils.drawRoundedRect((float) finalI, (float)blitStandartY, (float)k2, (float)(finalL - 2), 3.0F, java.awt.Color.WHITE.getRGB());
                if ((Boolean)hotbar.hotBarBlur.get()) {
                    GaussianBlur.startBlur();
                    DisplayUtils.drawRoundedRect((float)i2, (float)blitStandartY, (float)k2, (float)(l1 - 2), 3.0F, (new java.awt.Color(0, 0, 0, 255)).getRGB());
                    GaussianBlur.endBlur(3.0F, 1.0F);
                    DisplayUtils.drawRoundedRect((float)i2, (float)blitStandartY, (float)k2, (float)(l1 - 2), 3.0F, (new java.awt.Color(0, 0, 0, 150)).getRGB());
                    DisplayUtils.drawRoundedRect((float)(i2 + 2), (float)(blitStandartY + 2), (float)(x2 - 4), (float)(l1 - 4), 6.0F, ColorUtils.getColor(90));
                } else {
                    DisplayUtils.drawRoundedRect((float)i2, (float)blitStandartY, (float)k2, (float)(l1 - 2), 4.0F, (new java.awt.Color(0, 0, 0, 150)).getRGB());
                    DisplayUtils.drawRoundedRect((float)(i2 + 2), (float)(blitStandartY + 2), (float)(x2 - 4), (float)(l1 - 4), 7.0F, ColorUtils.getColor(90));
                }

                // Используем currentPosition вместо playerentity.inventory.currentItem для плавного перемещения
                i2 = (int)(i - 91 - 1 + currentPosition * 20);
                int j2 = blitStandartY - 1;
                x2 = 24;
                l1 = 22;
                if ((Boolean)hotbar.hotBarBlur.get()) {
                    GaussianBlur.startBlur();
                    DisplayUtils.drawRoundedRect((float)(i2 + 2), (float)(j2 + 2), (float)(x2 - 4), (float)(l1 - 4), 2.0F, (new java.awt.Color(0, 0, 0, 255)).getRGB());
                    GaussianBlur.endBlur(1.0F, 4.0F);
                    DisplayUtils.drawRoundedRectOutline((float)(i2 + 2), (float)(j2 + 2), (float)(x2 - 4), (float)(l1 - 4), 2.0F, 1.2F, InterFace.getColor(0));
                } else {
                    DisplayUtils.drawRoundedRectOutline((float)(i2 + 2), (float)(j2 + 2), (float)(x2 - 4), (float)(l1 - 4), 2.0F, 1.2F, InterFace.getColor(0));
                }
            } else {
                this.blit(matrixStack, i - 91, blitStandartY, 0, 0, 182, 22);
                this.blit(matrixStack, (int)(i - 91 - 1 + currentPosition * 20), blitStandartY - 1, 0, 22, 24, 22);
            }

            // Остальной код остается без изменений
            if (!itemstack.isEmpty()) {
                if (handside == HandSide.LEFT) {
                    if (!customHotbar) {
                        this.blit(matrixStack, i - 91 - 29, blitStandartY - 1, 24, 22, 29, 24);
                    } else {
                        int i2 = i - 91 - 28;
                        x2 = 20;
                        int l1 = 21;
                        byte finalX = x2;
                        Runnable var40 = () -> DisplayUtils.drawRoundedRect((float)i2, (float)blitStandartY, (float) finalX, (float)(l1 - 1), 3.0F, java.awt.Color.WHITE.getRGB());
                        DisplayUtils.drawRoundedRect((float)i2, (float)blitStandartY, (float)x2, (float)(l1 - 1), 3.0F, ColorUtils.rgba(0, 0, 0, 150));
                    }
                } else {
                    this.blit(matrixStack, i + 91, blitStandartY - 1, 53, 22, 29, 24);
                }
            }

            this.setBlitOffset(j);
            RenderSystem.enableRescaleNormal();
            RenderSystem.enableBlend();
            RenderSystem.defaultBlendFunc();
            GL11.glEnable(2929);
            CustomItems.setRenderOffHand(false);

            for(int i2 = 0; i2 < 9; ++i2) {
                int j2 = i - 90 + i2 * 20 + 2;
                int k2 = blitItemY - 1;
                this.renderHotbarItem(j2, k2, partialTicks, playerentity, (ItemStack)playerentity.inventory.mainInventory.get(i2));
            }

            if (!itemstack.isEmpty()) {
                CustomItems.setRenderOffHand(true);
                int finalI = blitItemY - 1;
                if (handside == HandSide.LEFT) {
                    this.renderHotbarItem(i - 91 - 26, finalI, partialTicks, playerentity, itemstack);
                } else {
                    this.renderHotbarItem(i + 91 + 10, finalI, partialTicks, playerentity, itemstack);
                }

                CustomItems.setRenderOffHand(false);
            }

            if (this.mc.gameSettings.attackIndicator == AttackIndicatorStatus.HOTBAR) {
                Minecraft var41 = this.mc;
                float f = Minecraft.player.getCooledAttackStrength(0.0F);
                if (f < 1.0F) {
                    int j2 = blitStandartY - 2;
                    int k2 = i + 91 + 6;
                    if (handside == HandSide.RIGHT) {
                        k2 = i - 91 - 22;
                    }

                    this.mc.getTextureManager().bindTexture(AbstractGui.GUI_ICONS_LOCATION);
                    int l1 = (int)(f * 19.0F);
                    RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
                    this.blit(matrixStack, k2, j2, 0, 94, 18, 18);
                    this.blit(matrixStack, k2, j2 + 18 - l1, 18, 112 - l1, 18, l1);
                }
            }

            RenderSystem.disableRescaleNormal();
            RenderSystem.disableBlend();
        }
    }

    // Метод для линейной интерполяции
    private float lerp(float start, float end, float delta) {
        return start + (end - start) * delta;
    }
    // Добавьте эти поля в ваш класс:
    private int lastHotbarSlot = 0;
    private float lastAnimatedPos = 0;
    private float animationProgress = 1.0f;

    // Метод для линейной интерполяции
Желаю удачки вам в пастинге
как всегда не дристня брат /up
я эту хуйню сделал давно еще
молодец
 
chatgpt code /del, а так красиво врод
 
Щас такое намуч,вместо баров сделаем писюны по экрану
 
ет идеально только зделай функцией
 
Назад
Сверху Снизу