All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ru.astrainteractive.astralibs.persistence.BukkitConstant.kt Maven / Gradle / Ivy

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
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy