Class SpellDataProvider

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

public abstract class SpellDataProvider extends Object implements net.minecraft.data.DataProvider
Base class for data providers that generate spell properties files. Extend this class and implement buildSpells(Consumer) to add spells to the data pack, finally, load it in your mod's data entrypoint.

Note that this class does not automatically include all spells registered in the spell registry; you must add them yourself in your implementation of buildSpells. This is to allow developers to use this class to generate data for their own spells without having to re-implement the entire spell registry.

  • 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
    Modifier and Type
    Field
    Description
    protected final String
     
    protected final net.minecraft.data.PackOutput.PathProvider
     

    Fields inherited from interface net.minecraft.data.DataProvider

    FIXED_ORDER_FIELDS, KEY_COMPARATOR, LOGGER
  • Constructor Summary

    Constructors
    Constructor
    Description
    SpellDataProvider(net.minecraft.data.PackOutput output, String namespace)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract void
    buildSpells(@NotNull Consumer<Spell> consumer)
     
    @NotNull String
     
    @NotNull CompletableFuture<?>
    run(@NotNull net.minecraft.data.CachedOutput output)
     

    Methods inherited from class java.lang.Object

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

    • pathProvider

      protected final net.minecraft.data.PackOutput.PathProvider pathProvider
    • namespace

      protected final String namespace
  • Constructor Details

    • SpellDataProvider

      public SpellDataProvider(net.minecraft.data.PackOutput output, String namespace)
  • Method Details

    • run

      @NotNull public @NotNull CompletableFuture<?> run(@NotNull @NotNull net.minecraft.data.CachedOutput output)
      Specified by:
      run in interface net.minecraft.data.DataProvider
    • getName

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

      protected abstract void buildSpells(@NotNull @NotNull Consumer<Spell> consumer)