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

walkmc.nbt.NamespacedKeyAdapter.kt Maven / Gradle / Ivy

There is a newer version: 2.4.0
Show newest version
package walkmc.nbt

import net.minecraft.server.*
import org.bukkit.entity.*
import walkmc.*

/**
 * A tag adapter for adapting [Player].
 */
object NamespacedKeyAdapter : TagAdapter {
   override fun load(key: String, tag: NBTTagCompound): NamespacedKey {
      return NamespacedKey.from(tag.getString(key))
   }
   
   override fun save(key: String, value: NamespacedKey, tag: NBTTagCompound) {
      tag.setString(key, value.toString())
   }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy