类 RegistryElementCodec<E>
- java.lang.Object
-
- net.minecraft.util.dynamic.RegistryElementCodec<E>
-
- 类型参数:
E- the element type
- 所有已实现的接口:
com.mojang.serialization.Codec<Supplier<E>>,com.mojang.serialization.Decoder<Supplier<E>>,com.mojang.serialization.Encoder<Supplier<E>>
public final class RegistryElementCodec<E> extends Object implements com.mojang.serialization.Codec<Supplier<E>>
A codec for registry elements. Will prefer to encode/decode objects as identifiers if they exist in a registry and falls back to full encoding/ decoding behavior if it cannot do so.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- Mappings:
Namespace Name official wkintermediary net/minecraft/class_5381named net/minecraft/util/dynamic/RegistryElementCodec
-
-
嵌套类概要
-
从接口继承的嵌套类/接口 com.mojang.serialization.Codec
com.mojang.serialization.Codec.ResultFunction<A extends Object>
-
-
字段概要
字段 修饰符和类型 字段 说明 private booleanallowInlineDefinitionsprivate com.mojang.serialization.Codec<E>elementCodecprivate RegistryKey<? extends Registry<E>>registryRef
-
构造器概要
构造器 限定符 构造器 说明 privateRegistryElementCodec(RegistryKey<? extends Registry<E>> registryRef, com.mojang.serialization.Codec<E> elementCodec, boolean allowInlineDefinitions)
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 <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)static <E> com.mojang.serialization.Codec<List<Supplier<E>>>method_31194(RegistryKey<? extends Registry<E>> registryRef, com.mojang.serialization.Codec<E> elementCodec)static <E> RegistryElementCodec<E>of(RegistryKey<? extends Registry<E>> registryRef, com.mojang.serialization.Codec<E> elementCodec)private static <E> RegistryElementCodec<E>of(RegistryKey<? extends Registry<E>> registryRef, com.mojang.serialization.Codec<E> elementCodec, boolean allowInlineDefinitions)StringtoString()-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
从接口继承的方法 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
-
-
-
-
字段详细资料
-
registryRef
private final RegistryKey<? extends Registry<E>> registryRef
- Mappings:
Namespace Name Mixin selector official aLwk;a:Lwo;intermediary field_25507Lnet/minecraft/class_5381;field_25507:Lnet/minecraft/class_5321;named registryRefLnet/minecraft/util/dynamic/RegistryElementCodec;registryRef:Lnet/minecraft/util/registry/RegistryKey;
-
elementCodec
private final com.mojang.serialization.Codec<E> elementCodec
- Mappings:
Namespace Name Mixin selector official bLwk;b:Lcom/mojang/serialization/Codec;intermediary field_25508Lnet/minecraft/class_5381;field_25508:Lcom/mojang/serialization/Codec;named elementCodecLnet/minecraft/util/dynamic/RegistryElementCodec;elementCodec:Lcom/mojang/serialization/Codec;
-
allowInlineDefinitions
private final boolean allowInlineDefinitions
- Mappings:
Namespace Name Mixin selector official cLwk;c:Zintermediary field_26758Lnet/minecraft/class_5381;field_26758:Znamed allowInlineDefinitionsLnet/minecraft/util/dynamic/RegistryElementCodec;allowInlineDefinitions:Z
-
-
构造器详细资料
-
RegistryElementCodec
private RegistryElementCodec(RegistryKey<? extends Registry<E>> registryRef, com.mojang.serialization.Codec<E> elementCodec, boolean allowInlineDefinitions)
- Mappings:
Namespace Name Mixin selector official <init>Lwk;<init>(Lwo;Lcom/mojang/serialization/Codec;Z)Vintermediary <init>Lnet/minecraft/class_5381;<init>(Lnet/minecraft/class_5321;Lcom/mojang/serialization/Codec;Z)Vnamed <init>Lnet/minecraft/util/dynamic/RegistryElementCodec;<init>(Lnet/minecraft/util/registry/RegistryKey;Lcom/mojang/serialization/Codec;Z)V
-
-
方法详细资料
-
of
public static <E> RegistryElementCodec<E> of(RegistryKey<? extends Registry<E>> registryRef, com.mojang.serialization.Codec<E> elementCodec)
- Mappings:
Namespace Name Mixin selector official aLwk;a(Lwo;Lcom/mojang/serialization/Codec;)Lwk;intermediary method_29749Lnet/minecraft/class_5381;method_29749(Lnet/minecraft/class_5321;Lcom/mojang/serialization/Codec;)Lnet/minecraft/class_5381;named ofLnet/minecraft/util/dynamic/RegistryElementCodec;of(Lnet/minecraft/util/registry/RegistryKey;Lcom/mojang/serialization/Codec;)Lnet/minecraft/util/dynamic/RegistryElementCodec;
-
method_31194
public static <E> com.mojang.serialization.Codec<List<Supplier<E>>> method_31194(RegistryKey<? extends Registry<E>> registryRef, com.mojang.serialization.Codec<E> elementCodec)
- Mappings:
Namespace Name Mixin selector official bLwk;b(Lwo;Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/Codec;intermediary method_31194Lnet/minecraft/class_5381;method_31194(Lnet/minecraft/class_5321;Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/Codec;named method_31194Lnet/minecraft/util/dynamic/RegistryElementCodec;method_31194(Lnet/minecraft/util/registry/RegistryKey;Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/Codec;
-
of
private static <E> RegistryElementCodec<E> of(RegistryKey<? extends Registry<E>> registryRef, com.mojang.serialization.Codec<E> elementCodec, boolean allowInlineDefinitions)
- Mappings:
Namespace Name Mixin selector official aLwk;a(Lwo;Lcom/mojang/serialization/Codec;Z)Lwk;intermediary method_31192Lnet/minecraft/class_5381;method_31192(Lnet/minecraft/class_5321;Lcom/mojang/serialization/Codec;Z)Lnet/minecraft/class_5381;named ofLnet/minecraft/util/dynamic/RegistryElementCodec;of(Lnet/minecraft/util/registry/RegistryKey;Lcom/mojang/serialization/Codec;Z)Lnet/minecraft/util/dynamic/RegistryElementCodec;
-
encode
public <T> com.mojang.serialization.DataResult<T> encode(Supplier<E> supplier, com.mojang.serialization.DynamicOps<T> dynamicOps, T t)
- 指定者:
encode在接口中com.mojang.serialization.Encoder<E>- Mappings:
Namespace Name Mixin selector official aLwk;a(Ljava/util/function/Supplier;Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;intermediary method_29748Lnet/minecraft/class_5381;method_29748(Ljava/util/function/Supplier;Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;named encodeLnet/minecraft/util/dynamic/RegistryElementCodec;encode(Ljava/util/function/Supplier;Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
-
decode
public <T> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<Supplier<E>,T>> decode(com.mojang.serialization.DynamicOps<T> ops, T input)
- 指定者:
decode在接口中com.mojang.serialization.Decoder<E>- Mappings:
Namespace Name Mixin selector official decodeLwk;decode(Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;intermediary decodeLnet/minecraft/class_5381;decode(Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;named decodeLnet/minecraft/util/dynamic/RegistryElementCodec;decode(Lcom/mojang/serialization/DynamicOps;Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
-
toString
public String toString()
-
-