Interface ResourceExporter


@NonExtendable public interface ResourceExporter
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Add a runnable to run when the export concludes to perform cleanup.
    void
    addExtraData(net.minecraft.resources.Identifier key, Object value)
    Adds arbitrary data to be added to the exported guides index JSON file.
    copyResource(net.minecraft.resources.Identifier id)
     
    exportTexture(net.minecraft.resources.Identifier texture)
    Exports a texture by id and returns the relative path to refer to it from other content that is being exported.
    @Nullable net.minecraft.resources.Identifier
     
     
    Generates an identifier for a page specific resource.
    net.minecraft.resources.Identifier
    Generates an identifier for a page specific resource.
    getPathForWriting(net.minecraft.resources.Identifier assetId)
     
    default String
     
    void
    referenceFluid(net.minecraft.world.level.material.Fluid fluid)
    Ensures the data needed to show tooltips or icons for this fluid is exported.
    void
    referenceIngredient(net.minecraft.world.item.crafting.Ingredient ingredient)
    Ensures the data needed to show tooltips or icons for the items in this ingredient is exported.
    void
    referenceItem(net.minecraft.world.item.ItemStack stack)
    Ensures the data needed to show tooltips or icons for this item is exported.
    default void
    referenceItem(net.minecraft.world.level.ItemLike item)
    Ensures the data needed to show tooltips or icons for this item is exported.
    void
    referenceRecipe(net.minecraft.world.item.crafting.RecipeHolder<?> recipe)
    Ensures that the data needed to show the given recipe, its ingredients and its output is exported.
    void
    referenceSlotDisplay(net.minecraft.world.item.crafting.display.SlotDisplay display)
    Ensures the data needed to show tooltips or icons for the items in this slot display is exported.
  • Method Details

    • referenceItem

      default void referenceItem(net.minecraft.world.level.ItemLike item)
      Ensures the data needed to show tooltips or icons for this item is exported.
    • referenceItem

      void referenceItem(net.minecraft.world.item.ItemStack stack)
      Ensures the data needed to show tooltips or icons for this item is exported.
    • referenceFluid

      void referenceFluid(net.minecraft.world.level.material.Fluid fluid)
      Ensures the data needed to show tooltips or icons for this fluid is exported.
    • referenceSlotDisplay

      void referenceSlotDisplay(net.minecraft.world.item.crafting.display.SlotDisplay display)
      Ensures the data needed to show tooltips or icons for the items in this slot display is exported.
    • referenceIngredient

      void referenceIngredient(net.minecraft.world.item.crafting.Ingredient ingredient)
      Ensures the data needed to show tooltips or icons for the items in this ingredient is exported.
    • exportTexture

      String exportTexture(net.minecraft.resources.Identifier texture)
      Exports a texture by id and returns the relative path to refer to it from other content that is being exported.
    • copyResource

      Path copyResource(net.minecraft.resources.Identifier id)
      Returns:
      The new resource id after applying cache busting.
    • getPathForWriting

      Path getPathForWriting(net.minecraft.resources.Identifier assetId)
    • getPageSpecificPathForWriting

      Path getPageSpecificPathForWriting(String suffix)
      Generates an identifier for a page specific resource.
    • getCurrentPageId

      @Nullable @Nullable net.minecraft.resources.Identifier getCurrentPageId()
    • getOutputFolder

      Path getOutputFolder()
    • getPathRelativeFromOutputFolder

      default String getPathRelativeFromOutputFolder(Path p)
    • getPageSpecificResourceLocation

      net.minecraft.resources.Identifier getPageSpecificResourceLocation(String suffix)
      Generates an identifier for a page specific resource.
    • referenceRecipe

      void referenceRecipe(net.minecraft.world.item.crafting.RecipeHolder<?> recipe)
      Ensures that the data needed to show the given recipe, its ingredients and its output is exported.
      See Also:
    • addExtraData

      void addExtraData(net.minecraft.resources.Identifier key, Object value)
      Adds arbitrary data to be added to the exported guides index JSON file.
      Parameters:
      key - The key under which the data will be retrievable.
      value - The value to be serialized to JSON using GSON.
    • addCleanupCallback

      void addCleanupCallback(Runnable runnable)
      Add a runnable to run when the export concludes to perform cleanup.