E - the registry's element typepublic final class RegistryCodec<E> extends Object implements com.mojang.serialization.Codec<SimpleRegistry<E>>
SimpleRegistry.
Compared to regular codec, this codec performs additional work when decoding, loading its elements from the given resource manager's JSON files.
RegistryElementCodec,
RegistryOps| Modifier and Type | Field and Description |
|---|---|
private com.mojang.serialization.Codec<SimpleRegistry<E>> |
delegate |
private com.mojang.serialization.MapCodec<E> |
elementCodec |
private RegistryKey<Registry<E>> |
registryRef |
| Modifier | Constructor and Description |
|---|---|
private |
RegistryCodec(RegistryKey<Registry<E>> registryRef,
com.mojang.serialization.Lifecycle lifecycle,
com.mojang.serialization.MapCodec<E> mapCodec) |
| Modifier and Type | Method and Description |
|---|---|
<T> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<SimpleRegistry<E>,T>> |
decode(com.mojang.serialization.DynamicOps<T> ops,
T input) |
<T> com.mojang.serialization.DataResult<T> |
encode(SimpleRegistry<E> simpleRegistry,
com.mojang.serialization.DynamicOps<T> dynamicOps,
T t) |
static <E> RegistryCodec<E> |
of(RegistryKey<Registry<E>> registryRef,
com.mojang.serialization.Lifecycle lifecycle,
com.mojang.serialization.MapCodec<E> mapCodec) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcomapFlatMap, compoundList, deprecated, dispatch, dispatch, dispatchDeprecated, dispatchDeprecated, dispatchDeprecatedMap, dispatchDeprecatedMap, dispatchMap, dispatchMap, dispatchStable, dispatchStable, dispatchStableMap, dispatchStableMap, either, fieldOf, flatComapMap, flatXmap, list, listOf, mapEither, mapPair, mapResult, of, of, of, of, optionalField, optionalFieldOf, optionalFieldOf, optionalFieldOf, optionalFieldOf, pair, partialDispatch, partialDispatchMap, promotePartial, simpleMap, stable, unboundedMap, unit, unit, withDefault, withDefault, withDefault, withDefault, withDefault, withDefault, withLifecycle, xmapprivate final com.mojang.serialization.Codec<SimpleRegistry<E>> delegate
private final RegistryKey<Registry<E>> registryRef
private final com.mojang.serialization.MapCodec<E> elementCodec
private RegistryCodec(RegistryKey<Registry<E>> registryRef, com.mojang.serialization.Lifecycle lifecycle, com.mojang.serialization.MapCodec<E> mapCodec)
public static <E> RegistryCodec<E> of(RegistryKey<Registry<E>> registryRef, com.mojang.serialization.Lifecycle lifecycle, com.mojang.serialization.MapCodec<E> mapCodec)
public <T> com.mojang.serialization.DataResult<T> encode(SimpleRegistry<E> simpleRegistry, com.mojang.serialization.DynamicOps<T> dynamicOps, T t)
encode in interface com.mojang.serialization.Encoder<SimpleRegistry<E>>public <T> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<SimpleRegistry<E>,T>> decode(com.mojang.serialization.DynamicOps<T> ops, T input)
decode in interface com.mojang.serialization.Decoder<SimpleRegistry<E>>