Class DynamicRegistryAccess.GenericBootstrapContext<T>

java.lang.Object
com.thecsdev.commonmc.world.sandbox.DynamicRegistryAccess.GenericBootstrapContext<T>
All Implemented Interfaces:
net.minecraft.data.worldgen.BootstrapContext<T>
Enclosing class:
DynamicRegistryAccess

@Internal public static final class DynamicRegistryAccess.GenericBootstrapContext<T> extends Object implements net.minecraft.data.worldgen.BootstrapContext<T>
Generic BootstrapContext implementation that works with any MappedRegistry.
  • Constructor Summary

    Constructors
    Constructor
    Description
    GenericBootstrapContext(@NotNull net.minecraft.core.WritableRegistry<T> registry)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    <S> @NotNull net.minecraft.core.HolderGetter<S>
    lookup(@NonNull net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<? extends S>> resourceKey)
     
    net.minecraft.core.Holder.Reference<T>
    register(@NonNull net.minecraft.resources.ResourceKey<T> key, T value, @NonNull com.mojang.serialization.Lifecycle lifecycle)
     

    Methods inherited from class Object

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

    Methods inherited from interface net.minecraft.data.worldgen.BootstrapContext

    register
  • Constructor Details

    • GenericBootstrapContext

      public GenericBootstrapContext(@NotNull @NotNull net.minecraft.core.WritableRegistry<T> registry)
  • Method Details

    • lookup

      @NotNull public <S> @NotNull net.minecraft.core.HolderGetter<S> lookup(@NonNull net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<? extends S>> resourceKey)
      Specified by:
      lookup in interface net.minecraft.data.worldgen.BootstrapContext<T>
    • register

      @NotNull public net.minecraft.core.Holder.Reference<T> register(@NonNull net.minecraft.resources.ResourceKey<T> key, T value, @NonNull com.mojang.serialization.Lifecycle lifecycle)
      Specified by:
      register in interface net.minecraft.data.worldgen.BootstrapContext<T>