aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/data
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/repo/RepoManager.kt23
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()) {