Interface ResourceLoader
- All Known Subinterfaces:
DataResourceLoader
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.minecraft.server.packs.resources.PreparableReloadListener.StateKey<net.minecraft.world.flag.FeatureFlagSet> The resource reloader store key for the currently enabled feature set.static final net.minecraft.server.packs.resources.PreparableReloadListener.StateKey<net.minecraft.core.HolderLookup.Provider> The resource reloader store key for the registry lookup. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddReloaderOrdering(net.minecraft.resources.Identifier firstReloader, net.minecraft.resources.Identifier secondReloader) Requests that resource reloaders registered as the first identifier is applied before the other referenced resource reloader.static ResourceLoaderget(net.minecraft.server.packs.PackType type) static booleanregisterBuiltinPack(net.minecraft.resources.Identifier id, net.fabricmc.loader.api.ModContainer container, PackActivationType activationType) Registers a built-in resource pack.static booleanregisterBuiltinPack(net.minecraft.resources.Identifier id, net.fabricmc.loader.api.ModContainer container, net.minecraft.network.chat.Component displayName, PackActivationType activationType) Registers a built-in resource pack.voidregisterReloader(net.minecraft.resources.Identifier id, net.minecraft.server.packs.resources.PreparableReloadListener reloader) Registers a resource reloader for a given resource manager type.
-
Field Details
-
RELOADER_REGISTRY_LOOKUP_KEY
static final net.minecraft.server.packs.resources.PreparableReloadListener.StateKey<net.minecraft.core.HolderLookup.Provider> RELOADER_REGISTRY_LOOKUP_KEYThe resource reloader store key for the registry lookup.- API Note:
- The registry lookup is only available in server data resource reloaders.
-
RELOADER_FEATURE_SET_KEY
static final net.minecraft.server.packs.resources.PreparableReloadListener.StateKey<net.minecraft.world.flag.FeatureFlagSet> RELOADER_FEATURE_SET_KEYThe resource reloader store key for the currently enabled feature set.- API Note:
- The feature set is only available in server data resource reloaders.
-
-
Method Details
-
get
-
registerReloader
void registerReloader(net.minecraft.resources.Identifier id, net.minecraft.server.packs.resources.PreparableReloadListener reloader) Registers a resource reloader for a given resource manager type.- Parameters:
id- the identifier of the resource reloaderreloader- the resource reloader- See Also:
-
addReloaderOrdering
void addReloaderOrdering(net.minecraft.resources.Identifier firstReloader, net.minecraft.resources.Identifier secondReloader) Requests that resource reloaders registered as the first identifier is applied before the other referenced resource reloader.Incompatible ordering constraints such as cycles will lead to inconsistent behavior: some constraints will be respected and some will be ignored. If this happens, a warning will be logged.
Please keep in mind that this only takes effect during the application stage!
- Parameters:
firstReloader- the identifier of the resource reloader that should run before the othersecondReloader- the identifier of the resource reloader that should run after the other- See Also:
-
registerBuiltinPack
static boolean registerBuiltinPack(net.minecraft.resources.Identifier id, net.fabricmc.loader.api.ModContainer container, PackActivationType activationType) Registers a built-in resource pack.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 pathbeing the path specified in the identifier of this built-in resource pack.- Parameters:
id- the identifier of the resource packcontainer- the mod containeractivationType- the activation type of the resource pack- Returns:
trueif successfully registered the resource pack, orfalseotherwise- See Also:
-
registerBuiltinPack
static boolean registerBuiltinPack(net.minecraft.resources.Identifier id, net.fabricmc.loader.api.ModContainer container, net.minecraft.network.chat.Component displayName, PackActivationType activationType) Registers a built-in resource pack.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 pathbeing the path specified in the identifier of this built-in resource pack.- Parameters:
id- the identifier of the resource packcontainer- the mod containerdisplayName- the display name of the resource pack, should include mod name for clarityactivationType- the activation type of the resource pack- Returns:
trueif successfully registered the resource pack, orfalseotherwise- See Also:
-