Class ExtensibleCodecBase<R>
java.lang.Object
net.rebel459.unified.api.codec.ExtensibleCodecBase<R>
- Direct Known Subclasses:
ExtensibleCodec, ExtensibleEntityCodec
Shared storage and serialization for extensible codecs with specialized registration APIs.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic final classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.Codec<ExtensibleCodecBase.Entry<R>> codec()Provides a codec which can be used with a named field.com.mojang.serialization.Codec<ExtensibleCodecBase.Entry<R>> booleancontains(net.minecraft.resources.Identifier id) com.mojang.serialization.MapCodec<ExtensibleCodecBase.Entry<R>> mapCodec()Gets a flat-level codec.com.mojang.serialization.MapCodec<ExtensibleCodecBase.Entry<R>> protected <C extends ExtensibleCodecBase.Complex<R,?>>
CregisterComplexType(C type) protected <S extends ExtensibleCodecBase.Simple<R>>
SregisterSimpleType(S type)
-
Constructor Details
-
ExtensibleCodecBase
public ExtensibleCodecBase()
-
-
Method Details
-
contains
public boolean contains(net.minecraft.resources.Identifier id) -
registerSimpleType
-
registerComplexType
-
codec
Provides a codec which can be used with a named field. If the identifier has no additional fields, it can be displayed compactly If the identifier has no additional fields, it can be displayed compactly like "[field_name]": "[identifier]" Otherwise, it can be displayed in full like: { "[type_field]": "[identifier]", "[other_field]": "[other_value]", ... } -
codec
-
mapCodec
Gets a flat-level codec. -
mapCodec
-