aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/events
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal002@users.noreply.github.com>2023-04-19 15:34:43 +0200
committerGitHub <noreply@github.com>2023-04-19 15:34:43 +0200
commitee84a09894c450c35ac619cd3870b3887059985d (patch)
tree67a3754e86c4f720a6d98370c6289c520e4ce5b9 /src/main/java/at/hannibal2/skyhanni/events
parent8161cf66231cec9a18a4db74e5334065f23f9073 (diff)
downloadskyhanni-ee84a09894c450c35ac619cd3870b3887059985d.tar.gz
skyhanni-ee84a09894c450c35ac619cd3870b3887059985d.tar.bz2
skyhanni-ee84a09894c450c35ac619cd3870b3887059985d.zip
composter fix (#50)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/events')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/events/RepositoryReloadEvent.kt9
1 files changed, 5 insertions, 4 deletions
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<JsonObject>(constant)
+
+ inline fun <reified T : Any> getConstant(constant: String) =
+ RepoUtils.getConstant(repoLocation, constant, gson, T::class.java)
} \ No newline at end of file