public interface ResourceManagerHelper
ResourceManager
instances.Modifier and Type | Method and Description |
---|---|
default void |
addReloadListener(IdentifiableResourceReloadListener listener)
Deprecated.
|
static ResourceManagerHelper |
get(net.minecraft.resource.ResourceType type)
Get the ResourceManagerHelper instance for a given resource type.
|
static boolean |
registerBuiltinResourcePack(net.minecraft.util.Identifier id,
String subPath,
net.fabricmc.loader.api.ModContainer container,
boolean enabledByDefault)
Registers a built-in resource pack.
|
void |
registerReloadListener(IdentifiableResourceReloadListener listener)
Register a resource reload listener for a given resource manager type.
|
@Deprecated default void addReloadListener(IdentifiableResourceReloadListener listener)
registerReloadListener(IdentifiableResourceReloadListener)
listener
- The resource reload listener.void registerReloadListener(IdentifiableResourceReloadListener listener)
listener
- The resource reload listener.static ResourceManagerHelper get(net.minecraft.resource.ResourceType type)
type
- The given resource type.static boolean registerBuiltinResourcePack(net.minecraft.util.Identifier id, String subPath, net.fabricmc.loader.api.ModContainer container, boolean enabledByDefault)
A built-in resource pack is an extra resource pack provided by your mod which is not always active, it's similar to the "Programmer Art" resource pack.
Why and when to use it? A built-in resource pack should be used to provide extra assets/data that should be optional with your mod but still directly provided by it. For example it could provide textures of your mod in another resolution, or could allow to provide different styles of your assets.
The subPath
corresponds to a path in the JAR file which points to the resource pack folder. For example the subPath can be "resourcepacks/extra"
.
Note about the enabled by default parameter: a resource pack cannot be enabled by default, only data packs can. Making this work for resource packs is near impossible without touching how Vanilla handles disabled resource packs.
id
- The identifier of the resource pack.subPath
- The sub path in the mod resources.container
- The mod container.enabledByDefault
- True if enabled by default, else false.