From 4f6bb78ddc2e6a418a555189ee665f892c85dfb4 Mon Sep 17 00:00:00 2001 From: Wyvest <45589059+Wyvest@users.noreply.github.com> Date: Wed, 27 Jul 2022 19:33:27 +0900 Subject: Allow parameters not used by the template not null-safe (#74) --- .../kotlin/cc/polyfrost/oneconfig/utils/KotlinLanguageAdapter.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/versions/src/main/kotlin/cc/polyfrost/oneconfig/utils/KotlinLanguageAdapter.kt b/versions/src/main/kotlin/cc/polyfrost/oneconfig/utils/KotlinLanguageAdapter.kt index f520f00..2e29303 100644 --- a/versions/src/main/kotlin/cc/polyfrost/oneconfig/utils/KotlinLanguageAdapter.kt +++ b/versions/src/main/kotlin/cc/polyfrost/oneconfig/utils/KotlinLanguageAdapter.kt @@ -19,10 +19,10 @@ class KotlinLanguageAdapter : ILanguageAdapter { override fun supportsStatics(): Boolean = false override fun getNewInstance( - container: FMLModContainer, objectClass: Class<*>, classLoader: ClassLoader, factoryMarkedAnnotation: Method + container: FMLModContainer?, objectClass: Class<*>, classLoader: ClassLoader?, factoryMarkedAnnotation: Method? ): Any = objectClass.kotlin.objectInstance ?: objectClass.getDeclaredConstructor().newInstance() - override fun setProxy(target: Field, proxyTarget: Class<*>, proxy: Any) { + override fun setProxy(target: Field, proxyTarget: Class<*>, proxy: Any?) { target.set(proxyTarget.kotlin.objectInstance, proxy) } @@ -30,4 +30,4 @@ class KotlinLanguageAdapter : ILanguageAdapter { } } -//#endif \ No newline at end of file +//#endif -- cgit