Interface ResourceExporter


@NonExtendable public interface ResourceExporter
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addExtraData(net.minecraft.resources.ResourceLocation key, Object value)
    Adds arbitrary data to be added to the exported guides index JSON file.
    copyResource(net.minecraft.resources.ResourceLocation id)
     
    exportTexture(net.minecraft.resources.ResourceLocation 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.ResourceLocation
     
     
    Generates a resource location for a page specific resource.
    net.minecraft.resources.ResourceLocation
    Generates a resource location for a page specific resource.
    getPathForWriting(net.minecraft.resources.ResourceLocation 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.ResourceLocation 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.ResourceLocation id)
      Returns:
      The new resource id after applying cache busting.
    • getPathForWriting

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

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

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

      Path getOutputFolder()
    • getPathRelativeFromOutputFolder

      default String getPathRelativeFromOutputFolder(Path p)
    • getPageSpecificResourceLocation

      net.minecraft.resources.ResourceLocation getPageSpecificResourceLocation(String suffix)
      Generates a resource location 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.ResourceLocation 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.