Suppress a deprecation warning in FabricInit.kt

This commit is contained in:
Username404 2021-12-10 19:52:26 +01:00
parent 9f8d48b75d
commit e9bd039317
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 4 additions and 2 deletions

View File

@ -32,8 +32,10 @@ class FabricInit: Snowy(), ClientModInitializer {
val classSet = mutableSetOf<Class<out ButtonImpl>>()
buttonsDirectory.run {
listDirectoryEntries("*.class").forEach { file ->
val foundClass = FabricLauncherBase.getClass(file.pathString.drop(1).replace('/', '.').removeSuffix(".class"))
if (foundClass.isValidForButtonCollection()) classSet.add(foundClass.asSubclass(ButtonImpl::class.java))
@Suppress("DEPRECATION")
FabricLauncherBase.getClass(file.pathString.drop(1).replace('/', '.').removeSuffix(".class")).let { foundClass ->
if (foundClass.isValidForButtonCollection()) classSet.add(foundClass.asSubclass(ButtonImpl::class.java))
}
}
}
classSet