diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/events')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/events/RepositoryReloadEvent.kt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/events/RepositoryReloadEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/RepositoryReloadEvent.kt index e0eb01b9b..3b2b426fe 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/RepositoryReloadEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/RepositoryReloadEvent.kt @@ -1,16 +1,16 @@ package at.hannibal2.skyhanni.events import at.hannibal2.skyhanni.data.repo.RepoError +import at.hannibal2.skyhanni.data.repo.RepoManager import at.hannibal2.skyhanni.data.repo.RepoUtils import com.google.gson.Gson -import com.google.gson.JsonObject import java.io.File import java.lang.reflect.Type class RepositoryReloadEvent(val repoLocation: File, val gson: Gson) : LorenzEvent() { - fun getConstant(constant: String) = getConstant<JsonObject>(constant) inline fun <reified T : Any> getConstant(constant: String, type: Type? = null): T = try { + RepoManager.setlastConstant(constant) if (!repoLocation.exists()) throw RepoError("Repo folder does not exist!") RepoUtils.getConstant(repoLocation, constant, gson, T::class.java, type) } catch (e: Exception) { |