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 23d7aa4..21c4993 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 @@ -18,11 +18,11 @@ abstract class ButtonImpl: ColoredElement(0.0, 0.0, 73, 8, opacity = 0.60F) { fun initialize() { done = true Snowy.reflections.getTypesAnnotatedWith(ButtonInfo::class.java).forEach { // Initializes every button - (try { + ((try { it.getConstructor().newInstance() } catch (e: NoSuchMethodException) { it.kotlin.objectInstance - } as ButtonImpl).let { impl -> + }) as ButtonImpl).let { impl -> with(impl) { if (info.kind == ButtonInfo.Companion.Type.TOGGLE) { Configuration.enabledFeatures[title]?.let { bool ->