Class SevenElementsRegistryLoader.Entry<T,C>

java.lang.Object
io.github.xrickastley.sevenelements.registry.dynamic.SevenElementsRegistryLoader.Entry<T,C>
Direct Known Subclasses:
SevenElementsRegistryLoader.IdentifiedEntry
Enclosing class:
SevenElementsRegistryLoader

public static class SevenElementsRegistryLoader.Entry<T,C> extends Object
A dynamic registry entry.

Here, C must equal T.
  • Field Details

    • entryClass

      private final Class<T> entryClass
    • key

      private final RegistryKey<? extends Registry<T>> key
    • elementCodec

      private final com.mojang.serialization.Codec<C> elementCodec
    • useNamespace

      private boolean useNamespace
  • Constructor Details

  • Method Details

    • shouldUseNamespace

      public void shouldUseNamespace(boolean useNamespace)
      Whether the namespace should be used in the data pack entry path.

      This avoids conflict with other mods that may use the same folder path.
    • getPath

      public String getPath()
      The expected path of data pack entries.

      When using an SevenElementsRegistryLoader.Entry, always prefer this method over RegistryKeys#getPath(RegistryKey).
      Returns:
      The expected path of data pack entries.
    • asRegistryLoaderEntry

      public RegistryLoader.Entry<T> asRegistryLoaderEntry()
    • parse

      public Pair<T,com.mojang.serialization.DataResult<C>> parse(RegistryOps<com.google.gson.JsonElement> ops, com.google.gson.JsonElement jsonElement, Identifier identifier)
    • parse

      public Pair<T,com.mojang.serialization.DataResult<C>> parse(RegistryOps<NbtElement> ops, NbtElement nbt, Identifier identifier)
    • isUnmodifiable

      public boolean isUnmodifiable(Identifier id)
    • requireUnmodifiableEntries

      public void requireUnmodifiableEntries(MutableRegistry<?> registry)