diff --git a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonImpl.kt b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonImpl.kt index 8abb662..a3e05de 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonImpl.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonImpl.kt @@ -41,13 +41,13 @@ sealed class ButtonImpl: ColoredElement(0.0, 0.0, 73, 8, opacity = 0.60F) { @JvmStatic fun initButtons() = addButtons( *Snowy.annotatedButtons.mapNotNull { - ((try { + try { it.getConstructor().newInstance() } catch (e: NoSuchMethodException) { try { it.getDeclaredField("INSTANCE").get(null) } catch (e: NoSuchFieldException) {} - }) as? ButtonImpl) + } as? ButtonImpl }.filterNot { (it.info.parent == Category.RISKY) && !riskyCheats }.plus(Configuration.foundMacros).toTypedArray()