Replace the @ButtonInfo.Ignored annotation with a property of ButtonInfo
This commit is contained in:
parent
dd2c01b461
commit
4143ef0e14
@ -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" }
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user