ResourceKeySerializer¶
class ResourceKeySerializer<T : Any>(val registry: ResourceKey<out Registry<T>>) : KSerializer<ResourceKey<*>>
A KSerializer for ResourceKey of a specific registry.
The serialized form is a ResourceLocation string (the key's location).
Example¶
Parameters¶
- registry: The ResourceKey of the registry this serializer is scoped to.
Constructors¶
ResourceKeySerializer¶
constructor(registry: ResourceKey<out Registry<T>>)
Parameters
- registry: The ResourceKey of the registry this serializer is scoped to.
Types¶
Companion¶
object Companion
Properties¶
descriptor¶
open override val descriptor: SerialDescriptor
registry¶
Parameters
- registry: The ResourceKey of the registry this serializer is scoped to.
Functions¶
codec¶
deserialize¶
open override fun deserialize(decoder: Decoder): ResourceKey<*>
getStreamCodec¶
inline fun <T : Any> KSerializer<T>.getStreamCodec(): StreamCodec<RegistryFriendlyByteBuf, T>
serialize¶
open override fun serialize(encoder: Encoder, value: ResourceKey<*>)