Class SpellDocsProvider

java.lang.Object
com.binaris.wizardry.datagen.provider.SpellDocsProvider
All Implemented Interfaces:
net.minecraft.data.DataProvider
Direct Known Subclasses:
EBSpellDocsProvider

public abstract class SpellDocsProvider extends Object implements net.minecraft.data.DataProvider
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

    Constructors
    Modifier
    Constructor
    Description
    protected
    SpellDocsProvider(net.minecraft.data.PackOutput output, String modId, String iconBasePath)
    Creates a new spell documentation provider.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract void
    buildSpells(@NotNull Consumer<Spell> consumer)
    Implement this method to register spells for documentation generation.
    @NotNull String
     
    protected Path
    Gets the output path for a spell's documentation file.
    protected String
    Gets the relative link path for a spell's documentation.
    @NotNull CompletableFuture<?>
    run(@NotNull net.minecraft.data.CachedOutput cachedOutput)
     
    protected String
    Translates a key to its localized value.

    Methods inherited from class java.lang.Object

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

    • SpellDocsProvider

      protected SpellDocsProvider(net.minecraft.data.PackOutput output, String modId, String iconBasePath)
      Creates a new spell documentation provider.
      Parameters:
      output - The pack output
      modId - The mod ID
      iconBasePath - The base path for spell icons in the documentation
  • Method Details

    • buildSpells

      protected abstract void buildSpells(@NotNull @NotNull Consumer<Spell> consumer)
      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:
      run in interface net.minecraft.data.DataProvider
    • translate

      protected String translate(String key)
      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

      protected Path getSpellDocPath(Spell spell)
      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

      protected String getSpellLinkPath(Spell spell)
      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

      @NotNull public @NotNull String getName()
      Specified by:
      getName in interface net.minecraft.data.DataProvider