From c38dcee2c5f483ef5990ae9204355e1bc3c2bf74 Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Mon, 28 Oct 2024 12:07:55 +0100 Subject: Make REI optional --- src/main/kotlin/util/compatloader/CompatLoader.kt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/main/kotlin/util/compatloader/CompatLoader.kt') 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(val kClass: Class) { + constructor(kClass: KClass) : this(kClass.java) + val loader: ServiceLoader = ServiceLoader.load(kClass) val allValidInstances by lazy { loader.reload() -- cgit