-
-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding support for grabbing the api key from other mods: neu, cow, ds…
…m, dg, st, soopy and sbe
- Loading branch information
1 parent
0be6c7f
commit e09e8bc
Showing
4 changed files
with
118 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package at.hannibal2.skyhanni.data | ||
|
||
import at.hannibal2.skyhanni.SkyHanniMod | ||
import com.google.gson.JsonObject | ||
import java.io.BufferedReader | ||
|
||
enum class OtherMod(val modName: String, val configPath: String, val readKey: (BufferedReader) -> (String)) { | ||
NEU("Not Enough Updates", "config/notenoughupdates/configNew.json", { reader -> | ||
getJson(reader)["apiData"].asJsonObject["apiKey"].asString | ||
}), | ||
COW("Cowlection", "config/cowlection/do-not-share-me-with-other-players.cfg", { reader -> | ||
val lines = reader.readText().split(System.lineSeparator()) | ||
val line = lines.find { it.startsWith(" S:moo=") }!! | ||
line.split("=")[1] | ||
}), | ||
DSM("Dankers SkyBlock Mod", "config/Danker's Skyblock Mod.cfg", { reader -> | ||
val lines = reader.readText().split(System.lineSeparator()) | ||
val line = lines.find { it.startsWith(" S:APIKey=") }!! | ||
line.split("=")[1] | ||
}), | ||
DG("Dungeons Guide", "config/dungeonsguide/config.json", { reader -> | ||
getJson(reader)["partykicker.apikey"].asJsonObject["apikey"].asString | ||
}), | ||
SKYTILS("Skytils", "config/skytils/config.toml", { reader -> | ||
val lines = reader.readText().split(System.lineSeparator()) | ||
val line = lines.find { it.startsWith(" hypixel_api_key = \"") }!! | ||
line.split("\"")[1] | ||
}), | ||
HYPIXEL_API_KEY_MANAGER("Hypixel API Key Manager", "HypixelApiKeyManager/localdata.json", { reader -> | ||
getJson(reader)["key"].asString | ||
}), | ||
SOOPY("Soopy Addons", "soopyAddonsData/apikey.txt", { reader -> | ||
reader.readText() | ||
}), | ||
SBE("SkyBlock Extras", "config/SkyblockExtras.cfg", { reader -> | ||
getJson(reader)["values"].asJsonObject["apiKey"].asString | ||
}), | ||
} | ||
|
||
fun getJson(reader: BufferedReader): JsonObject { | ||
return SkyHanniMod.gson.fromJson(reader, com.google.gson.JsonObject::class.java) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters