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

Гайд Notifications | Expensive 3.1

Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
п

принимай
У всех у кого ошибка вот вам код чтобы все работало

Function.java:
Expand Collapse Copy
public final void toggle() {
        if (Function.mc.player == null || Function.mc.world == null) {
            return;
        }
        boolean bl = this.state = !this.state;
        if (!this.state) {
            this.onDisable();
            NotifiDed.NOTIFICATION_MANAGER.add("Функция " + this.name + " была выключена.", "", 1, NotificationManager.ImageType.FIRST_PHOTO);
        } else {
            this.onEnable();
            NotifiDed.NOTIFICATION_MANAGER.add("Функция " + this.name + " была включена.", "", 1, NotificationManager.ImageType.SECOND_PHOTO);
        }
        FunctionRegistry functionRegistry = Dedyshka.getInstance().getFunctionRegistry();
        ClientSounds clientSounds = functionRegistry.getClientSounds();
        if (clientSounds != null && clientSounds.isState()) {
            String fileName = clientSounds.getFileName(this.state);
            float volume = ((Float)clientSounds.volume.get()).floatValue();
            ClientUtil.playSound(fileName, volume, false);
        }
    }
Это вставлять в Function.java, где public final void toggle()

что за дедушка

FunctionRegistry functionRegistry = Dedyshka.getInstance().getFunctionRegistry();

:77:45
java: cannot find symbol
symbol: variable Dedyshka
location: class im.expensive.functions.api.Function
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Запастил с невернайгта, короче по пути: src/im/expensive/ui/ создаем класс NotificationManager, туда вставляем этот код:



Java:
Expand Collapse Copy
package fun.ellant.ui;

import com.mojang.blaze3d.matrix.MatrixStack;
import java.util.concurrent.CopyOnWriteArrayList;
import net.minecraft.util.ResourceLocation;
import fun.ellant.utils.animations.Animation;
import fun.ellant.utils.animations.Direction;
import fun.ellant.utils.animations.impl.EaseBackIn;
import fun.ellant.utils.animations.impl.EaseInOutQuad;
import fun.ellant.utils.client.IMinecraft;
import fun.ellant.utils.math.MathUtil;
import fun.ellant.utils.render.ColorUtils;
import fun.ellant.utils.render.DisplayUtils;
import fun.ellant.utils.render.font.Fonts;

public class NotificationManager {
    private final CopyOnWriteArrayList<Notification> notifications = new CopyOnWriteArrayList();
    private MathUtil AnimationMath;
    private ImageType imageType;
    boolean state;

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

    public void draw(MatrixStack stack) {
        int yOffset = 0;
        for (Notification notification : this.notifications) {
            if (System.currentTimeMillis() - notification.getTime() <= (long)notification.time2 * 1000L - 300L) {
                notification.yAnimation.setDirection(Direction.FORWARDS);
            }
            notification.alpha = (float)notification.animation.getOutput();
            if (System.currentTimeMillis() - notification.getTime() > (long)notification.time2 * 1000L) {
                notification.yAnimation.setDirection(Direction.BACKWARDS);
            }
            if (notification.yAnimation.finished(Direction.BACKWARDS)) {
                this.notifications.remove(notification);
                continue;
            }
            float x = (float)IMinecraft.mc.getMainWindow().scaledWidth() - (Fonts.sfMedium.getWidth(notification.getText(), 7.0f) + 8.0f) - 10.0f;
            float y = IMinecraft.mc.getMainWindow().scaledHeight() - 40;
            notification.yAnimation.setEndPoint(yOffset);
            notification.yAnimation.setDuration(500);
            notification.setX(x);
            notification.setY(MathUtil.fast(notification.getY(), y -= (float)((double)notification.draw(stack) * notification.yAnimation.getOutput() + 3.0), 15.0f));
            ++yOffset;
        }
    }

    private class Notification {
        private float x = 0.0f;
        private float y = IMinecraft.mc.getMainWindow().scaledHeight() + 24;
        private String text;
        private String content;
        private long time = System.currentTimeMillis();
        public Animation animation = new EaseInOutQuad(500, 1.0, Direction.FORWARDS);
        public Animation yAnimation = new EaseBackIn(500, 1.0, 1.0f);
        private ImageType imageType;
        float alpha;
        int time2 = 3;
        private boolean isState;
        private boolean state;

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

        public float draw(MatrixStack stack) {
            float width = Fonts.sfMedium.getWidth(this.text, 7.0f) + 8.0f;
            DisplayUtils.drawRoundedRect(this.x - 427.0f + 50.0f, this.y - 25.0f, width + 27.0f, 13.0f, 3.0f, ColorUtils.rgb(23, 22, 22));
            DisplayUtils.drawShadow(this.x - 427.0f + 50.0f, this.y - 25.0f, width + 27.0f, 13.0f, 3, ColorUtils.rgb(23, 22, 22));
            if (this.imageType == ImageType.FIRST_PHOTO) {
                ResourceLocation key = new ResourceLocation("expensive/images/hud/notify.png");
                DisplayUtils.drawImage(key, this.x - 424.0f + 50.0f, this.y - 26.5f, 16.0f, 16.0f, ColorUtils.rgb(255, 0, 0));
            } else {
                ResourceLocation key1 = new ResourceLocation("expensive/images/hud/notify2.png");
                DisplayUtils.drawImage(key1, this.x - 424.0f + 50.0f, this.y - 26.5f, 16.0f, 16.0f, ColorUtils.rgb(0, 255, 0));
            }
            Fonts.montserrat.drawText(stack, this.text, this.x - 407.0f + 50.0f, this.y - 22.0f, -1, 7.0f, 0.05f);
            int enabledColor = ColorUtils.rgba(0, 255, 0, 255);
            int disabledColor = ColorUtils.rgba(255, 0, 0, 255);
            int contentColor = this.state ? enabledColor : disabledColor;
            Fonts.sfMedium.drawText(stack, this.content, this.x, this.y, ColorUtils.rgb(0, 255, 0), 4.0f, 0.05f);
            return 24.0f;
        }

        public float getX() {
            return this.x;
        }

        public float getY() {
            return this.y;
        }

        public void setX(float x) {
            this.x = x;
        }

        public void setY(float y) {
            this.y = y;
        }

        public String getText() {
            return this.text;
        }

        public String getContent() {
            return this.content;
        }

        public long getTime() {
            return this.time;
        }
    }

    public static enum ImageType {
        FIRST_PHOTO,
        SECOND_PHOTO;

    }
}



Если вы не рукожоп и умеете менять импорты через ctrl + h то можно переходить и к 2 этапу.



Переходим по такому пути: src/im/expensive/functions/api/, так так, если вы перешли по такому пути вы должны создать класс NaksonPaster, переносим этот код в класс





Java:
Expand Collapse Copy
package fun.ellant.functions.api;



import fun.ellant.ui.NotificationManager;



public class NaksonPaster {

    public static NotificationManager NOTIFICATION_MANAGER;

}



После этого мы переходим в класс Expensive.java, который находится по такому пути: src/im/expensive/ , после строки tpsCalc = new TPSCalc(); вставляем этот код:
Java:
Expand Collapse Copy
NaksonPaster.NOTIFICATION_MANAGER = new NotificationManager();



Фуух, вы сделали 50% от всего этого. Теперь надо парейти в класс Function.java, который находится по пути: src/im/expensive/functions/api/, после строки



public final void toggle() {

if (Function.mc.player == null || Function.mc.world == null) {

return;

}



Вы должны написать

Java:
Expand Collapse Copy
        boolean bl = this.state = !this.state;

        if (!this.state) {

            this.onDisable();

            NaksonPaster.NOTIFICATION_MANAGER.add("Функция " + this.name + " была выключена.", "", 1, NotificationManager.ImageType.FIRST_PHOTO);

        } else {

            this.onEnable();

            NaksonPaster.NOTIFICATION_MANAGER.add("Функция " + this.name + " была включена.", "", 1, NotificationManager.ImageType.SECOND_PHOTO);

        }

        FunctionRegistry functionRegistry = Ellant.getInstance().getFunctionRegistry();

        ClientSounds clientSounds = functionRegistry.getClientSounds();

        if (clientSounds != null && clientSounds.isState()) {

            String fileName = clientSounds.getFileName(this.state);

            float volume = ((Float)clientSounds.volume.get()).floatValue();

            ClientUtil.playSound(fileName, volume, false);

        }

    }





После этого мы переходим в класс IngameGUI по пути: src/net/minecraft/client/gui/ и после строк: eventDisplay.setMatrixStack(matrixStack);

eventDisplay.setPartialTicks(partialTicks);



мы должны вставить это:

Java:
Expand Collapse Copy
NaksonPaster.NOTIFICATION_MANAGER.draw(matrixStack);
Да я пастер
мало кто знает что этот код спасщен не с невернайта , а с вериста
 
Запастил с невернайгта, короче по пути: src/im/expensive/ui/ создаем класс NotificationManager, туда вставляем этот код:



Java:
Expand Collapse Copy
package fun.ellant.ui;

import com.mojang.blaze3d.matrix.MatrixStack;
import java.util.concurrent.CopyOnWriteArrayList;
import net.minecraft.util.ResourceLocation;
import fun.ellant.utils.animations.Animation;
import fun.ellant.utils.animations.Direction;
import fun.ellant.utils.animations.impl.EaseBackIn;
import fun.ellant.utils.animations.impl.EaseInOutQuad;
import fun.ellant.utils.client.IMinecraft;
import fun.ellant.utils.math.MathUtil;
import fun.ellant.utils.render.ColorUtils;
import fun.ellant.utils.render.DisplayUtils;
import fun.ellant.utils.render.font.Fonts;

public class NotificationManager {
    private final CopyOnWriteArrayList<Notification> notifications = new CopyOnWriteArrayList();
    private MathUtil AnimationMath;
    private ImageType imageType;
    boolean state;

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

    public void draw(MatrixStack stack) {
        int yOffset = 0;
        for (Notification notification : this.notifications) {
            if (System.currentTimeMillis() - notification.getTime() <= (long)notification.time2 * 1000L - 300L) {
                notification.yAnimation.setDirection(Direction.FORWARDS);
            }
            notification.alpha = (float)notification.animation.getOutput();
            if (System.currentTimeMillis() - notification.getTime() > (long)notification.time2 * 1000L) {
                notification.yAnimation.setDirection(Direction.BACKWARDS);
            }
            if (notification.yAnimation.finished(Direction.BACKWARDS)) {
                this.notifications.remove(notification);
                continue;
            }
            float x = (float)IMinecraft.mc.getMainWindow().scaledWidth() - (Fonts.sfMedium.getWidth(notification.getText(), 7.0f) + 8.0f) - 10.0f;
            float y = IMinecraft.mc.getMainWindow().scaledHeight() - 40;
            notification.yAnimation.setEndPoint(yOffset);
            notification.yAnimation.setDuration(500);
            notification.setX(x);
            notification.setY(MathUtil.fast(notification.getY(), y -= (float)((double)notification.draw(stack) * notification.yAnimation.getOutput() + 3.0), 15.0f));
            ++yOffset;
        }
    }

    private class Notification {
        private float x = 0.0f;
        private float y = IMinecraft.mc.getMainWindow().scaledHeight() + 24;
        private String text;
        private String content;
        private long time = System.currentTimeMillis();
        public Animation animation = new EaseInOutQuad(500, 1.0, Direction.FORWARDS);
        public Animation yAnimation = new EaseBackIn(500, 1.0, 1.0f);
        private ImageType imageType;
        float alpha;
        int time2 = 3;
        private boolean isState;
        private boolean state;

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

        public float draw(MatrixStack stack) {
            float width = Fonts.sfMedium.getWidth(this.text, 7.0f) + 8.0f;
            DisplayUtils.drawRoundedRect(this.x - 427.0f + 50.0f, this.y - 25.0f, width + 27.0f, 13.0f, 3.0f, ColorUtils.rgb(23, 22, 22));
            DisplayUtils.drawShadow(this.x - 427.0f + 50.0f, this.y - 25.0f, width + 27.0f, 13.0f, 3, ColorUtils.rgb(23, 22, 22));
            if (this.imageType == ImageType.FIRST_PHOTO) {
                ResourceLocation key = new ResourceLocation("expensive/images/hud/notify.png");
                DisplayUtils.drawImage(key, this.x - 424.0f + 50.0f, this.y - 26.5f, 16.0f, 16.0f, ColorUtils.rgb(255, 0, 0));
            } else {
                ResourceLocation key1 = new ResourceLocation("expensive/images/hud/notify2.png");
                DisplayUtils.drawImage(key1, this.x - 424.0f + 50.0f, this.y - 26.5f, 16.0f, 16.0f, ColorUtils.rgb(0, 255, 0));
            }
            Fonts.montserrat.drawText(stack, this.text, this.x - 407.0f + 50.0f, this.y - 22.0f, -1, 7.0f, 0.05f);
            int enabledColor = ColorUtils.rgba(0, 255, 0, 255);
            int disabledColor = ColorUtils.rgba(255, 0, 0, 255);
            int contentColor = this.state ? enabledColor : disabledColor;
            Fonts.sfMedium.drawText(stack, this.content, this.x, this.y, ColorUtils.rgb(0, 255, 0), 4.0f, 0.05f);
            return 24.0f;
        }

        public float getX() {
            return this.x;
        }

        public float getY() {
            return this.y;
        }

        public void setX(float x) {
            this.x = x;
        }

        public void setY(float y) {
            this.y = y;
        }

        public String getText() {
            return this.text;
        }

        public String getContent() {
            return this.content;
        }

        public long getTime() {
            return this.time;
        }
    }

    public static enum ImageType {
        FIRST_PHOTO,
        SECOND_PHOTO;

    }
}



Если вы не рукожоп и умеете менять импорты через ctrl + h то можно переходить и к 2 этапу.



Переходим по такому пути: src/im/expensive/functions/api/, так так, если вы перешли по такому пути вы должны создать класс NaksonPaster, переносим этот код в класс





Java:
Expand Collapse Copy
package fun.ellant.functions.api;



import fun.ellant.ui.NotificationManager;



public class NaksonPaster {

    public static NotificationManager NOTIFICATION_MANAGER;

}



После этого мы переходим в класс Expensive.java, который находится по такому пути: src/im/expensive/ , после строки tpsCalc = new TPSCalc(); вставляем этот код:
Java:
Expand Collapse Copy
NaksonPaster.NOTIFICATION_MANAGER = new NotificationManager();



Фуух, вы сделали 50% от всего этого. Теперь надо парейти в класс Function.java, который находится по пути: src/im/expensive/functions/api/, после строки



public final void toggle() {

if (Function.mc.player == null || Function.mc.world == null) {

return;

}



Вы должны написать

Java:
Expand Collapse Copy
        boolean bl = this.state = !this.state;

        if (!this.state) {

            this.onDisable();

            NaksonPaster.NOTIFICATION_MANAGER.add("Функция " + this.name + " была выключена.", "", 1, NotificationManager.ImageType.FIRST_PHOTO);

        } else {

            this.onEnable();

            NaksonPaster.NOTIFICATION_MANAGER.add("Функция " + this.name + " была включена.", "", 1, NotificationManager.ImageType.SECOND_PHOTO);

        }

        FunctionRegistry functionRegistry = Ellant.getInstance().getFunctionRegistry();

        ClientSounds clientSounds = functionRegistry.getClientSounds();

        if (clientSounds != null && clientSounds.isState()) {

            String fileName = clientSounds.getFileName(this.state);

            float volume = ((Float)clientSounds.volume.get()).floatValue();

            ClientUtil.playSound(fileName, volume, false);

        }

    }





После этого мы переходим в класс IngameGUI по пути: src/net/minecraft/client/gui/ и после строк: eventDisplay.setMatrixStack(matrixStack);

eventDisplay.setPartialTicks(partialTicks);



мы должны вставить это:

Java:
Expand Collapse Copy
NaksonPaster.NOTIFICATION_MANAGER.draw(matrixStack);
Да я пастер
невернайт уже у твистера пастит? или мне кажется
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Запастил с невернайгта, короче по пути: src/im/expensive/ui/ создаем класс NotificationManager, туда вставляем этот код:



Java:
Expand Collapse Copy
package fun.ellant.ui;

import com.mojang.blaze3d.matrix.MatrixStack;
import java.util.concurrent.CopyOnWriteArrayList;
import net.minecraft.util.ResourceLocation;
import fun.ellant.utils.animations.Animation;
import fun.ellant.utils.animations.Direction;
import fun.ellant.utils.animations.impl.EaseBackIn;
import fun.ellant.utils.animations.impl.EaseInOutQuad;
import fun.ellant.utils.client.IMinecraft;
import fun.ellant.utils.math.MathUtil;
import fun.ellant.utils.render.ColorUtils;
import fun.ellant.utils.render.DisplayUtils;
import fun.ellant.utils.render.font.Fonts;

public class NotificationManager {
    private final CopyOnWriteArrayList<Notification> notifications = new CopyOnWriteArrayList();
    private MathUtil AnimationMath;
    private ImageType imageType;
    boolean state;

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

    public void draw(MatrixStack stack) {
        int yOffset = 0;
        for (Notification notification : this.notifications) {
            if (System.currentTimeMillis() - notification.getTime() <= (long)notification.time2 * 1000L - 300L) {
                notification.yAnimation.setDirection(Direction.FORWARDS);
            }
            notification.alpha = (float)notification.animation.getOutput();
            if (System.currentTimeMillis() - notification.getTime() > (long)notification.time2 * 1000L) {
                notification.yAnimation.setDirection(Direction.BACKWARDS);
            }
            if (notification.yAnimation.finished(Direction.BACKWARDS)) {
                this.notifications.remove(notification);
                continue;
            }
            float x = (float)IMinecraft.mc.getMainWindow().scaledWidth() - (Fonts.sfMedium.getWidth(notification.getText(), 7.0f) + 8.0f) - 10.0f;
            float y = IMinecraft.mc.getMainWindow().scaledHeight() - 40;
            notification.yAnimation.setEndPoint(yOffset);
            notification.yAnimation.setDuration(500);
            notification.setX(x);
            notification.setY(MathUtil.fast(notification.getY(), y -= (float)((double)notification.draw(stack) * notification.yAnimation.getOutput() + 3.0), 15.0f));
            ++yOffset;
        }
    }

    private class Notification {
        private float x = 0.0f;
        private float y = IMinecraft.mc.getMainWindow().scaledHeight() + 24;
        private String text;
        private String content;
        private long time = System.currentTimeMillis();
        public Animation animation = new EaseInOutQuad(500, 1.0, Direction.FORWARDS);
        public Animation yAnimation = new EaseBackIn(500, 1.0, 1.0f);
        private ImageType imageType;
        float alpha;
        int time2 = 3;
        private boolean isState;
        private boolean state;

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

        public float draw(MatrixStack stack) {
            float width = Fonts.sfMedium.getWidth(this.text, 7.0f) + 8.0f;
            DisplayUtils.drawRoundedRect(this.x - 427.0f + 50.0f, this.y - 25.0f, width + 27.0f, 13.0f, 3.0f, ColorUtils.rgb(23, 22, 22));
            DisplayUtils.drawShadow(this.x - 427.0f + 50.0f, this.y - 25.0f, width + 27.0f, 13.0f, 3, ColorUtils.rgb(23, 22, 22));
            if (this.imageType == ImageType.FIRST_PHOTO) {
                ResourceLocation key = new ResourceLocation("expensive/images/hud/notify.png");
                DisplayUtils.drawImage(key, this.x - 424.0f + 50.0f, this.y - 26.5f, 16.0f, 16.0f, ColorUtils.rgb(255, 0, 0));
            } else {
                ResourceLocation key1 = new ResourceLocation("expensive/images/hud/notify2.png");
                DisplayUtils.drawImage(key1, this.x - 424.0f + 50.0f, this.y - 26.5f, 16.0f, 16.0f, ColorUtils.rgb(0, 255, 0));
            }
            Fonts.montserrat.drawText(stack, this.text, this.x - 407.0f + 50.0f, this.y - 22.0f, -1, 7.0f, 0.05f);
            int enabledColor = ColorUtils.rgba(0, 255, 0, 255);
            int disabledColor = ColorUtils.rgba(255, 0, 0, 255);
            int contentColor = this.state ? enabledColor : disabledColor;
            Fonts.sfMedium.drawText(stack, this.content, this.x, this.y, ColorUtils.rgb(0, 255, 0), 4.0f, 0.05f);
            return 24.0f;
        }

        public float getX() {
            return this.x;
        }

        public float getY() {
            return this.y;
        }

        public void setX(float x) {
            this.x = x;
        }

        public void setY(float y) {
            this.y = y;
        }

        public String getText() {
            return this.text;
        }

        public String getContent() {
            return this.content;
        }

        public long getTime() {
            return this.time;
        }
    }

    public static enum ImageType {
        FIRST_PHOTO,
        SECOND_PHOTO;

    }
}

UPDATEEEEEEE


Забыл сказать тоже важное, то что вы должны сделать

Переходим в im/expensive/ui/display/impl и тут создаём NotificationsRenderer, сюда вставляем:


Java:
Expand Collapse Copy
/*
* Decompiled with CFR 0.153-SNAPSHOT (d6f6758-dirty).
*/
package fun.ellant.ui.display.impl;

import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.Minecraft;
import net.minecraft.util.text.StringTextComponent;
import fun.ellant.Ellant;
import fun.ellant.events.EventDisplay;
import fun.ellant.functions.api.Function;
import fun.ellant.functions.api.FunctionRegistry;
import fun.ellant.ui.display.ElementRenderer;
import fun.ellant.ui.styles.Style;
import fun.ellant.utils.render.ColorUtils;
import fun.ellant.utils.render.DisplayUtils;
import fun.ellant.utils.render.Scissor;
import fun.ellant.utils.render.font.Fonts;
import fun.ellant.utils.text.GradientUtil;

public class NotificationsRenderer
        implements ElementRenderer {
    private final FunctionRegistry functionRegistry;
    private float width;
    private float height;

    public NotificationsRenderer() {
        this.functionRegistry = Ellant.getInstance().getFunctionRegistry();
    }

    @Override
    public void render(EventDisplay eventDisplay) {
        MatrixStack ms = eventDisplay.getMatrixStack();
        float screenWidth = Minecraft.getInstance().getMainWindow().getScaledWidth();
        float screenHeight = Minecraft.getInstance().getMainWindow().getScaledHeight();
        float posX = screenWidth - this.width - 5.0f;
        float posY = screenHeight - this.height - 5.0f;
        float fontSize = 6.5f;
        float padding = 5.0f;
        StringTextComponent title = (StringTextComponent) GradientUtil.white("Функции");
        Style style = Ellant.getInstance().getStyleManager().getCurrentStyle();
        DisplayUtils.drawShadow(posX, posY, this.width, this.height, 10, style.getFirstColor().getRGB(), style.getSecondColor().getRGB());
        this.drawStyledRect(posX, posY, this.width, this.height, 4.0f);
        Scissor.push();
        Scissor.setFromComponentCoordinates(posX, posY, this.width, this.height);
        Fonts.sfui.drawCenteredText(ms, title, posX + this.width / 2.0f, posY + padding + 0.5f, fontSize);
        posY += fontSize + padding * 2.0f;
        float maxWidth = Fonts.sfMedium.getWidth(title, fontSize) + padding * 2.0f;
        float localHeight = fontSize + padding * 2.0f;
        for (Function function : this.functionRegistry.getFunctions()) {
            String functionName = function.getName() + " " + (function.isState() ? "включено" : "выключено");
            float nameWidth = Fonts.sfMedium.getWidth(functionName, fontSize);
            Fonts.sfMedium.drawText(ms, functionName, posX + padding, posY, ColorUtils.rgba(210, 210, 210, 255), fontSize);
            if (nameWidth + padding * 2.0f > maxWidth) {
                maxWidth = nameWidth + padding * 2.0f;
            }
            posY += fontSize + padding;
            localHeight += fontSize + padding;
        }
        Scissor.unset();
        Scissor.pop();
        this.width = Math.max(maxWidth, 80.0f);
        this.height = localHeight + 2.5f;
    }

    private void drawStyledRect(float x, float y, float width, float height, float radius) {
        DisplayUtils.drawRoundedRect(x - 0.5f, y - 0.5f, width + 1.0f, height + 1.0f, radius + 0.5f, ColorUtils.getColor(0));
        DisplayUtils.drawRoundedRect(x, y, width, height, radius, ColorUtils.rgba(21, 21, 21, 255));
    }

    public NotificationsRenderer(FunctionRegistry functionRegistry) {
        this.functionRegistry = functionRegistry;
    }
}


Если вы не рукожоп и умеете менять импорты через ctrl + h то можно переходить и к 3 этапу.



Переходим по такому пути: src/im/expensive/functions/api/, так так, если вы перешли по такому пути вы должны создать класс NaksonPaster, переносим этот код в класс





Java:
Expand Collapse Copy
package fun.ellant.functions.api;



import fun.ellant.ui.NotificationManager;



public class NaksonPaster {

    public static NotificationManager NOTIFICATION_MANAGER;

}



После этого мы переходим в класс Expensive.java, который находится по такому пути: src/im/expensive/ , после строки tpsCalc = new TPSCalc(); вставляем этот код:
Java:
Expand Collapse Copy
NaksonPaster.NOTIFICATION_MANAGER = new NotificationManager();



Фуух, вы сделали 50% от всего этого. Теперь надо парейти в класс Function.java, который находится по пути: src/im/expensive/functions/api/, после строки



public final void toggle() {

if (Function.mc.player == null || Function.mc.world == null) {

return;

}



Вы должны написать

Java:
Expand Collapse Copy
        boolean bl = this.state = !this.state;

        if (!this.state) {

            this.onDisable();

            NaksonPaster.NOTIFICATION_MANAGER.add("Функция " + this.name + " была выключена.", "", 1, NotificationManager.ImageType.FIRST_PHOTO);

        } else {

            this.onEnable();

            NaksonPaster.NOTIFICATION_MANAGER.add("Функция " + this.name + " была включена.", "", 1, NotificationManager.ImageType.SECOND_PHOTO);

        }

        FunctionRegistry functionRegistry = Ellant.getInstance().getFunctionRegistry();

        ClientSounds clientSounds = functionRegistry.getClientSounds();

        if (clientSounds != null && clientSounds.isState()) {

            String fileName = clientSounds.getFileName(this.state);

            float volume = ((Float)clientSounds.volume.get()).floatValue();

            ClientUtil.playSound(fileName, volume, false);

        }

    }





После этого мы переходим в класс IngameGUI по пути: src/net/minecraft/client/gui/ и после строк: eventDisplay.setMatrixStack(matrixStack);

eventDisplay.setPartialTicks(partialTicks);



мы должны вставить это:

Java:
Expand Collapse Copy
NaksonPaster.NOTIFICATION_MANAGER.draw(matrixStack);
Да я пастер
---- Minecraft Crash Report ----
// You should try our sister game, Minceraft!

Time: 15.07.2024, 01:07
Description: Initializing game

java.lang.IllegalArgumentException: missing event subscriber for an annotated method. Is im.expensive.functions.impl.render.ESP@10101a10 registered?
at com.google.common.eventbus.SubscriberRegistry.unregister(SubscriberRegistry.java:111)
at com.google.common.eventbus.EventBus.unregister(EventBus.java:201)
at im.expensive.functions.api.Function.onDisable(Function.java:57)
at im.expensive.functions.api.Function.setState(Function.java:75)
at im.expensive.functions.api.Function.toggle(Function.java:62)
at im.expensive.functions.impl.render.ESP.<init>(ESP.java:64)
at im.expensive.functions.api.FunctionRegistry.init(FunctionRegistry.java:102)
at im.expensive.Expensive.clientLoad(Expensive.java:169)
at im.expensive.Expensive.<init>(Expensive.java:150)
at net.minecraft.client.Minecraft.<init>(Minecraft.java:430)
at net.minecraft.client.main.Main.main(Main.java:156)
at Start.main(Start.java:11)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Render thread
Stacktrace:
at com.google.common.eventbus.SubscriberRegistry.unregister(SubscriberRegistry.java:111)
at com.google.common.eventbus.EventBus.unregister(EventBus.java:201)
at im.expensive.functions.api.Function.onDisable(Function.java:57)
at im.expensive.functions.api.Function.setState(Function.java:75)
at im.expensive.functions.api.Function.toggle(Function.java:62)
at im.expensive.functions.impl.render.ESP.<init>(ESP.java:64)
at im.expensive.functions.api.FunctionRegistry.init(FunctionRegistry.java:102)
at im.expensive.Expensive.clientLoad(Expensive.java:169)
at im.expensive.Expensive.<init>(Expensive.java:150)
at net.minecraft.client.Minecraft.<init>(Minecraft.java:430)

-- Initialization --
Details:
Stacktrace:
at net.minecraft.client.main.Main.main(Main.java:156)
at Start.main(Start.java:11)
ммм этот краш лог прости имба!
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
---- Minecraft Crash Report ----
// You should try our sister game, Minceraft!

Time: 15.07.2024, 01:07
Description: Initializing game

java.lang.IllegalArgumentException: missing event subscriber for an annotated method. Is im.expensive.functions.impl.render.ESP@10101a10 registered?
at com.google.common.eventbus.SubscriberRegistry.unregister(SubscriberRegistry.java:111)
at com.google.common.eventbus.EventBus.unregister(EventBus.java:201)
at im.expensive.functions.api.Function.onDisable(Function.java:57)
at im.expensive.functions.api.Function.setState(Function.java:75)
at im.expensive.functions.api.Function.toggle(Function.java:62)
at im.expensive.functions.impl.render.ESP.<init>(ESP.java:64)
at im.expensive.functions.api.FunctionRegistry.init(FunctionRegistry.java:102)
at im.expensive.Expensive.clientLoad(Expensive.java:169)
at im.expensive.Expensive.<init>(Expensive.java:150)
at net.minecraft.client.Minecraft.<init>(Minecraft.java:430)
at net.minecraft.client.main.Main.main(Main.java:156)
at Start.main(Start.java:11)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Render thread
Stacktrace:
at com.google.common.eventbus.SubscriberRegistry.unregister(SubscriberRegistry.java:111)
at com.google.common.eventbus.EventBus.unregister(EventBus.java:201)
at im.expensive.functions.api.Function.onDisable(Function.java:57)
at im.expensive.functions.api.Function.setState(Function.java:75)
at im.expensive.functions.api.Function.toggle(Function.java:62)
at im.expensive.functions.impl.render.ESP.<init>(ESP.java:64)
at im.expensive.functions.api.FunctionRegistry.init(FunctionRegistry.java:102)
at im.expensive.Expensive.clientLoad(Expensive.java:169)
at im.expensive.Expensive.<init>(Expensive.java:150)
at net.minecraft.client.Minecraft.<init>(Minecraft.java:430)

-- Initialization --
Details:
Stacktrace:
at net.minecraft.client.main.Main.main(Main.java:156)
at Start.main(Start.java:11)
ммм этот краш лог прости имба!
вхвхвх, а ты точно в FunctionRegistry/Expensive.java добавил?
 
Назад
Сверху Снизу