Package net.minecraft.resources
Class RegistryDataPackCodec<E>
java.lang.Object
net.minecraft.resources.RegistryDataPackCodec<E>
- All Implemented Interfaces:
com.mojang.serialization.Codec<MappedRegistry<E>>
,com.mojang.serialization.Decoder<MappedRegistry<E>>
,com.mojang.serialization.Encoder<MappedRegistry<E>>
public final class RegistryDataPackCodec<E>
extends Object
implements com.mojang.serialization.Codec<MappedRegistry<E>>
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.mojang.serialization.Codec
com.mojang.serialization.Codec.ResultFunction<A extends Object>
-
Field Summary
Modifier and TypeFieldDescriptionprivate com.mojang.serialization.Codec<MappedRegistry<E>>
private com.mojang.serialization.Codec<E>
private ResourceKey<? extends Registry<E>>
Fields inherited from interface com.mojang.serialization.Codec
BOOL, BYTE, BYTE_BUFFER, DOUBLE, EMPTY, FLOAT, INT, INT_STREAM, LONG, LONG_STREAM, PASSTHROUGH, SHORT, STRING
-
Constructor Summary
ModifierConstructorDescriptionprivate
RegistryDataPackCodec(ResourceKey<? extends Registry<E>> p_135545_, com.mojang.serialization.Lifecycle p_135546_, com.mojang.serialization.Codec<E> p_135547_)
-
Method Summary
Modifier and TypeMethodDescriptionstatic <E> RegistryDataPackCodec<E>
create(ResourceKey<? extends Registry<E>> p_135559_, com.mojang.serialization.Lifecycle p_135560_, com.mojang.serialization.Codec<E> p_135561_)
<T> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<MappedRegistry<E>,T>>
decode(com.mojang.serialization.DynamicOps<T> p_135563_, T p_135564_)
<T> com.mojang.serialization.DataResult<T>
encode(MappedRegistry<E> p_135555_, com.mojang.serialization.DynamicOps<T> p_135556_, T p_135557_)
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.mojang.serialization.Codec
comapFlatMap, deprecated, dispatch, dispatch, dispatchMap, dispatchMap, dispatchStable, fieldOf, flatComapMap, flatXmap, listOf, mapResult, optionalFieldOf, optionalFieldOf, optionalFieldOf, optionalFieldOf, orElse, orElse, orElse, orElseGet, orElseGet, orElseGet, partialDispatch, promotePartial, stable, withLifecycle, xmap
Methods inherited from interface com.mojang.serialization.Decoder
boxed, decode, flatMap, map, parse, parse, simple, terminal
Methods inherited from interface com.mojang.serialization.Encoder
comap, encodeStart, flatComap
-
Field Details
-
directCodec
-
registryKey
-
elementCodec
-
-
Constructor Details
-
RegistryDataPackCodec
private RegistryDataPackCodec(ResourceKey<? extends Registry<E>> p_135545_, com.mojang.serialization.Lifecycle p_135546_, com.mojang.serialization.Codec<E> p_135547_)
-
-
Method Details
-
create
public static <E> RegistryDataPackCodec<E> create(ResourceKey<? extends Registry<E>> p_135559_, com.mojang.serialization.Lifecycle p_135560_, com.mojang.serialization.Codec<E> p_135561_) -
encode
public <T> com.mojang.serialization.DataResult<T> encode(MappedRegistry<E> p_135555_, com.mojang.serialization.DynamicOps<T> p_135556_, T p_135557_)- Specified by:
encode
in interfacecom.mojang.serialization.Encoder<E>
-
decode
public <T> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<MappedRegistry<E>,T>> decode(com.mojang.serialization.DynamicOps<T> p_135563_, T p_135564_)- Specified by:
decode
in interfacecom.mojang.serialization.Decoder<E>
-
toString
-