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¶
codec¶
Converts a KSerializer into a Codec.
descriptor¶
open override val descriptor: SerialDescriptor
registry¶
Parameters
- registry: The ResourceKey of the registry this serializer is scoped to.
streamCodec¶
val <T : Any> KSerializer<T>.streamCodec: StreamCodec<RegistryFriendlyByteBuf, T>
Converts any KSerializer into a StreamCodec using Cbor
Functions¶
deserialize¶
open override fun deserialize(decoder: Decoder): ResourceKey<*>
serialize¶
open override fun serialize(encoder: Encoder, value: ResourceKey<*>)