Class DynamicRegistryAccess

java.lang.Object
com.thecsdev.commonmc.world.sandbox.DynamicRegistryAccess
All Implemented Interfaces:
net.minecraft.core.HolderGetter.Provider, net.minecraft.core.HolderLookup.Provider, net.minecraft.core.RegistryAccess

@Internal public final class DynamicRegistryAccess extends Object implements net.minecraft.core.RegistryAccess
RegistryAccess implementation that dynamically resolves lookup(ResourceKey) and registries().
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    Generic BootstrapContext implementation that works with any MappedRegistry.

    Nested classes/interfaces inherited from interface net.minecraft.core.RegistryAccess

    net.minecraft.core.RegistryAccess.Frozen, net.minecraft.core.RegistryAccess.ImmutableRegistryAccess, net.minecraft.core.RegistryAccess.RegistryEntry<T>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    Static DynamicRegistryAccess instance that was bootstrapped using bootstrapLevel().

    Fields inherited from interface net.minecraft.core.RegistryAccess

    EMPTY, LOGGER
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Bootstraps registries necessary for a vanilla Level instance.
    final <E> @NotNull Optional<net.minecraft.core.Registry<E>>
    lookup(@NonNull net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<? extends E>> resourceKey)
     
    final <E> @NotNull Optional<net.minecraft.core.WritableRegistry<E>>
    lookupM(@NotNull net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<? extends E>> resourceKey)
     
    final @NotNull Stream<net.minecraft.core.RegistryAccess.RegistryEntry<?>>
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.minecraft.core.HolderGetter.Provider

    get, get, getOrThrow, getOrThrow

    Methods inherited from interface net.minecraft.core.HolderLookup.Provider

    allRegistriesLifecycle, createSerializationContext, listRegistries

    Methods inherited from interface net.minecraft.core.RegistryAccess

    freeze, listRegistryKeys, lookupOrThrow
  • Field Details

  • Constructor Details

    • DynamicRegistryAccess

      public DynamicRegistryAccess()
  • Method Details

    • lookupM

      @NotNull public final <E> @NotNull Optional<net.minecraft.core.WritableRegistry<E>> lookupM(@NotNull @NotNull net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<? extends E>> resourceKey)
    • lookup

      @NotNull public final <E> @NotNull Optional<net.minecraft.core.Registry<E>> lookup(@NonNull net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<? extends E>> resourceKey)
      Specified by:
      lookup in interface net.minecraft.core.HolderGetter.Provider
      Specified by:
      lookup in interface net.minecraft.core.HolderLookup.Provider
      Specified by:
      lookup in interface net.minecraft.core.RegistryAccess
    • registries

      @NotNull public final @NotNull Stream<net.minecraft.core.RegistryAccess.RegistryEntry<?>> registries()
      Specified by:
      registries in interface net.minecraft.core.RegistryAccess
    • bootstrapLevel

      public DynamicRegistryAccess bootstrapLevel()
      Bootstraps registries necessary for a vanilla Level instance.