Package guideme.siteexport
Interface ResourceExporter
@NonExtendable
public interface ResourceExporter
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddCleanupCallback(Runnable runnable) Add a runnable to run when the export concludes to perform cleanup.voidaddExtraData(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.ResourceLocationgetPageSpecificPathForWriting(String suffix) Generates a resource location for a page specific resource.net.minecraft.resources.ResourceLocationGenerates a resource location for a page specific resource.getPathForWriting(net.minecraft.resources.ResourceLocation assetId) default StringvoidreferenceFluid(net.minecraft.world.level.material.Fluid fluid) Ensures the data needed to show tooltips or icons for this fluid is exported.voidreferenceIngredient(net.minecraft.world.item.crafting.Ingredient ingredient) Ensures the data needed to show tooltips or icons for the items in this ingredient is exported.voidreferenceItem(net.minecraft.world.item.ItemStack stack) Ensures the data needed to show tooltips or icons for this item is exported.default voidreferenceItem(net.minecraft.world.level.ItemLike item) Ensures the data needed to show tooltips or icons for this item is exported.voidreferenceRecipe(net.minecraft.world.item.crafting.RecipeHolder<?> recipe) Ensures that the data needed to show the given recipe, its ingredients and its output is exported.voidreferenceSlotDisplay(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
Exports a texture by id and returns the relative path to refer to it from other content that is being exported. -
copyResource
- Returns:
- The new resource id after applying cache busting.
-
getPathForWriting
-
getPageSpecificPathForWriting
Generates a resource location for a page specific resource. -
getCurrentPageId
@Nullable @Nullable net.minecraft.resources.ResourceLocation getCurrentPageId() -
getOutputFolder
Path getOutputFolder() -
getPathRelativeFromOutputFolder
-
getPageSpecificResourceLocation
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
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
Add a runnable to run when the export concludes to perform cleanup.
-