Use the full package name of FabricLauncherBase instead of importing it, to avoid another deprecation warning

This commit is contained in:
Username404 2021-12-10 20:21:56 +01:00
parent 72e118d45a
commit 3a0dfb176d
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 1 additions and 2 deletions

View File

@ -8,7 +8,6 @@ import net.fabricmc.api.ClientModInitializer
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback.EVENT
import net.fabricmc.loader.api.FabricLoader
import net.fabricmc.loader.launch.common.FabricLauncherBase
import kotlin.io.path.exists
import kotlin.io.path.isDirectory
import kotlin.io.path.listDirectoryEntries
@ -32,7 +31,7 @@ class FabricInit: Snowy(), ClientModInitializer {
val classSet = mutableSetOf<Class<out ButtonImpl>>()
buttonsDirectory.run {
listDirectoryEntries("*.class").forEach { file ->
@Suppress("DEPRECATION")
@Suppress("DEPRECATION") net.fabricmc.loader.launch.common.
FabricLauncherBase.getClass(file.pathString.drop(1).replace('/', '.').removeSuffix(".class")).let { foundClass ->
if (foundClass.isValidForButtonCollection()) classSet.add(foundClass.asSubclass(ButtonImpl::class.java))
}