public class RegistryOps<T> extends ForwardingDynamicOps<T>
Modifier and Type | Class and Description |
---|---|
static interface |
RegistryOps.EntryLoader |
(package private) static class |
RegistryOps.ValueHolder<E> |
Modifier and Type | Field and Description |
---|---|
private RegistryOps.EntryLoader |
entryLoader |
private RegistryOps<JsonElement> |
entryOps |
private static Logger |
LOGGER |
private DynamicRegistryManager.Impl |
registryManager |
private Map<RegistryKey<? extends Registry<?>>,RegistryOps.ValueHolder<?>> |
valueHolders |
delegate
Modifier | Constructor and Description |
---|---|
private |
RegistryOps(com.mojang.serialization.DynamicOps<T> delegate,
RegistryOps.EntryLoader entryLoader,
DynamicRegistryManager.Impl impl,
IdentityHashMap<RegistryKey<? extends Registry<?>>,RegistryOps.ValueHolder<?>> identityHashMap) |
Modifier and Type | Method and Description |
---|---|
protected <E> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<Supplier<E>,T>> |
decodeOrId(T t,
RegistryKey<? extends Registry<E>> registryKey,
com.mojang.serialization.Codec<E> codec,
boolean allowInlineDefinitions)
Encode an id for a registry element than a full object if possible.
|
private <E> RegistryOps.ValueHolder<E> |
getValueHolder(RegistryKey<? extends Registry<E>> registryRef) |
<E> com.mojang.serialization.DataResult<SimpleRegistry<E>> |
loadToRegistry(SimpleRegistry<E> registry,
RegistryKey<? extends Registry<E>> registryKey,
com.mojang.serialization.Codec<E> codec)
Loads elements into a registry just loaded from a decoder.
|
protected <E> com.mojang.serialization.DataResult<Registry<E>> |
method_31152(RegistryKey<? extends Registry<E>> registryKey) |
static <T> RegistryOps<T> |
of(com.mojang.serialization.DynamicOps<T> dynamicOps,
RegistryOps.EntryLoader entryLoader,
DynamicRegistryManager.Impl impl) |
static <T> RegistryOps<T> |
of(com.mojang.serialization.DynamicOps<T> delegate,
ResourceManager resourceManager,
DynamicRegistryManager.Impl impl) |
private <E> com.mojang.serialization.DataResult<Supplier<E>> |
readSupplier(RegistryKey<? extends Registry<E>> registryKey,
MutableRegistry<E> mutableRegistry,
com.mojang.serialization.Codec<E> codec,
Identifier elementId)
Reads a supplier for a registry element.
|
compressMaps, convertTo, createBoolean, createByte, createByteList, createDouble, createFloat, createInt, createIntList, createList, createLong, createLongList, createMap, createNumeric, createShort, createString, empty, getBooleanValue, getByteBuffer, getIntStream, getList, getLongStream, getMap, getMapEntries, getMapValues, getNumberValue, getStream, getStringValue, listBuilder, mapBuilder, mergeToList, mergeToList, mergeToMap, mergeToMap, remove
private static final Logger LOGGER
private final RegistryOps.EntryLoader entryLoader
private final DynamicRegistryManager.Impl registryManager
private final Map<RegistryKey<? extends Registry<?>>,RegistryOps.ValueHolder<?>> valueHolders
private final RegistryOps<JsonElement> entryOps
private RegistryOps(com.mojang.serialization.DynamicOps<T> delegate, RegistryOps.EntryLoader entryLoader, DynamicRegistryManager.Impl impl, IdentityHashMap<RegistryKey<? extends Registry<?>>,RegistryOps.ValueHolder<?>> identityHashMap)
public static <T> RegistryOps<T> of(com.mojang.serialization.DynamicOps<T> delegate, ResourceManager resourceManager, DynamicRegistryManager.Impl impl)
public static <T> RegistryOps<T> of(com.mojang.serialization.DynamicOps<T> dynamicOps, RegistryOps.EntryLoader entryLoader, DynamicRegistryManager.Impl impl)
protected <E> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<Supplier<E>,T>> decodeOrId(T t, RegistryKey<? extends Registry<E>> registryKey, com.mojang.serialization.Codec<E> codec, boolean allowInlineDefinitions)
This method is called by casting an arbitrary dynamic ops to a registry reading ops.
RegistryReadingOps#encodeOrId(Object, Object, RegistryKey, MapCodec)
public <E> com.mojang.serialization.DataResult<SimpleRegistry<E>> loadToRegistry(SimpleRegistry<E> registry, RegistryKey<? extends Registry<E>> registryKey, com.mojang.serialization.Codec<E> codec)
private <E> com.mojang.serialization.DataResult<Supplier<E>> readSupplier(RegistryKey<? extends Registry<E>> registryKey, MutableRegistry<E> mutableRegistry, com.mojang.serialization.Codec<E> codec, Identifier elementId)
This logic is used by both decodeOrId
and loadToRegistry
.
private <E> RegistryOps.ValueHolder<E> getValueHolder(RegistryKey<? extends Registry<E>> registryRef)
protected <E> com.mojang.serialization.DataResult<Registry<E>> method_31152(RegistryKey<? extends Registry<E>> registryKey)