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
A dynamic registry entry.
Here,
Here,
C must equal T.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.mojang.serialization.Codec<C> private final RegistryKey<? extends Registry<T>> private final booleanprivate boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetPath()The expected path of data pack entries.booleanparse(RegistryOps<com.google.gson.JsonElement> ops, com.google.gson.JsonElement jsonElement, Identifier identifier) parse(RegistryOps<NbtElement> ops, NbtElement nbt, Identifier identifier) voidrequireUnmodifiableEntries(MutableRegistry<?> registry) voidshouldUseNamespace(boolean useNamespace) Whether the namespace should be used in the data pack entry path.
-
Field Details
-
entryClass
-
key
-
elementCodec
-
requiredNonEmpty
private final boolean requiredNonEmpty -
useNamespace
private boolean useNamespace
-
-
Constructor Details
-
Entry
-
Entry
-
-
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
The expected path of data pack entries.
When using anSevenElementsRegistryLoader.Entry, always prefer this method overRegistryKeys.getPath(RegistryKey).- Returns:
- The expected path of data pack entries.
-
asRegistryLoaderEntry
-
parse
public T parse(RegistryOps<com.google.gson.JsonElement> ops, com.google.gson.JsonElement jsonElement, Identifier identifier) -
parse
-
isUnmodifiable
-
requireUnmodifiableEntries
-