E - the element typepublic final class RegistryElementCodec<E> extends Object implements com.mojang.serialization.Codec<Supplier<E>>
The codec's saves and loads Supplier<E> in order to avoid early
loading from registry before a registry is fully loaded from a codec.
RegistryCodec,
RegistryReadingOps,
RegistryOps| Modifier and Type | Field and Description |
|---|---|
private com.mojang.serialization.Codec<E> |
elementCodec |
private boolean |
field_26758 |
private RegistryKey<? extends Registry<E>> |
registryRef |
| Modifier | Constructor and Description |
|---|---|
private |
RegistryElementCodec(RegistryKey<? extends Registry<E>> registryRef,
com.mojang.serialization.Codec<E> codec,
boolean bool) |
| Modifier and Type | Method and Description |
|---|---|
<T> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<Supplier<E>,T>> |
decode(com.mojang.serialization.DynamicOps<T> ops,
T input) |
<T> com.mojang.serialization.DataResult<T> |
encode(Supplier<E> supplier,
com.mojang.serialization.DynamicOps<T> dynamicOps,
T t) |
private static <E> RegistryElementCodec<E> |
method_31192(RegistryKey<? extends Registry<E>> registryKey,
com.mojang.serialization.Codec<E> codec,
boolean bool) |
static <E> com.mojang.serialization.Codec<List<Supplier<E>>> |
method_31194(RegistryKey<? extends Registry<E>> registryKey,
com.mojang.serialization.Codec<E> codec) |
static <E> RegistryElementCodec<E> |
of(RegistryKey<? extends Registry<E>> registryRef,
com.mojang.serialization.Codec<E> codec) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcheckRange, comapFlatMap, compoundList, deprecated, dispatch, dispatch, dispatchMap, dispatchMap, dispatchStable, doubleRange, either, fieldOf, flatComapMap, flatXmap, floatRange, intRange, list, listOf, mapEither, mapPair, mapResult, of, of, of, of, optionalField, optionalFieldOf, optionalFieldOf, optionalFieldOf, optionalFieldOf, orElse, orElse, orElse, orElseGet, orElseGet, orElseGet, pair, partialDispatch, promotePartial, simpleMap, stable, unboundedMap, unit, unit, withLifecycle, xmapprivate final RegistryKey<? extends Registry<E>> registryRef
private final com.mojang.serialization.Codec<E> elementCodec
private final boolean field_26758
private RegistryElementCodec(RegistryKey<? extends Registry<E>> registryRef, com.mojang.serialization.Codec<E> codec, boolean bool)
public static <E> RegistryElementCodec<E> of(RegistryKey<? extends Registry<E>> registryRef, com.mojang.serialization.Codec<E> codec)
public static <E> com.mojang.serialization.Codec<List<Supplier<E>>> method_31194(RegistryKey<? extends Registry<E>> registryKey, com.mojang.serialization.Codec<E> codec)
private static <E> RegistryElementCodec<E> method_31192(RegistryKey<? extends Registry<E>> registryKey, com.mojang.serialization.Codec<E> codec, boolean bool)
public <T> com.mojang.serialization.DataResult<T> encode(Supplier<E> supplier, com.mojang.serialization.DynamicOps<T> dynamicOps, T t)
public <T> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<Supplier<E>,T>> decode(com.mojang.serialization.DynamicOps<T> ops, T input)