I have packed a data- and resourcepack used for a data driven mod as a fabric mod for easier distribution and install.
The textures of the main>resources>assets folder are included in the "Fabric Mods" Resourcepack as far as I can tell.
Now I wanted to provide players with optional resourcepacks that will overwrite the standard asset folder.
I checked how Continuity did it, by putting a folder in "resources" called "resourcepacks", but this doesnt seem to work in my mod once I built it...
Is there some specific code I need to make before, or am I doing something wrong?
#Adding an optional Built-In Resourcepack to a Fabric Mod
9 messages · Page 1 of 1 (latest)
did you see how continuity registered the packs?
I'm not sure how it works, I thought fabric would recognize the "resourcepacks" folder and add the resourcepack
How would I go about registering a pack?
import net.fabricmc.fabric.api.resource.ResourceManagerHelper;
Thank you, looks right
However, after I imported the resource manager helper, and registered a built in resource pack, FabricLoader cannot be resolved
Did I miss importing something?
package com.chromexunderscore.originstweaks;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.resource.ResourceManagerHelper;
import net.fabricmc.fabric.api.resource.ResourcePackActivationType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Main implements ModInitializer {
public static final String ID = "originstweaks";
public static final String NAME = "OriginsTweaks";
public static final Logger LOGGER = LoggerFactory.getLogger(NAME);
@Override
public void onInitialize() {
LOGGER.info("[OriginsTweaks] Remember to enable flying in the server.properties for some movement abilites!");
};
public void onInitializeClient() {
//this v
FabricLoader.getInstance().getModContainer(ID).ifPresent(container -> {
ResourceManagerHelper.registerBuiltinResourcePack(asId("elytra_wings"), container, ResourcePackActivationType.NORMAL);
});
}
}