Skip to content
On this page
通用

KattonDependencyApi

top.katton.apicommon/src/main/kotlin/top/katton/api/KattonDependencyApi.kt
Script-facing access to optional mod and plugin dependency state.

dependencies

dependencies通用对象
kotlin
object dependencies

Script-facing access to optional mod and plugin dependency state.

dependencies.isLoaded

dependencies.isLoaded通用函数
kotlin
fun isLoaded(id: String): Boolean

Returns whether the current platform dependency is installed and enabled.

dependencies.version

dependencies.version通用函数
kotlin
fun version(id: String): String?

Returns the installed dependency version, or null when the dependency is unavailable.

dependencies.require

dependencies.require通用函数
kotlin
fun require(id: String)

Returns the installed and enabled dependency.

异常

异常说明
IllegalStateExceptionwhen the dependency is not installed or enabled