Class ToolTierProvider

java.lang.Object
at.minecraftschurli.mods.arsmagicalegacy.api.spell.ToolTierProvider
All Implemented Interfaces:
net.minecraft.data.DataProvider

public abstract class ToolTierProvider extends Object implements net.minecraft.data.DataProvider
Data provider for tool tiers. In Ars Magica: Legacy, all a tool tier entails is an int -> incorrect block tag mapping. Override generate() to generate your entries, and use add(int, TagKey) or add(int, Identifier) to add a new tool tier.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface net.minecraft.data.DataProvider

    net.minecraft.data.DataProvider.Factory<T>
  • Field Summary

    Fields inherited from interface net.minecraft.data.DataProvider

    FIXED_ORDER_FIELDS, INDENT_WIDTH, KEY_COMPARATOR, LOGGER
  • Constructor Summary

    Constructors
    Constructor
    Description
    ToolTierProvider(net.minecraft.data.PackOutput output, CompletableFuture<net.minecraft.core.HolderLookup.Provider> lookupProvider, String modId)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(int toolTier, net.minecraft.resources.Identifier incorrectBlocksTag)
    Adds a tool tier.
    void
    add(int toolTier, net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block> incorrectBlocksTag)
    Adds a tool tier.
    abstract void
    Override this to generate your objects.
     
    run(net.minecraft.data.CachedOutput output)
     

    Methods inherited from class Object

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

    • ToolTierProvider

      public ToolTierProvider(net.minecraft.data.PackOutput output, CompletableFuture<net.minecraft.core.HolderLookup.Provider> lookupProvider, String modId)
      Parameters:
      output - The PackOutput to use. Get this from GatherDataEvent.
      lookupProvider - The lookup CompletableFuture to use. Get this from GatherDataEvent.
      modId - Your mod id.
  • Method Details

    • run

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

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

      public void add(int toolTier, net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block> incorrectBlocksTag)
      Adds a tool tier.
      Parameters:
      toolTier - The tool tier to add.
      incorrectBlocksTag - A TagKey of incorrect Blocks for this tool tier.
    • add

      public void add(int toolTier, net.minecraft.resources.Identifier incorrectBlocksTag)
      Adds a tool tier.
      Parameters:
      toolTier - The tool tier to add.
      incorrectBlocksTag - The id of a TagKey of incorrect Blocks for this tool tier.
    • generate

      public abstract void generate()
      Override this to generate your objects.