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

Notification Expensive 2.0

Забаненный
Забаненный
Статус
Оффлайн
Регистрация
29 Июн 2023
Сообщения
178
Реакции
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
не убейте меня пожалуйста
oDv99EN.png


Код:
Expand Collapse Copy
public class NotificationManager {

    private final CopyOnWriteArrayList<Notification> notifications = new CopyOnWriteArrayList<>();

    public void add(String text, String content, int time) {
        notifications.add(new Notification(text, content, time));
    }


    public void draw(MatrixStack stack) {
        int yOffset = 0;
        for (Notification notification : notifications) {

            if (System.currentTimeMillis() - notification.getTime() > (notification.time2 * 1000L) - 300) {
                notification.animation.setDirection(Direction.BACKWARDS);
            } else {
                notification.yAnimation.setDirection(Direction.FORWARDS);
                notification.animation.setDirection(Direction.FORWARDS);
            }
            notification.alpha = (float) notification.animation.getOutput();
            if (System.currentTimeMillis() - notification.getTime() > notification.time2 * 1000L) {
                notification.yAnimation.setDirection(Direction.BACKWARDS);
            }
            if (notification.yAnimation.finished(Direction.BACKWARDS)) {
                notifications.remove(notification);
                continue;
            }
            float x = mc.getMainWindow().scaledWidth() - (Fonts.gilroyBold[14].getWidth(notification.getText()) + 8) - 10;
            float y = mc.getMainWindow().scaledHeight() - 30 -  (mc.player.getActivePotionEffects().stream().sorted(Comparator.comparing(EffectInstance::getDuration)).toList().size() * 16);
            notification.yAnimation.setEndPoint(yOffset);
            notification.yAnimation.setDuration(300);
            y -= (float) (notification.draw(stack) * notification.yAnimation.getOutput());
            notification.setX(x);
            notification.setY(AnimationMath.fast(notification.getY(), y, 15));
            yOffset++;
        }
    }


    private class Notification {
        @Getter
        @Setter
        private float x, y = mc.getMainWindow().scaledHeight() + 15;

        @Getter
        private String text;
        @Getter
        private String content;

        @Getter
        private long time = System.currentTimeMillis();

        public Animation animation = new DecelerateAnimation(500, 1, Direction.FORWARDS);
        public Animation yAnimation = new DecelerateAnimation(500, 1, Direction.FORWARDS);
        float alpha;
        int time2 = 3;

        public Notification(String text, String content, int time) {
            this.text = text;
            this.content = content;
            time2 = time;
        }

        public float draw(MatrixStack stack) {
            float width = Fonts.gilroyBold[14].getWidth(text) + 8;

            int firstColor = RenderUtil.reAlphaInt(Managment.STYLE_MANAGER.getCurrentStyle().getColor(0), (int) (255 * alpha));
            int secondColor = RenderUtil.reAlphaInt(Managment.STYLE_MANAGER.getCurrentStyle().getColor(100), (int) (255 * alpha));
            int thirdColor = RenderUtil.reAlphaInt(Managment.STYLE_MANAGER.getCurrentStyle().getColor(0), (int) (255 * alpha));
            int fourthColor = RenderUtil.reAlphaInt(Managment.STYLE_MANAGER.getCurrentStyle().getColor(100), (int) (255 * alpha));

            if (Managment.FUNCTION_MANAGER.hud2.shadow.get())
                RenderUtil.Render2D.drawShadow(x + 7, y + 13, width + 15, 10, 8, firstColor, secondColor, ColorUtil.getColorStyle(180), ColorUtil.getColorStyle(270));
            RenderUtil.Render2D.drawGradientRound(x + 7 - 0.25f, y + 13 - 0.25f, width + 15 + 0.5f, 10 +0.5f, 3, firstColor, secondColor, ColorUtil.getColorStyle(180), ColorUtil.getColorStyle(270));
            RenderUtil.Render2D.drawRoundedRect(x + 7, y + 13, width + 15, 10, 2, ColorUtil.rgba(30, 30, 30, 255));

         //   Fonts.msMedium[14].drawString(stack, content, x + 4 - 30, y + 5, RenderUtil.reAlphaInt(-1, (int) (255 * alpha)));
            Fonts.msMedium[12].drawString(stack, text, x + 10, y + 17, RenderUtil.reAlphaInt(-1, (int) (255 * alpha)));
            return 15;
        }
    }
}
 
очень хороший год на Notification ss вот тебе
Пожалуйста, авторизуйтесь для просмотра ссылки.


/del
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
очень хороший год на Notification ss вот тебе
Пожалуйста, авторизуйтесь для просмотра ссылки.


/del
вы пишите что говно если так посудить если ваш код будет на юг всем людям будет не приятно если ваш код который вы писали назовут говном
 
убивать не за что, норм
 
вы пишите что говно если так посудить если ваш код будет на юг всем людям будет не приятно если ваш код который вы писали назовут говном
Прочитай по логике что ты написал
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
куда писать это?
 
как поставить?
 
Назад
Сверху Снизу