aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/events
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/events')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/events/RepositoryReloadEvent.kt5
1 files changed, 3 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 18ff50b0a..8010564a0 100644
--- a/src/main/java/at/hannibal2/skyhanni/events/RepositoryReloadEvent.kt
+++ b/src/main/java/at/hannibal2/skyhanni/events/RepositoryReloadEvent.kt
@@ -5,12 +5,13 @@ import at.hannibal2.skyhanni.test.command.ErrorManager
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) = try {
- RepoUtils.getConstant(repoLocation, constant, gson, T::class.java)
+ inline fun <reified T : Any> getConstant(constant: String, type: Type? = null) = try {
+ RepoUtils.getConstant(repoLocation, constant, gson, T::class.java, type)
} catch (e: Exception) {
ErrorManager.logError(
Exception("Repo parsing error while trying to read constant '$constant'", e),