diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-01-18 20:42:27 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-01-18 20:42:27 +0100 |
commit | a5753a95f4726005a8ad854f684f07e483037ade (patch) | |
tree | 87448d23d54918b4096a26ce1b564b81d90e4f01 /src/main/java/at/hannibal2/skyhanni/data | |
parent | 934e6a7d106238d80f0f986ac99c044de8515e31 (diff) | |
download | skyhanni-a5753a95f4726005a8ad854f684f07e483037ade.tar.gz skyhanni-a5753a95f4726005a8ad854f684f07e483037ade.tar.bz2 skyhanni-a5753a95f4726005a8ad854f684f07e483037ade.zip |
adding repo status to /shdebug
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/repo/RepoManager.kt | 23 |
1 files changed, 23 insertions, 0 deletions
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()) { |