Class SpellDocsProvider
java.lang.Object
com.binaris.wizardry.datagen.provider.SpellDocsProvider
- All Implemented Interfaces:
net.minecraft.data.DataProvider
- Direct Known Subclasses:
EBSpellDocsProvider
Base data provider for generating spell documentation in Markdown format.
This provider creates documentation files suitable for VitePress or other markdown-based documentation systems.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.data.DataProvider
net.minecraft.data.DataProvider.Factory<T extends net.minecraft.data.DataProvider> -
Field Summary
Fields inherited from interface net.minecraft.data.DataProvider
FIXED_ORDER_FIELDS, KEY_COMPARATOR -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSpellDocsProvider(net.minecraft.data.PackOutput output, String modId, String iconBasePath) Creates a new spell documentation provider. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidbuildSpells(@NotNull Consumer<Spell> consumer) Implement this method to register spells for documentation generation.@NotNull StringgetName()protected PathgetSpellDocPath(Spell spell) Gets the output path for a spell's documentation file.protected StringgetSpellLinkPath(Spell spell) Gets the relative link path for a spell's documentation.@NotNull CompletableFuture<?>run(@NotNull net.minecraft.data.CachedOutput cachedOutput) protected StringTranslates a key to its localized value.
-
Constructor Details
-
Method Details
-
buildSpells
Implement this method to register spells for documentation generation.- Parameters:
consumer- The consumer to accept spells
-
run
@NotNull public @NotNull CompletableFuture<?> run(@NotNull @NotNull net.minecraft.data.CachedOutput cachedOutput) - Specified by:
runin interfacenet.minecraft.data.DataProvider
-
translate
Translates a key to its localized value. If the key is not found, returns the key itself.- Parameters:
key- The translation key- Returns:
- The translated string, or the key if not found
-
getSpellDocPath
Gets the output path for a spell's documentation file. The path is structured as "docs/spells/{namespace}/{path}.md" to organize spells by their namespace and path.- Parameters:
spell- The spell to get the documentation path for- Returns:
- The Path where the spell's documentation file should be saved
-
getSpellLinkPath
Gets the relative link path for a spell's documentation. This is used in markdown links. Override this method in subclasses to customize the spell link structure for addons. By default, returns "spell/{spell_name}" (e.g., "spell/meteor").- Parameters:
spell- The spell to get the link path for- Returns:
- The relative link path to the spell's documentation (without .md extension)
-
getName
- Specified by:
getNamein interfacenet.minecraft.data.DataProvider
-