get With Default
fun <P : Any, C : Any, T : PersistentDataType<P, C>, DefaultPersistentDataType<C>> PersistentDataContainer.getWithDefault(key: String, type: T, default: C = type.defaultValue): C(source)
This method is used to get the value of the specified key from the PersistentDataContainer.
default is interfere from the DefaultPersistentDataType
If the key does not exist, it will return default.
Author
Fantamomo
Since
1.0-SNAPSHOT
Parameters
key
The key to get the value for.
type
The type of the value to get.
default
The default value to return if the key does not exist.