diff options
Diffstat (limited to 'src/main/kotlin/util/compatloader/CompatLoader.kt')
-rw-r--r-- | src/main/kotlin/util/compatloader/CompatLoader.kt | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main/kotlin/util/compatloader/CompatLoader.kt b/src/main/kotlin/util/compatloader/CompatLoader.kt index c5d45bc..6b60e87 100644 --- a/src/main/kotlin/util/compatloader/CompatLoader.kt +++ b/src/main/kotlin/util/compatloader/CompatLoader.kt @@ -2,10 +2,13 @@ package moe.nea.firmament.util.compatloader import java.util.ServiceLoader import net.fabricmc.loader.api.FabricLoader +import kotlin.reflect.KClass import kotlin.streams.asSequence import moe.nea.firmament.Firmament abstract class CompatLoader<T : Any>(val kClass: Class<T>) { + constructor(kClass: KClass<T>) : this(kClass.java) + val loader: ServiceLoader<T> = ServiceLoader.load(kClass) val allValidInstances by lazy { loader.reload() |