Skip to content

Dynamic resource generation library for Fabric

License

Notifications You must be signed in to change notification settings

null2264/Respro

Repository files navigation


Resource Provider

Resource Provider (Respro) is a fabric dynamic resource generation library for Minecraft.
Highly inspired by Artifice by @natanfudge and ARRP by @Devan-Kerman

Usage

Setup

Warning

This fork only maintain v0.3 or newer for 1.19.3, support for older version of Minecraft is currently not planned

Mod is published on maven repository. You can fetch it and include it in your mod in following way:

repositories {
    // Using Jitpack
    maven {
        url = "https://jitpack.io"
    }
}

dependencies {
    // Using Jitpack
    include "com.github.null2264:Respro:${version}"

    // Example include of version 0.3.1
    // Using Jitpack
    include "com.github.null2264:Respro:0.3.1"
}

Basic Example

class ResproRegistrar
{
    // Call this somewhere, maybe your ModInitializer subclass (your mod's main entrypoint)
    public static void register() {
        ResproRegistry.registerData(data -> {
            data.setDumpMode(FabricLoader.getInstance().isDevelopmentEnvironment());
            data.setPackId(new Identifier("yourmod", "datapack"));
            data.setPackProfile(profile -> {
                profile.setAlwaysEnabled(true);
                profile.setPackName(name -> name.setText("Your Mod Datapack's Name"));
                profile.setPackIcon(icon -> icon.setFromResources(Mod.class, "assets/yourmod/icon.png"));
                profile.setPackMeta(meta -> {
                    meta.setDescription("Your Mod Datapack's Name");
                    meta.setFormat(ResourceType.CLIENT_RESOURCES.getPackVersion(SharedConstants.getGameVersion()));
                });
            });
            data.setWorldPreset(...);
        });
    }
}

For a real use-case example, you can check out the source code of my SkyblockCreator mod.

License

This library is licensed under the MIT License