ru.astrainteractive.astralibs.persistence.BukkitConstant.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core-bukkit Show documentation
Show all versions of core-bukkit Show documentation
Core utilities for spigot development
The newest version!
package ru.astrainteractive.astralibs.persistence
import org.bukkit.NamespacedKey
import org.bukkit.persistence.PersistentDataType
import org.bukkit.plugin.Plugin
interface BukkitConstant {
val value: NamespacedKey
val dataType: PersistentDataType
class Default(
override val value: NamespacedKey,
override val dataType: PersistentDataType
) : BukkitConstant
}
@Suppress("FunctionNaming")
fun BukkitConstant(plugin: Plugin, key: String, dataType: PersistentDataType): BukkitConstant {
return BukkitConstant.Default(
value = NamespacedKey(plugin, key),
dataType = dataType
)
}
@Suppress("FunctionNaming")
fun BukkitConstant(namespace: String, key: String, dataType: PersistentDataType): BukkitConstant {
return BukkitConstant.Default(
value = NamespacedKey(namespace, key),
dataType = dataType
)
}