diff --git a/common/src/main/kotlin/fr/username404/snowygui/Snowy.kt b/common/src/main/kotlin/fr/username404/snowygui/Snowy.kt index 4546c3a..49a5463 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/Snowy.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/Snowy.kt @@ -11,7 +11,7 @@ import org.apache.logging.log4j.Logger import java.lang.reflect.Modifier abstract class Snowy { - protected fun Class<*>.isValidForButtonCollection(): Boolean = (!((Modifier.isAbstract(javaClass.modifiers)) || javaClass.isAnnotationPresent(ButtonInfo.Ignored::class.java))) + protected fun Class<*>.isValidForButtonCollection(): Boolean = (!((Modifier.isAbstract(javaClass.modifiers)) || javaClass.annotations.any { it is ButtonInfo && it.ignored })) private val displayInitMessage: Boolean by Configuration companion object { val MissingComponent: TranslatableComponent = object: TranslatableComponent(null) { override fun getString(): String = "MISSING_COMPONENT" } diff --git a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonInfo.kt b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonInfo.kt index 4218139..0d417be 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonInfo.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonInfo.kt @@ -11,13 +11,9 @@ import net.minecraft.network.chat.TranslatableComponent @Retention(AnnotationRetention.RUNTIME) annotation class ButtonInfo( val parent: Category, - val kind: Type = Type.TOGGLE + val kind: Type = Type.TOGGLE, + val ignored: Boolean = false /** Excludes a class from button collection **/ ) { - /** - * Excludes a class from button collection - */ - annotation class Ignored - companion object { internal var lightningFactor: Float = 0.33F enum class Type { diff --git a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/Macro.kt b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/Macro.kt index fb1b7c0..22d89f4 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/Macro.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/Macro.kt @@ -9,8 +9,7 @@ import net.minecraft.client.Minecraft * @property title The title of the macro */ @Serializable -@ButtonInfo.Ignored -@ButtonInfo(Category.MACROS, kind = Type.CLICK) +@ButtonInfo(Category.MACROS, kind = Type.CLICK, ignored = true) data class Macro( @JvmField var command: String, override var title: String = command