aboutsummaryrefslogtreecommitdiff
path: root/src/features/globalSettings/index.js
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-10-04 21:23:48 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-10-04 21:23:48 +0800
commit2d463dc118b0d73605906ae0c2e4419bf39e8571 (patch)
treeda97464dadad112db7975c35fa931b4bd5ee9be6 /src/features/globalSettings/index.js
parent3a8cc7cc26ac3b48734b167d7ea2a6fef66cd513 (diff)
downloadSoopyV2-2d463dc118b0d73605906ae0c2e4419bf39e8571.tar.gz
SoopyV2-2d463dc118b0d73605906ae0c2e4419bf39e8571.tar.bz2
SoopyV2-2d463dc118b0d73605906ae0c2e4419bf39e8571.zip
+ 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
Diffstat (limited to 'src/features/globalSettings/index.js')
-rw-r--r--src/features/globalSettings/index.js84
1 files changed, 1 insertions, 83 deletions
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")