Package net.minecraft.util.registry
Class SimpleRegistryCodec<E>
- java.lang.Object
-
- net.minecraft.util.registry.SimpleRegistryCodec<E>
-
- All Implemented Interfaces:
com.mojang.serialization.Codec<SimpleRegistry<E>>
,com.mojang.serialization.Decoder<SimpleRegistry<E>>
,com.mojang.serialization.Encoder<SimpleRegistry<E>>
public final class SimpleRegistryCodec<E> extends java.lang.Object implements com.mojang.serialization.Codec<SimpleRegistry<E>>
-
-
Field Summary
Fields Modifier and Type Field Description private com.mojang.serialization.Codec<SimpleRegistry<E>>
directCodec
private com.mojang.serialization.Codec<E>
elementCodec
private RegistryKey<? extends Registry<E>>
registryKey
-
Constructor Summary
Constructors Modifier Constructor Description private
SimpleRegistryCodec(RegistryKey<? extends Registry<E>> p_i232587_1_, com.mojang.serialization.Lifecycle p_i232587_2_, com.mojang.serialization.Codec<E> p_i232587_3_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <E> SimpleRegistryCodec<E>
create(RegistryKey<? extends Registry<E>> p_241793_0_, com.mojang.serialization.Lifecycle p_241793_1_, com.mojang.serialization.Codec<E> p_241793_2_)
<T> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<SimpleRegistry<E>,T>>
decode(com.mojang.serialization.DynamicOps<T> p_decode_1_, T p_decode_2_)
<T> com.mojang.serialization.DataResult<T>
encode(SimpleRegistry<E> p_encode_1_, com.mojang.serialization.DynamicOps<T> p_encode_2_, T p_encode_3_)
java.lang.String
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
-
-
-
-
Field Detail
-
directCodec
private final com.mojang.serialization.Codec<SimpleRegistry<E>> directCodec
-
registryKey
private final RegistryKey<? extends Registry<E>> registryKey
-
elementCodec
private final com.mojang.serialization.Codec<E> elementCodec
-
-
Constructor Detail
-
SimpleRegistryCodec
private SimpleRegistryCodec(RegistryKey<? extends Registry<E>> p_i232587_1_, com.mojang.serialization.Lifecycle p_i232587_2_, com.mojang.serialization.Codec<E> p_i232587_3_)
-
-
Method Detail
-
create
public static <E> SimpleRegistryCodec<E> create(RegistryKey<? extends Registry<E>> p_241793_0_, com.mojang.serialization.Lifecycle p_241793_1_, com.mojang.serialization.Codec<E> p_241793_2_)
-
encode
public <T> com.mojang.serialization.DataResult<T> encode(SimpleRegistry<E> p_encode_1_, com.mojang.serialization.DynamicOps<T> p_encode_2_, T p_encode_3_)
- Specified by:
encode
in interfacecom.mojang.serialization.Encoder<E>
-
decode
public <T> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<SimpleRegistry<E>,T>> decode(com.mojang.serialization.DynamicOps<T> p_decode_1_, T p_decode_2_)
- Specified by:
decode
in interfacecom.mojang.serialization.Decoder<E>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-