public interface ResourceManagerHelper
ResourceManager
instances, and other resource loader generalities.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,
net.fabricmc.loader.api.ModContainer container,
ResourcePackActivationType activationType)
Registers a built-in resource pack.
|
static boolean |
registerBuiltinResourcePack(net.minecraft.util.Identifier id,
String subPath,
net.fabricmc.loader.api.ModContainer container,
boolean enabledByDefault)
Deprecated.
Please use
registerBuiltinResourcePack(Identifier, ModContainer, ResourcePackActivationType) instead, the sub path should be removed in a future
release in favor of the identifier path. |
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, net.fabricmc.loader.api.ModContainer container, ResourcePackActivationType activationType)
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 path in which the resource pack is located is in the mod JAR file under the "resourcepacks/<id path>"
directory. id path
being the path specified
in the identifier of this built-in resource pack.
id
- the identifier of the resource packcontainer
- the mod containeractivationType
- the activation type of the resource packtrue
if successfully registered the resource pack, else false
@Deprecated static boolean registerBuiltinResourcePack(net.minecraft.util.Identifier id, String subPath, net.fabricmc.loader.api.ModContainer container, boolean enabledByDefault)
registerBuiltinResourcePack(Identifier, ModContainer, ResourcePackActivationType)
instead, the sub path
should be removed in a future
release in favor of the identifier path.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 packsubPath
- the sub path in the mod resourcescontainer
- the mod containerenabledByDefault
- true
if enabled by default, else false
true
if successfully registered the resource pack, else false