Class MutableDynamicRegistryManager
java.lang.Object
io.github.thecsdev.tcdcommons.client.world.registry.MutableDynamicRegistryManager
- All Implemented Interfaces:
net.minecraft.registry.DynamicRegistryManager
,net.minecraft.registry.RegistryWrapper.WrapperLookup
- Direct Known Subclasses:
ClientSandboxWorldDRM
@Beta
public class MutableDynamicRegistryManager
extends Object
implements net.minecraft.registry.DynamicRegistryManager
A
DynamicRegistryManager
that creates Registry
s
on demand when calling getOptional(RegistryKey)
instead
of returning Optional.empty()
.-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.registry.DynamicRegistryManager
net.minecraft.registry.DynamicRegistryManager.Entry<T extends Object>, net.minecraft.registry.DynamicRegistryManager.Immutable, net.minecraft.registry.DynamicRegistryManager.ImmutableImpl
-
Field Summary
Modifier and TypeFieldDescriptionprotected final Map<? extends net.minecraft.registry.RegistryKey<? extends net.minecraft.registry.Registry<?>>,
? extends net.minecraft.registry.Registry<?>> protected final Method
Fields inherited from interface net.minecraft.registry.DynamicRegistryManager
EMPTY, LOGGER
-
Constructor Summary
ConstructorDescriptionMutableDynamicRegistryManager
(List<? extends net.minecraft.registry.Registry<?>> registries) -
Method Summary
Modifier and TypeMethodDescriptionstatic <T,
R extends net.minecraft.registry.Registry<? extends T>>
net.minecraft.registry.DynamicRegistryManager.Entry<T>createEntry
(Map.Entry<? extends net.minecraft.registry.RegistryKey<? extends net.minecraft.registry.Registry<?>>, R> entry) Creates aDynamicRegistryManager.Entry
based on the given parameters.
Primarily used instreamAllRegistries()
.static <T> net.minecraft.registry.DynamicRegistryManager.Entry<T>
createEntry
(net.minecraft.registry.RegistryKey<? extends net.minecraft.registry.Registry<?>> key, net.minecraft.registry.Registry<?> value) Creates aDynamicRegistryManager.Entry
based on the given parameters.final <E> Optional<net.minecraft.registry.Registry<E>>
getOptional
(net.minecraft.registry.RegistryKey<? extends net.minecraft.registry.Registry<? extends E>> key) final Map<? extends net.minecraft.registry.RegistryKey<? extends net.minecraft.registry.Registry<?>>,
? extends net.minecraft.registry.Registry<?>> final Stream<net.minecraft.registry.DynamicRegistryManager.Entry<?>>
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.registry.DynamicRegistryManager
get, getOptionalWrapper, getRegistryLifecycle, streamAllRegistryKeys, toImmutable
Methods inherited from interface net.minecraft.registry.RegistryWrapper.WrapperLookup
createRegistryLookup, getOps, getWrapperOrThrow
-
Field Details
-
registriesPutMethod
-
registries
protected final Map<? extends net.minecraft.registry.RegistryKey<? extends net.minecraft.registry.Registry<?>>,? extends net.minecraft.registry.Registry<?>> registries
-
-
Constructor Details
-
MutableDynamicRegistryManager
public MutableDynamicRegistryManager() -
MutableDynamicRegistryManager
-
-
Method Details
-
getRegistries
public final Map<? extends net.minecraft.registry.RegistryKey<? extends net.minecraft.registry.Registry<?>>,? extends net.minecraft.registry.Registry<?>> getRegistries() -
getOptional
public final <E> Optional<net.minecraft.registry.Registry<E>> getOptional(net.minecraft.registry.RegistryKey<? extends net.minecraft.registry.Registry<? extends E>> key) - Specified by:
getOptional
in interfacenet.minecraft.registry.DynamicRegistryManager
-
streamAllRegistries
- Specified by:
streamAllRegistries
in interfacenet.minecraft.registry.DynamicRegistryManager
-
createEntry
public static <T,R extends net.minecraft.registry.Registry<? extends T>> net.minecraft.registry.DynamicRegistryManager.Entry<T> createEntry(Map.Entry<? extends net.minecraft.registry.RegistryKey<? extends net.minecraft.registry.Registry<?>>, R> entry) Creates aDynamicRegistryManager.Entry
based on the given parameters.
Primarily used instreamAllRegistries()
. -
createEntry
public static <T> net.minecraft.registry.DynamicRegistryManager.Entry<T> createEntry(net.minecraft.registry.RegistryKey<? extends net.minecraft.registry.Registry<?>> key, net.minecraft.registry.Registry<?> value) Creates aDynamicRegistryManager.Entry
based on the given parameters.
-