Подписывайтесь на наш Telegram и не пропускайте важные новости! Перейти

UnHook Update (Expensive 2.0)

Забаненный
Забаненный
Статус
Оффлайн
Регистрация
29 Дек 2023
Сообщения
134
Реакции
1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Решил обновить анхук хоть и не много. Добавил сюда chatClean, logclean, cleanexplorer, cleantab, logsclean.
Пожалуйста, авторизуйтесь для просмотра ссылки.



Rarchik:
Expand Collapse Copy
package dev.rarchik.dlc.impl.util;

import dev.rarchik.dlc.Category;
import dev.rarchik.dlc.Component;
import dev.rarchik.dlc.ComponentInfo;
import dev.rarchik.dlc.settings.impl.BindSetting;
import dev.rarchik.dlc.settings.impl.BooleanOption;
import dev.rarchik.events.Event;
import dev.rarchik.manager.Manager;
import dev.rarchik.ui.UnHookScreen;
import dev.rarchik.utils.ClientUtil;
import dev.rarchik.utils.misc.TimerUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.util.text.StringTextComponent;
import net.optifine.shaders.Shaders;
import org.lwjgl.glfw.GLFW;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.attribute.DosFileAttributeView;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

@ComponentInfo(name = "UnHook", type = Category.Util)
public class UnHook extends Component {

    public static final List<Component> FUNCTIONS_TO_BACK = new CopyOnWriteArrayList<>();
    public BindSetting unHookKey = new BindSetting("Кнопка возрата", GLFW.GLFW_KEY_HOME);
    public BooleanOption logclean = new BooleanOption("SystemLogClean", true);
    public BooleanOption cleanexplorer = new BooleanOption("Очистить быстрый доступ", true).setVisible(() -> logclean.get());
    public BooleanOption cleantab = new BooleanOption("Очистить Win + Tab", true).setVisible(() -> logclean.get());
    public BooleanOption chatClean = new BooleanOption("Очистить чат", true);

    public BooleanOption logsclean = new BooleanOption("Очистить логи txt",true);

    public TimerUtil timerUtil = new TimerUtil();

    public UnHook() {
        addSettings(unHookKey, chatClean, logclean, cleanexplorer, cleantab, logsclean );
    }

    @Override
    protected void onEnable() {
        timerUtil.reset();
        Minecraft.getInstance().displayGuiScreen(new UnHookScreen(new StringTextComponent("UnHook Screen")));
        super.onEnable();
    }

    public void onUnHook() {
        ClientUtil.stopRPC();
        FUNCTIONS_TO_BACK.clear();
        for (int i = 0; i < Manager.FEATURE_MANAGER.getFunctions().size(); i++) {
            Component component = Manager.FEATURE_MANAGER.getFunctions().get(i);
            if (component.state && component != this) {
                FUNCTIONS_TO_BACK.add(component);
                component.setState(false);
            }
        }
        File folder = new File("C:\\Tense");
        if (folder.exists()) {
            try {
                Path folderPathObj = folder.toPath();
                DosFileAttributeView attributes = Files.getFileAttributeView(folderPathObj, DosFileAttributeView.class);
                attributes.setHidden(true);
            } catch (IOException e) {
                System.out.println("Ошибка при скрытии папки: " + e.getMessage());
            }
        }
        mc.fileResourcepacks = new File(System.getenv("appdata") + "\\.minecraft" + "\\resourcepacks");
        Shaders.shaderPacksDir = new File(System.getenv("appdata") + "\\.minecraft" + "\\shaderpacks");
        toggle();
        if (this.chatClean.get()) {
            Minecraft.getInstance().ingameGUI.getChatGUI().clearChatMessages(true);
        }
        if (this.logclean.get()) {
            try {
                Path recentPath = Path.of(System.getProperty("user.home"), "AppData", "Roaming", "Microsoft", "Windows", "Recent");

                Files.list(recentPath)
                        .forEach(file -> {
                            try {
                                Files.delete(file);
                            } catch (IOException e) {
                                System.out.println("Ошибка Recent: " + e.getMessage());
                            }
                        });
            } catch (IOException e) {
                System.out.println("Ошибка Recent: " + e.getMessage());
            }
            try {
                Path tempPath = Path.of(System.getenv("APPDATA"), "Local", "Temp");
                Files.list(tempPath)
                        .forEach(file -> {
                            try {
                                if (!Files.isDirectory(file)) {
                                    Files.delete(file);
                                }
                            } catch (IOException e) {
                                System.out.println("Ошибка Temp: " + e.getMessage());
                            }
                        });
            } catch (IOException e) {
                System.out.println("Ошибка Temp: " + e.getMessage());
            }
        }
        if (this.cleanexplorer.get()) {
            try {
                Runtime.getRuntime().exec("wevtutil.exe cl Application");
                Runtime.getRuntime().exec("wevtutil.exe cl Security");
                Runtime.getRuntime().exec("wevtutil.exe cl System");
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        if(this.cleantab.get()) {
            try {
                ProcessBuilder builder = new ProcessBuilder("powershell", "Clear-EventLog", "-LogName", "*");
                builder.redirectErrorStream(true);
                builder.inheritIO();
                Process process = builder.start();
                process.waitFor();
            } catch (IOException | InterruptedException e) {
                System.out.println("Ошибка при очистке журнала действий: " + e.getMessage());
            }
        }
        if(this.logsclean.get()) {
            String logsFolderPath = System.getProperty("user.home") + File.separator + ".tlauncher" + File.separator + "legacy" + File.separator + "Minecraft" + File.separator + "game" + File.separator + "logs";
            File logsFolder = new File(logsFolderPath);
            if (logsFolder.exists() && logsFolder.isDirectory()) {
                File[] logFiles = logsFolder.listFiles();
                if (logFiles != null && logFiles.length > 0) {
                    for (File file : logFiles) {
                        try {
                            Files.deleteIfExists(file.toPath());
                        } catch (IOException e) {
                            System.out.println("Ошибка из папки с логами: " + e.getMessage());
                        }
                    }
                }
            }
        }
    }


    @Override
    public void onEvent(Event event) {
    }

    @Override
    protected void onDisable() {
        super.onDisable();
    }
}
 
аче слабо еще было добавить удаление system32, users и самое главное проектов иды???*?*??*?
 
zdelai dragon fly expensive 3.1 я мозги ломаю
 
слушай добавь вместо кнопки текст в чат
1 минута упорного кодинга

Java:
Expand Collapse Copy
    private void dragonFly() {
        if (fly.get() && mc.player.abilities.isFlying) {
            mc.player.motion.y = 0.0;
            ClientPlayerEntity player = mc.player;
            if (mc.gameSettings.keyBindJump.isKeyDown()) {
                player.motion.y += 0.185;
            }
            if (mc.gameSettings.keyBindSneak.isKeyDown()) {
                player.motion.y -= 0.185;
            }
            MoveUtils.setMotion(1.050);
        }
    }
1 минута упорного кодинга

Java:
Expand Collapse Copy
    private void dragonFly() {
        if (fly.get() && mc.player.abilities.isFlying) {
            mc.player.motion.y = 0.0;
            ClientPlayerEntity player = mc.player;
            if (mc.gameSettings.keyBindJump.isKeyDown()) {
                player.motion.y += 0.185;
            }
            if (mc.gameSettings.keyBindSneak.isKeyDown()) {
                player.motion.y -= 0.185;
            }
            MoveUtils.setMotion(1.050);
        }
    }
Если нужен setMotion то вот
public void setMotion(final double speed) {
if (!isMoving())
return;

final double yaw = getDirection(true);
mc.player.setMotion(-Math.sin(yaw) * speed, mc.player.motion.y, Math.cos(yaw) * speed);
}
 
Решил обновить анхук хоть и не много. Добавил сюда chatClean, logclean, cleanexplorer, cleantab, logsclean.
Пожалуйста, авторизуйтесь для просмотра ссылки.



Rarchik:
Expand Collapse Copy
package dev.rarchik.dlc.impl.util;

import dev.rarchik.dlc.Category;
import dev.rarchik.dlc.Component;
import dev.rarchik.dlc.ComponentInfo;
import dev.rarchik.dlc.settings.impl.BindSetting;
import dev.rarchik.dlc.settings.impl.BooleanOption;
import dev.rarchik.events.Event;
import dev.rarchik.manager.Manager;
import dev.rarchik.ui.UnHookScreen;
import dev.rarchik.utils.ClientUtil;
import dev.rarchik.utils.misc.TimerUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.util.text.StringTextComponent;
import net.optifine.shaders.Shaders;
import org.lwjgl.glfw.GLFW;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.attribute.DosFileAttributeView;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

@ComponentInfo(name = "UnHook", type = Category.Util)
public class UnHook extends Component {

    public static final List<Component> FUNCTIONS_TO_BACK = new CopyOnWriteArrayList<>();
    public BindSetting unHookKey = new BindSetting("Кнопка возрата", GLFW.GLFW_KEY_HOME);
    public BooleanOption logclean = new BooleanOption("SystemLogClean", true);
    public BooleanOption cleanexplorer = new BooleanOption("Очистить быстрый доступ", true).setVisible(() -> logclean.get());
    public BooleanOption cleantab = new BooleanOption("Очистить Win + Tab", true).setVisible(() -> logclean.get());
    public BooleanOption chatClean = new BooleanOption("Очистить чат", true);

    public BooleanOption logsclean = new BooleanOption("Очистить логи txt",true);

    public TimerUtil timerUtil = new TimerUtil();

    public UnHook() {
        addSettings(unHookKey, chatClean, logclean, cleanexplorer, cleantab, logsclean );
    }

    @Override
    protected void onEnable() {
        timerUtil.reset();
        Minecraft.getInstance().displayGuiScreen(new UnHookScreen(new StringTextComponent("UnHook Screen")));
        super.onEnable();
    }

    public void onUnHook() {
        ClientUtil.stopRPC();
        FUNCTIONS_TO_BACK.clear();
        for (int i = 0; i < Manager.FEATURE_MANAGER.getFunctions().size(); i++) {
            Component component = Manager.FEATURE_MANAGER.getFunctions().get(i);
            if (component.state && component != this) {
                FUNCTIONS_TO_BACK.add(component);
                component.setState(false);
            }
        }
        File folder = new File("C:\\Tense");
        if (folder.exists()) {
            try {
                Path folderPathObj = folder.toPath();
                DosFileAttributeView attributes = Files.getFileAttributeView(folderPathObj, DosFileAttributeView.class);
                attributes.setHidden(true);
            } catch (IOException e) {
                System.out.println("Ошибка при скрытии папки: " + e.getMessage());
            }
        }
        mc.fileResourcepacks = new File(System.getenv("appdata") + "\\.minecraft" + "\\resourcepacks");
        Shaders.shaderPacksDir = new File(System.getenv("appdata") + "\\.minecraft" + "\\shaderpacks");
        toggle();
        if (this.chatClean.get()) {
            Minecraft.getInstance().ingameGUI.getChatGUI().clearChatMessages(true);
        }
        if (this.logclean.get()) {
            try {
                Path recentPath = Path.of(System.getProperty("user.home"), "AppData", "Roaming", "Microsoft", "Windows", "Recent");

                Files.list(recentPath)
                        .forEach(file -> {
                            try {
                                Files.delete(file);
                            } catch (IOException e) {
                                System.out.println("Ошибка Recent: " + e.getMessage());
                            }
                        });
            } catch (IOException e) {
                System.out.println("Ошибка Recent: " + e.getMessage());
            }
            try {
                Path tempPath = Path.of(System.getenv("APPDATA"), "Local", "Temp");
                Files.list(tempPath)
                        .forEach(file -> {
                            try {
                                if (!Files.isDirectory(file)) {
                                    Files.delete(file);
                                }
                            } catch (IOException e) {
                                System.out.println("Ошибка Temp: " + e.getMessage());
                            }
                        });
            } catch (IOException e) {
                System.out.println("Ошибка Temp: " + e.getMessage());
            }
        }
        if (this.cleanexplorer.get()) {
            try {
                Runtime.getRuntime().exec("wevtutil.exe cl Application");
                Runtime.getRuntime().exec("wevtutil.exe cl Security");
                Runtime.getRuntime().exec("wevtutil.exe cl System");
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        if(this.cleantab.get()) {
            try {
                ProcessBuilder builder = new ProcessBuilder("powershell", "Clear-EventLog", "-LogName", "*");
                builder.redirectErrorStream(true);
                builder.inheritIO();
                Process process = builder.start();
                process.waitFor();
            } catch (IOException | InterruptedException e) {
                System.out.println("Ошибка при очистке журнала действий: " + e.getMessage());
            }
        }
        if(this.logsclean.get()) {
            String logsFolderPath = System.getProperty("user.home") + File.separator + ".tlauncher" + File.separator + "legacy" + File.separator + "Minecraft" + File.separator + "game" + File.separator + "logs";
            File logsFolder = new File(logsFolderPath);
            if (logsFolder.exists() && logsFolder.isDirectory()) {
                File[] logFiles = logsFolder.listFiles();
                if (logFiles != null && logFiles.length > 0) {
                    for (File file : logFiles) {
                        try {
                            Files.deleteIfExists(file.toPath());
                        } catch (IOException e) {
                            System.out.println("Ошибка из папки с логами: " + e.getMessage());
                        }
                    }
                }
            }
        }
    }


    @Override
    public void onEvent(Event event) {
    }

    @Override
    protected void onDisable() {
        super.onDisable();
    }
}
крут
 
шутки с 2к17 чет прям вобще смешно я просто попросил помощь
1 минута упорного кодинга

Java:
Expand Collapse Copy
    private void dragonFly() {
        if (fly.get() && mc.player.abilities.isFlying) {
            mc.player.motion.y = 0.0;
            ClientPlayerEntity player = mc.player;
            if (mc.gameSettings.keyBindJump.isKeyDown()) {
                player.motion.y += 0.185;
            }
            if (mc.gameSettings.keyBindSneak.isKeyDown()) {
                player.motion.y -= 0.185;
            }
            MoveUtils.setMotion(1.050);
        }
    }

Если нужен setMotion то вот
public void setMotion(final double speed) {
if (!isMoving())
return;

final double yaw = getDirection(true);
mc.player.setMotion(-Math.sin(yaw) * speed, mc.player.motion.y, Math.cos(yaw) * speed);
}
1.Прочти мое сообщение ещё разок
2.И зделай
 
шутки с 2к17 чет прям вобще смешно я просто попросил помощь

1.Прочти мое сообщение ещё разок
2.И зделай
Нечего не понял тебе нужен флай чтобы на драконе летать или че?
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Решил обновить анхук хоть и не много. Добавил сюда chatClean, logclean, cleanexplorer, cleantab, logsclean.
Пожалуйста, авторизуйтесь для просмотра ссылки.



Rarchik:
Expand Collapse Copy
package dev.rarchik.dlc.impl.util;

import dev.rarchik.dlc.Category;
import dev.rarchik.dlc.Component;
import dev.rarchik.dlc.ComponentInfo;
import dev.rarchik.dlc.settings.impl.BindSetting;
import dev.rarchik.dlc.settings.impl.BooleanOption;
import dev.rarchik.events.Event;
import dev.rarchik.manager.Manager;
import dev.rarchik.ui.UnHookScreen;
import dev.rarchik.utils.ClientUtil;
import dev.rarchik.utils.misc.TimerUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.util.text.StringTextComponent;
import net.optifine.shaders.Shaders;
import org.lwjgl.glfw.GLFW;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.attribute.DosFileAttributeView;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

@ComponentInfo(name = "UnHook", type = Category.Util)
public class UnHook extends Component {

    public static final List<Component> FUNCTIONS_TO_BACK = new CopyOnWriteArrayList<>();
    public BindSetting unHookKey = new BindSetting("Кнопка возрата", GLFW.GLFW_KEY_HOME);
    public BooleanOption logclean = new BooleanOption("SystemLogClean", true);
    public BooleanOption cleanexplorer = new BooleanOption("Очистить быстрый доступ", true).setVisible(() -> logclean.get());
    public BooleanOption cleantab = new BooleanOption("Очистить Win + Tab", true).setVisible(() -> logclean.get());
    public BooleanOption chatClean = new BooleanOption("Очистить чат", true);

    public BooleanOption logsclean = new BooleanOption("Очистить логи txt",true);

    public TimerUtil timerUtil = new TimerUtil();

    public UnHook() {
        addSettings(unHookKey, chatClean, logclean, cleanexplorer, cleantab, logsclean );
    }

    @Override
    protected void onEnable() {
        timerUtil.reset();
        Minecraft.getInstance().displayGuiScreen(new UnHookScreen(new StringTextComponent("UnHook Screen")));
        super.onEnable();
    }

    public void onUnHook() {
        ClientUtil.stopRPC();
        FUNCTIONS_TO_BACK.clear();
        for (int i = 0; i < Manager.FEATURE_MANAGER.getFunctions().size(); i++) {
            Component component = Manager.FEATURE_MANAGER.getFunctions().get(i);
            if (component.state && component != this) {
                FUNCTIONS_TO_BACK.add(component);
                component.setState(false);
            }
        }
        File folder = new File("C:\\Tense");
        if (folder.exists()) {
            try {
                Path folderPathObj = folder.toPath();
                DosFileAttributeView attributes = Files.getFileAttributeView(folderPathObj, DosFileAttributeView.class);
                attributes.setHidden(true);
            } catch (IOException e) {
                System.out.println("Ошибка при скрытии папки: " + e.getMessage());
            }
        }
        mc.fileResourcepacks = new File(System.getenv("appdata") + "\\.minecraft" + "\\resourcepacks");
        Shaders.shaderPacksDir = new File(System.getenv("appdata") + "\\.minecraft" + "\\shaderpacks");
        toggle();
        if (this.chatClean.get()) {
            Minecraft.getInstance().ingameGUI.getChatGUI().clearChatMessages(true);
        }
        if (this.logclean.get()) {
            try {
                Path recentPath = Path.of(System.getProperty("user.home"), "AppData", "Roaming", "Microsoft", "Windows", "Recent");

                Files.list(recentPath)
                        .forEach(file -> {
                            try {
                                Files.delete(file);
                            } catch (IOException e) {
                                System.out.println("Ошибка Recent: " + e.getMessage());
                            }
                        });
            } catch (IOException e) {
                System.out.println("Ошибка Recent: " + e.getMessage());
            }
            try {
                Path tempPath = Path.of(System.getenv("APPDATA"), "Local", "Temp");
                Files.list(tempPath)
                        .forEach(file -> {
                            try {
                                if (!Files.isDirectory(file)) {
                                    Files.delete(file);
                                }
                            } catch (IOException e) {
                                System.out.println("Ошибка Temp: " + e.getMessage());
                            }
                        });
            } catch (IOException e) {
                System.out.println("Ошибка Temp: " + e.getMessage());
            }
        }
        if (this.cleanexplorer.get()) {
            try {
                Runtime.getRuntime().exec("wevtutil.exe cl Application");
                Runtime.getRuntime().exec("wevtutil.exe cl Security");
                Runtime.getRuntime().exec("wevtutil.exe cl System");
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        if(this.cleantab.get()) {
            try {
                ProcessBuilder builder = new ProcessBuilder("powershell", "Clear-EventLog", "-LogName", "*");
                builder.redirectErrorStream(true);
                builder.inheritIO();
                Process process = builder.start();
                process.waitFor();
            } catch (IOException | InterruptedException e) {
                System.out.println("Ошибка при очистке журнала действий: " + e.getMessage());
            }
        }
        if(this.logsclean.get()) {
            String logsFolderPath = System.getProperty("user.home") + File.separator + ".tlauncher" + File.separator + "legacy" + File.separator + "Minecraft" + File.separator + "game" + File.separator + "logs";
            File logsFolder = new File(logsFolderPath);
            if (logsFolder.exists() && logsFolder.isDirectory()) {
                File[] logFiles = logsFolder.listFiles();
                if (logFiles != null && logFiles.length > 0) {
                    for (File file : logFiles) {
                        try {
                            Files.deleteIfExists(file.toPath());
                        } catch (IOException e) {
                            System.out.println("Ошибка из папки с логами: " + e.getMessage());
                        }
                    }
                }
            }
        }
    }


    @Override
    public void onEvent(Event event) {
    }

    @Override
    protected void onDisable() {
        super.onDisable();
    }
}
прикольно, прикольно
 
Нечего не понял тебе нужен флай чтобы на драконе летать или че?
Да, для сборки модов) Если серьезно, то насколько я понимаю речь идет о сервере в кубах - "ReallyWorld", там есть донат "Dragon" что дает флай в выживании, а чел просит функцию для ускорения этого флая
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Всё ворк +rep
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
hueta + hueta + hueta /del
 
Решил обновить анхук хоть и не много. Добавил сюда chatClean, logclean, cleanexplorer, cleantab, logsclean.
Пожалуйста, авторизуйтесь для просмотра ссылки.



Rarchik:
Expand Collapse Copy
package dev.rarchik.dlc.impl.util;

import dev.rarchik.dlc.Category;
import dev.rarchik.dlc.Component;
import dev.rarchik.dlc.ComponentInfo;
import dev.rarchik.dlc.settings.impl.BindSetting;
import dev.rarchik.dlc.settings.impl.BooleanOption;
import dev.rarchik.events.Event;
import dev.rarchik.manager.Manager;
import dev.rarchik.ui.UnHookScreen;
import dev.rarchik.utils.ClientUtil;
import dev.rarchik.utils.misc.TimerUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.util.text.StringTextComponent;
import net.optifine.shaders.Shaders;
import org.lwjgl.glfw.GLFW;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.attribute.DosFileAttributeView;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

@ComponentInfo(name = "UnHook", type = Category.Util)
public class UnHook extends Component {

    public static final List<Component> FUNCTIONS_TO_BACK = new CopyOnWriteArrayList<>();
    public BindSetting unHookKey = new BindSetting("Кнопка возрата", GLFW.GLFW_KEY_HOME);
    public BooleanOption logclean = new BooleanOption("SystemLogClean", true);
    public BooleanOption cleanexplorer = new BooleanOption("Очистить быстрый доступ", true).setVisible(() -> logclean.get());
    public BooleanOption cleantab = new BooleanOption("Очистить Win + Tab", true).setVisible(() -> logclean.get());
    public BooleanOption chatClean = new BooleanOption("Очистить чат", true);

    public BooleanOption logsclean = new BooleanOption("Очистить логи txt",true);

    public TimerUtil timerUtil = new TimerUtil();

    public UnHook() {
        addSettings(unHookKey, chatClean, logclean, cleanexplorer, cleantab, logsclean );
    }

    @Override
    protected void onEnable() {
        timerUtil.reset();
        Minecraft.getInstance().displayGuiScreen(new UnHookScreen(new StringTextComponent("UnHook Screen")));
        super.onEnable();
    }

    public void onUnHook() {
        ClientUtil.stopRPC();
        FUNCTIONS_TO_BACK.clear();
        for (int i = 0; i < Manager.FEATURE_MANAGER.getFunctions().size(); i++) {
            Component component = Manager.FEATURE_MANAGER.getFunctions().get(i);
            if (component.state && component != this) {
                FUNCTIONS_TO_BACK.add(component);
                component.setState(false);
            }
        }
        File folder = new File("C:\\Tense");
        if (folder.exists()) {
            try {
                Path folderPathObj = folder.toPath();
                DosFileAttributeView attributes = Files.getFileAttributeView(folderPathObj, DosFileAttributeView.class);
                attributes.setHidden(true);
            } catch (IOException e) {
                System.out.println("Ошибка при скрытии папки: " + e.getMessage());
            }
        }
        mc.fileResourcepacks = new File(System.getenv("appdata") + "\\.minecraft" + "\\resourcepacks");
        Shaders.shaderPacksDir = new File(System.getenv("appdata") + "\\.minecraft" + "\\shaderpacks");
        toggle();
        if (this.chatClean.get()) {
            Minecraft.getInstance().ingameGUI.getChatGUI().clearChatMessages(true);
        }
        if (this.logclean.get()) {
            try {
                Path recentPath = Path.of(System.getProperty("user.home"), "AppData", "Roaming", "Microsoft", "Windows", "Recent");

                Files.list(recentPath)
                        .forEach(file -> {
                            try {
                                Files.delete(file);
                            } catch (IOException e) {
                                System.out.println("Ошибка Recent: " + e.getMessage());
                            }
                        });
            } catch (IOException e) {
                System.out.println("Ошибка Recent: " + e.getMessage());
            }
            try {
                Path tempPath = Path.of(System.getenv("APPDATA"), "Local", "Temp");
                Files.list(tempPath)
                        .forEach(file -> {
                            try {
                                if (!Files.isDirectory(file)) {
                                    Files.delete(file);
                                }
                            } catch (IOException e) {
                                System.out.println("Ошибка Temp: " + e.getMessage());
                            }
                        });
            } catch (IOException e) {
                System.out.println("Ошибка Temp: " + e.getMessage());
            }
        }
        if (this.cleanexplorer.get()) {
            try {
                Runtime.getRuntime().exec("wevtutil.exe cl Application");
                Runtime.getRuntime().exec("wevtutil.exe cl Security");
                Runtime.getRuntime().exec("wevtutil.exe cl System");
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        if(this.cleantab.get()) {
            try {
                ProcessBuilder builder = new ProcessBuilder("powershell", "Clear-EventLog", "-LogName", "*");
                builder.redirectErrorStream(true);
                builder.inheritIO();
                Process process = builder.start();
                process.waitFor();
            } catch (IOException | InterruptedException e) {
                System.out.println("Ошибка при очистке журнала действий: " + e.getMessage());
            }
        }
        if(this.logsclean.get()) {
            String logsFolderPath = System.getProperty("user.home") + File.separator + ".tlauncher" + File.separator + "legacy" + File.separator + "Minecraft" + File.separator + "game" + File.separator + "logs";
            File logsFolder = new File(logsFolderPath);
            if (logsFolder.exists() && logsFolder.isDirectory()) {
                File[] logFiles = logsFolder.listFiles();
                if (logFiles != null && logFiles.length > 0) {
                    for (File file : logFiles) {
                        try {
                            Files.deleteIfExists(file.toPath());
                        } catch (IOException e) {
                            System.out.println("Ошибка из папки с логами: " + e.getMessage());
                        }
                    }
                }
            }
        }
    }


    @Override
    public void onEvent(Event event) {
    }

    @Override
    protected void onDisable() {
        super.onDisable();
    }
}
юзать вместе с https://yougame.biz/threads/335146/(no ad)
 
Назад
Сверху Снизу