Package net.minecraft.core
Interface RegistryAccess
- All Known Subinterfaces:
RegistryAccess.Frozen
,RegistryAccess.Writable
- All Known Implementing Classes:
RegistryAccess.ImmutableRegistryAccess
,RegistryAccess.WritableRegistryAccess
public interface RegistryAccess
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
static final class
static final record
static final record
static interface
static final class
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Supplier<RegistryAccess.Frozen>
static final org.slf4j.Logger
static final com.mojang.serialization.Codec<RegistryAccess>
static final Map<ResourceKey<? extends Registry<?>>,
RegistryAccess.RegistryData<?>> -
Method Summary
Modifier and TypeMethodDescriptionprivate static <E> void
addBuiltinElements
(RegistryResourceAccess.InMemoryStorage p_211082_, RegistryAccess.RegistryData<E> p_211083_) default com.mojang.serialization.Lifecycle
private static RegistryAccess.Writable
static RegistryAccess.Writable
private static <K extends ResourceKey<? extends Registry<?>>,
V extends Registry<?>>
com.mojang.serialization.Codec<RegistryAccess>captureMap
(com.mojang.serialization.codecs.UnboundedMapCodec<K, V> p_206164_) private static Map<ResourceKey<? extends Registry<?>>,
? extends WritableRegistry<?>> static <E> WritableRegistry<?>
createRegistry
(ResourceKey<? extends Registry<?>> p_206201_) default RegistryAccess.Frozen
freeze()
static RegistryAccess.Frozen
fromRegistryOfRegistries
(Registry<? extends Registry<?>> p_206166_) private static <E> com.mojang.serialization.DataResult<? extends com.mojang.serialization.Codec<E>>
getNetworkCodec
(ResourceKey<? extends Registry<E>> p_206204_) private static Stream<RegistryAccess.RegistryEntry<Object>>
static Iterable<RegistryAccess.RegistryData<?>>
static void
load
(RegistryAccess.Writable p_206172_, com.mojang.serialization.DynamicOps<com.google.gson.JsonElement> p_206173_, RegistryLoader p_206174_) private static <E> com.mojang.serialization.Codec<RegistryAccess>
default Stream<RegistryAccess.RegistryEntry<?>>
private Stream<RegistryAccess.RegistryEntry<?>>
ownedRegistry
(ResourceKey<? extends Registry<? extends E>> p_175507_) default <E> Registry<E>
ownedRegistryOrThrow
(ResourceKey<? extends Registry<? extends E>> p_206192_) private static <E> void
put
(com.google.common.collect.ImmutableMap.Builder<ResourceKey<? extends Registry<?>>, RegistryAccess.RegistryData<?>> p_123054_, ResourceKey<? extends Registry<E>> p_123055_, com.mojang.serialization.Codec<E> p_123056_) private static <E> void
put
(com.google.common.collect.ImmutableMap.Builder<ResourceKey<? extends Registry<?>>, RegistryAccess.RegistryData<?>> p_123058_, ResourceKey<? extends Registry<E>> p_123059_, com.mojang.serialization.Codec<E> p_123060_, com.mojang.serialization.Codec<E> p_123061_) static RegistryAccess
readFromDisk
(com.mojang.serialization.Dynamic<?> p_206155_) private static <E> void
readRegistry
(com.mojang.serialization.DynamicOps<com.google.gson.JsonElement> p_206160_, RegistryLoader.Bound p_206161_, RegistryAccess.RegistryData<E> p_206162_) default Stream<RegistryAccess.RegistryEntry<?>>
registry
(ResourceKey<? extends Registry<? extends E>> p_123085_) default <E> Registry<E>
registryOrThrow
(ResourceKey<? extends Registry<? extends E>> p_175516_) static <E> Registry<E>
retrieveRegistry
(ResourceKey<? extends Registry<? extends E>> p_206185_, com.mojang.serialization.Dynamic<?> p_206186_)
-
Field Details
-
LOGGER
static final org.slf4j.Logger LOGGER -
REGISTRIES
-
NETWORK_CODEC
-
BUILTIN
-
-
Method Details
-
ownedRegistry
-
ownedRegistryOrThrow
default <E> Registry<E> ownedRegistryOrThrow(ResourceKey<? extends Registry<? extends E>> p_206192_) -
registry
default <E> Optional<? extends Registry<E>> registry(ResourceKey<? extends Registry<? extends E>> p_123085_) -
registryOrThrow
-
put
private static <E> void put(com.google.common.collect.ImmutableMap.Builder<ResourceKey<? extends Registry<?>>, RegistryAccess.RegistryData<?>> p_123054_, ResourceKey<? extends Registry<E>> p_123055_, com.mojang.serialization.Codec<E> p_123056_) -
put
private static <E> void put(com.google.common.collect.ImmutableMap.Builder<ResourceKey<? extends Registry<?>>, RegistryAccess.RegistryData<?>> p_123058_, ResourceKey<? extends Registry<E>> p_123059_, com.mojang.serialization.Codec<E> p_123060_, com.mojang.serialization.Codec<E> p_123061_) -
knownRegistries
-
ownedRegistries
Stream<RegistryAccess.RegistryEntry<?>> ownedRegistries() -
globalRegistries
-
registries
-
networkSafeRegistries
-
makeNetworkCodec
-
captureMap
private static <K extends ResourceKey<? extends Registry<?>>,V extends Registry<?>> com.mojang.serialization.Codec<RegistryAccess> captureMap(com.mojang.serialization.codecs.UnboundedMapCodec<K, V> p_206164_) -
ownedNetworkableRegistries
-
getNetworkCodec
private static <E> com.mojang.serialization.DataResult<? extends com.mojang.serialization.Codec<E>> getNetworkCodec(ResourceKey<? extends Registry<E>> p_206204_) -
createFreshRegistries
private static Map<ResourceKey<? extends Registry<?>>,? extends WritableRegistry<?>> createFreshRegistries() -
blankWriteable
-
fromRegistryOfRegistries
-
builtinCopy
-
addBuiltinElements
private static <E> void addBuiltinElements(RegistryResourceAccess.InMemoryStorage p_211082_, RegistryAccess.RegistryData<E> p_211083_) -
load
static void load(RegistryAccess.Writable p_206172_, com.mojang.serialization.DynamicOps<com.google.gson.JsonElement> p_206173_, RegistryLoader p_206174_) -
readRegistry
private static <E> void readRegistry(com.mojang.serialization.DynamicOps<com.google.gson.JsonElement> p_206160_, RegistryLoader.Bound p_206161_, RegistryAccess.RegistryData<E> p_206162_) -
readFromDisk
-
retrieveRegistry
static <E> Registry<E> retrieveRegistry(ResourceKey<? extends Registry<? extends E>> p_206185_, com.mojang.serialization.Dynamic<?> p_206186_) -
createRegistry
-
freeze
-
allElementsLifecycle
default com.mojang.serialization.Lifecycle allElementsLifecycle()
-