From e9bd03931773f92717a180cebd1ecfee9b2f0bed Mon Sep 17 00:00:00 2001 From: Username404 Date: Fri, 10 Dec 2021 19:52:26 +0100 Subject: [PATCH] Suppress a deprecation warning in FabricInit.kt --- .../kotlin/fr/username404/snowygui/fabric/FabricInit.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fabric/src/main/kotlin/fr/username404/snowygui/fabric/FabricInit.kt b/fabric/src/main/kotlin/fr/username404/snowygui/fabric/FabricInit.kt index a61d956..4cc99f2 100644 --- a/fabric/src/main/kotlin/fr/username404/snowygui/fabric/FabricInit.kt +++ b/fabric/src/main/kotlin/fr/username404/snowygui/fabric/FabricInit.kt @@ -32,8 +32,10 @@ class FabricInit: Snowy(), ClientModInitializer { val classSet = mutableSetOf>() 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