Update NBTData.kt
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
@file:Suppress("MemberVisibilityCanBePrivate")
|
||||||
|
|
||||||
package net.axay.kspigot.data
|
package net.axay.kspigot.data
|
||||||
|
|
||||||
import net.axay.kspigot.annotations.NMS_General
|
import net.axay.kspigot.annotations.NMS_General
|
||||||
@@ -47,6 +49,16 @@ class NBTData {
|
|||||||
dataType.writeToCompound(key, value, nbtTagCompound)
|
dataType.writeToCompound(key, value, nbtTagCompound)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method removes the
|
||||||
|
* given [key] from the NBTTagCompound.
|
||||||
|
* Its value will be lost.
|
||||||
|
*/
|
||||||
|
fun remove(key: String) = nbtTagCompound.remove(key)
|
||||||
|
|
||||||
|
/** @see remove */
|
||||||
|
operator fun minusAssign(key: String) = remove(key)
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
||||||
fun deserialize(nbtString: String) = NBTData(nbtString)
|
fun deserialize(nbtString: String) = NBTData(nbtString)
|
||||||
|
Reference in New Issue
Block a user