diff options
Diffstat (limited to 'src/main/java/at')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt | 1 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/repo/RepoManager.kt | 23 |
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()) { |