From 29904921c5d2c81b8d7cb37dcd57af9fd0761343 Mon Sep 17 00:00:00 2001 From: Brandon Date: Sun, 15 Oct 2023 10:33:55 -0300 Subject: Feature: Show alerts when the player catches a legendary sea creature (#530) dded Alerts when the player catches a legendary sea creature. #530 --- src/main/java/at/hannibal2/skyhanni/events/RepositoryReloadEvent.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/events') 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(constant) - inline fun getConstant(constant: String) = try { - RepoUtils.getConstant(repoLocation, constant, gson, T::class.java) + inline fun 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), -- cgit