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 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
-
useNamespace
private boolean useNamespace
-
-
Constructor Details
-
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 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
-
requireUnmodifiableEntries
-