package at.hannibal2.skyhanni.utils import java.lang.reflect.* val Class.allFields: List get() = this.declaredFields.toList() + (this.superclass?.allFields ?: listOf()) val Class.allAccessibleFields: List get() = allFields.also { it.forEach { it.isAccessible = true } } val Type.nonGeneric: Class<*>? get() = when (this) { is ParameterizedType -> this.rawType.nonGeneric is Class<*> -> this is WildcardType -> this.upperBounds[0].nonGeneric is TypeVariable<*> -> this.bounds[0].nonGeneric else -> null }