aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-01-18 20:42:27 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-01-18 20:42:27 +0100
commita5753a95f4726005a8ad854f684f07e483037ade (patch)
tree87448d23d54918b4096a26ce1b564b81d90e4f01 /src/main/java/at
parent934e6a7d106238d80f0f986ac99c044de8515e31 (diff)
downloadskyhanni-a5753a95f4726005a8ad854f684f07e483037ade.tar.gz
skyhanni-a5753a95f4726005a8ad854f684f07e483037ade.tar.bz2
skyhanni-a5753a95f4726005a8ad854f684f07e483037ade.zip
adding repo status to /shdebug
Diffstat (limited to 'src/main/java/at')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt1
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/repo/RepoManager.kt23
2 files changed, 24 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
index c1ef48932..f7c257706 100644
--- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
+++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
@@ -738,6 +738,7 @@ class SkyHanniMod {
configManager.saveConfig(ConfigFileType.FEATURES, "shutdown-hook")
})
repo = RepoManager(ConfigManager.configDirectory)
+ loadModule(repo)
try {
repo.loadRepoInformation()
} catch (e: Exception) {
diff --git a/src/main/java/at/hannibal2/skyhanni/data/repo/RepoManager.kt b/src/main/java/at/hannibal2/skyhanni/data/repo/RepoManager.kt
index 9dcba5e8f..8c12444ac 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/repo/RepoManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/repo/RepoManager.kt
@@ -2,11 +2,13 @@ package at.hannibal2.skyhanni.data.repo
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.config.ConfigManager
+import at.hannibal2.skyhanni.events.DebugDataCollectEvent
import at.hannibal2.skyhanni.events.RepositoryReloadEvent
import at.hannibal2.skyhanni.test.command.ErrorManager
import at.hannibal2.skyhanni.utils.LorenzUtils
import com.google.gson.JsonObject
import net.minecraft.client.Minecraft
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import org.apache.commons.io.FileUtils
import java.io.BufferedReader
import java.io.BufferedWriter
@@ -172,6 +174,27 @@ class RepoManager(private val configLocation: File) {
return comp
}
+ @SubscribeEvent
+ fun onDebugDataCollect(event: DebugDataCollectEvent) {
+ event.title("Repo Status")
+
+ if (unsuccessfulConstants.isEmpty() && successfulConstants.isNotEmpty()) {
+ event.ignore("Repo working fine")
+ return
+ }
+
+ event.addData {
+ if (successfulConstants.isNotEmpty()) add("Successful Constants (${successfulConstants.size}):")
+ for (constant in successfulConstants) {
+ add(" - $constant")
+ }
+ add("Unsuccessful Constants (${unsuccessfulConstants.size}):")
+ for (constant in unsuccessfulConstants) {
+ add(" - $constant")
+ }
+ }
+ }
+
fun displayRepoStatus(joinEvent: Boolean) {
if (joinEvent) {
if (unsuccessfulConstants.isNotEmpty()) {