Package net.fabricmc.fabric.api.resource
Quick note about vocabulary in Resource Loader and Minecraft:
- Resource Pack refers to both client-sided resource pack and data pack.
- Virtual Resource Pack refers to a resource pack that may be generated at runtime, or simply doesn't exist directly on disk.
- Group Resource Pack refers to a virtual resource pack that groups multiple resource packs together.
Modded Resource Pack Handling
The Resource Loader will create a resource pack for each mod that provides resources in assets
or data
sub-directories.
Those mod resource packs are grouped into a single always-enabled group resource pack which is shown in the resource pack screen.
Built-in Mod Resource Pack
The Resource Loader adds manually registered mod resource packs. Those resource packs are registered with
ResourceManagerHelper.registerBuiltinResourcePack(net.minecraft.util.Identifier, net.fabricmc.loader.api.ModContainer, net.fabricmc.fabric.api.resource.ResourcePackActivationType)
Programmer Art Resource Pack
The Resource Loader will inject resources into the Programmer Art resource pack for each mod that provides
Programmer Art resources in the programmer_art
top-level directory of the mod
whose structure is similar to a normal resource pack.
Resource Reload Listener
The Resource Loader allows mods to register resource reload listeners through
ResourceManagerHelper.registerReloadListener(net.fabricmc.fabric.api.resource.IdentifiableResourceReloadListener)
,
which are triggered when resources are reloaded.
A resource reload listener can depend on another and vanilla resource reload listener identifiers may be found in ResourceReloadListenerKeys
.
-
Interface Summary Interface Description IdentifiableResourceReloadListener Interface for "identifiable" resource reload listeners.ModResourcePack Interface implemented by mod-provided resource packs.ResourceManagerHelper Helper for working withResourceManager
instances, and other resource loader generalities.SimpleResourceReloadListener<T> A simplified version of the "resource reload listener" interface, hiding the peculiarities of the API.SimpleSynchronousResourceReloadListener A simplified version of the "resource reload listener" interface, hiding the peculiarities of the API and ensuring all data is loaded on the main thread. -
Class Summary Class Description ResourceReloadListenerKeys This class contains default keys for various Minecraft resource reload listeners. -
Enum Summary Enum Description ResourcePackActivationType Represents the resource pack activation type.