From 2d463dc118b0d73605906ae0c2e4419bf39e8571 Mon Sep 17 00:00:00 2001 From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> Date: Tue, 4 Oct 2022 21:23:48 +0800 Subject: + fix game freeze on first dungeon of the day + (potential) fix memory leak when doing lots of /ct reload + add seperate setting for powder info on hud to rest of powder features --- src/features/globalSettings/index.js | 84 +----------------------------------- 1 file changed, 1 insertion(+), 83 deletions(-) (limited to 'src/features/globalSettings/index.js') diff --git a/src/features/globalSettings/index.js b/src/features/globalSettings/index.js index 3e9ded1..896271b 100644 --- a/src/features/globalSettings/index.js +++ b/src/features/globalSettings/index.js @@ -483,6 +483,7 @@ class GlobalSettings extends Feature { let j = 0; let now = Date.now(); let thunderText = []; + if (!Player.getInventory()) return [...Player.getInventory().getItems()].forEach(i => { j++; if (i) { @@ -911,89 +912,6 @@ class GlobalSettings extends Feature { return false } } - findKey() { - new Notification("Finding key...", []) - new Thread(() => { - - // NEU - try { - let testKey = JSON.parse(new JavaString(Files.readAllBytes(Paths.get("./config/notenoughupdates/configNew.json")))).apiKey.apiKey - if (testKey) { - if (this.verifyKey(testKey)) { - this.apiKeySetting.setValue(testKey) - new Notification("§aSuccess!", ["Found api key in NotEnoughUpdates!"]) - return; - } else { - logger.logMessage("Found invalid key in NotEnoughUpdates", 3) - } - } - } catch (_) { } - - // SBE - try { - let testKey = JSON.parse(new JavaString(Files.readAllBytes(Paths.get("./config/SkyblockExtras.cfg")))).values.apiKey - if (testKey) { - if (this.verifyKey(testKey)) { - this.apiKeySetting.setValue(testKey) - new Notification("§aSuccess!", ["Found api key in SkyblockExtras!"]) - return; - } else { - logger.logMessage("Found invalid key in SkyblockExtras", 3) - } - } - } catch (_) { } - // SKYTILS - try { - let testKey2 = new JavaString(Files.readAllBytes(Paths.get("./config/skytils/config.toml"))) - let testKey = undefined - testKey2.split("\n").forEach(line => { - if (line.startsWith(" hypixel_api_key = \"")) { - testKey = line.split("\"")[1] - } - }) - if (testKey) { - if (this.verifyKey(testKey)) { - this.apiKeySetting.setValue(testKey) - new Notification("§aSuccess!", ["Found api key in Skytils!"]) - return; - } else { - logger.logMessage("Found invalid key in Skytils", 3) - } - } - } catch (_) { } - - // SOOPYADDONS DATA - try { - let testKey = FileLib.read("soopyAddonsData", "apikey.txt") - if (testKey) { - if (this.verifyKey(testKey)) { - this.apiKeySetting.setValue(testKey) - new Notification("§aSuccess!", ["Found api key in old soopyaddons version!"]) - return; - } else { - logger.logMessage("Found invalid key in soopyaddonsData", 3) - } - } - } catch (_) { } - - // HypixelApiKeyManager - try { - let testKey = JSON.parse(FileLib.read("HypixelApiKeyManager", "localdata.json")).key - if (testKey) { - if (this.verifyKey(testKey)) { - this.apiKeySetting.setValue(testKey) - new Notification("§aSuccess!", ["Found api key in HypixelApiKeyManager!"]) - return; - } else { - logger.logMessage("Found invalid key in HypixelApiKeyManager", 3) - } - } - } catch (_) { } - - - new Notification("§cUnable to find api key", []) - }).start() - } apiNewCommand() { ChatLib.command("api new") -- cgit