From ee84a09894c450c35ac619cd3870b3887059985d Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Wed, 19 Apr 2023 15:34:43 +0200 Subject: composter fix (#50) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../java/at/hannibal2/skyhanni/events/RepositoryReloadEvent.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 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 06fbc93d6..5cfd59aa1 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/RepositoryReloadEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/RepositoryReloadEvent.kt @@ -5,8 +5,9 @@ import com.google.gson.Gson import com.google.gson.JsonObject import java.io.File -class RepositoryReloadEvent(private val repoLocation: File, val gson: Gson): LorenzEvent() { - fun getConstant(constant: String): JsonObject? { - return RepoUtils.getConstant(repoLocation, constant, gson) - } +class RepositoryReloadEvent(val repoLocation: File, val gson: Gson): LorenzEvent() { + fun getConstant(constant: String) = getConstant(constant) + + inline fun getConstant(constant: String) = + RepoUtils.getConstant(repoLocation, constant, gson, T::class.java) } \ No newline at end of file -- cgit