Class DatapackRegistryProvider.RegistryBuilder<T>

java.lang.Object
com.github.minecraftschurlimods.arsmagicalegacy.api.data.DatapackRegistryProvider.RegistryBuilder<T>
Enclosing class:
DatapackRegistryProvider

public abstract static class DatapackRegistryProvider.RegistryBuilder<T> extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    RegistryBuilder(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> registryKey, String modId)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract void
     
    protected final <S> @NotNull net.minecraft.core.HolderGetter<S>
    getLookup(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<S>> registryKey)
    Get the HolderGetter for the registry of the given ResourceKey.
    protected final <S> net.minecraft.core.Holder.Reference<S>
    holder(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<S>> registryKey, String name)
     
    protected final <S> net.minecraft.core.Holder.Reference<S>
    holder(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<S>> registryKey, net.minecraft.resources.ResourceLocation key)
     
    protected final <S> net.minecraft.core.Holder.Reference<S>
    holder(net.minecraft.resources.ResourceKey<S> key)
    Get the Holder for the given ResourceKey.
    protected final <S> Optional<net.minecraft.core.Holder.Reference<S>>
    optionalHolder(net.minecraft.resources.ResourceKey<S> key)
    Get the Holder for the given ResourceKey or Optional.empty().
    protected final <S> Optional<net.minecraft.core.HolderSet.Named<S>>
    optionalTag(net.minecraft.tags.TagKey<S> tagKey)
    Get the HolderSet for the given TagKey or Optional.empty().
    protected final net.minecraft.core.Holder.Reference<T>
    Get the Holder for the given name from this builders current registry and modId.
    protected final net.minecraft.core.Holder.Reference<T>
    ownHolder(net.minecraft.resources.ResourceLocation id)
    Get the Holder for the given ResourceLocation from this builders current registry.
    protected final void
    register(String name, T value)
    Registers a value to the datapack registry.
    protected final void
    register(net.minecraft.resources.ResourceKey<T> id, T value)
    Registers a value to the datapack registry.
    protected final void
    register(net.minecraft.resources.ResourceLocation id, T value)
    Registers a value to the datapack registry.
    protected final <S> net.minecraft.core.HolderSet.Named<S>
    tag(net.minecraft.tags.TagKey<S> tagKey)
    Get the HolderSet for the given TagKey.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RegistryBuilder

      public RegistryBuilder(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> registryKey, String modId)
  • Method Details

    • gather

      protected abstract void gather()
    • tag

      protected final <S> net.minecraft.core.HolderSet.Named<S> tag(net.minecraft.tags.TagKey<S> tagKey)
      Get the HolderSet for the given TagKey.
      Type Parameters:
      S - The type of the HolderSet.
      Parameters:
      tagKey - The TagKey to get the HolderSet for.
      Returns:
      The HolderSet for the given TagKey.
    • optionalTag

      protected final <S> Optional<net.minecraft.core.HolderSet.Named<S>> optionalTag(net.minecraft.tags.TagKey<S> tagKey)
      Get the HolderSet for the given TagKey or Optional.empty().
      Type Parameters:
      S - The type of the HolderSet.
      Parameters:
      tagKey - The TagKey to get the HolderSet for.
      Returns:
      The HolderSet for the given TagKey.
    • holder

      protected final <S> net.minecraft.core.Holder.Reference<S> holder(net.minecraft.resources.ResourceKey<S> key)
      Get the Holder for the given ResourceKey.
      Type Parameters:
      S - The type of the Holder.
      Parameters:
      key - The ResourceKey to get the Holder for.
      Returns:
      The Holder for the given ResourceKey.
    • holder

      protected final <S> net.minecraft.core.Holder.Reference<S> holder(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<S>> registryKey, net.minecraft.resources.ResourceLocation key)
    • holder

      protected final <S> net.minecraft.core.Holder.Reference<S> holder(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<S>> registryKey, String name)
    • optionalHolder

      protected final <S> Optional<net.minecraft.core.Holder.Reference<S>> optionalHolder(net.minecraft.resources.ResourceKey<S> key)
      Get the Holder for the given ResourceKey or Optional.empty().
      Type Parameters:
      S - The type of the Holder.
      Parameters:
      key - The ResourceKey to get the Holder for.
      Returns:
      The Holder for the given ResourceKey.
    • ownHolder

      protected final net.minecraft.core.Holder.Reference<T> ownHolder(net.minecraft.resources.ResourceLocation id)
      Get the Holder for the given ResourceLocation from this builders current registry.
      Parameters:
      id - The ResourceLocation to get the Holder for.
      Returns:
      The Holder for the given ResourceLocation.
    • ownHolder

      protected final net.minecraft.core.Holder.Reference<T> ownHolder(String name)
      Get the Holder for the given name from this builders current registry and modId.
      Parameters:
      name - The name to get the Holder for.
      Returns:
      The Holder for the given ResourceLocation.
    • getLookup

      @NotNull protected final <S> @NotNull net.minecraft.core.HolderGetter<S> getLookup(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<S>> registryKey)
      Get the HolderGetter for the registry of the given ResourceKey.
      Type Parameters:
      S - The type of the registry.
      Parameters:
      registryKey - The ResourceKey of the registry to get the HolderGetter for.
      Returns:
      The HolderGetter for the registry of the given ResourceKey.
    • register

      protected final void register(String name, T value)
      Registers a value to the datapack registry.
      Parameters:
      name - The name of the value.
      value - The value.
    • register

      protected final void register(net.minecraft.resources.ResourceLocation id, T value)
      Registers a value to the datapack registry.
      Parameters:
      id - The id of the value.
      value - The value.
    • register

      protected final void register(net.minecraft.resources.ResourceKey<T> id, T value)
      Registers a value to the datapack registry.
      Parameters:
      id - The id of the value.
      value - The value.