跳到正文

QDResLoader

作者:exaptations

A dead-simple resource loader that reuses existing functionality.

收藏

介绍

中文介绍正在准备中,下面暂时显示原文。

So, you know how there’s this really nice, battle-tested, and fast resource loading system in QSL? It’s used for every mod. Wouldn’t it be great if we could just reuse that, instead of needing a bloated Architectury-requiring overengineered mess that breaks when you so much as breathe on it?

That’s what this is. 1.0 is 10 lines of Java code, including formatting:

new File("resources").mkdirs();
for (var t : ResourceType.values()) {
    ResourceLoader.get(t).getRegisterTopResourcePackEvent().register((ctx) -> {
        ctx.addResourcePack(new ModNioResourcePack(
            "QDResLoader resources", mod.metadata(), null, ResourcePackActivationType.ALWAYS_ENABLED,
            new File("resources").toPath(), t, null
        ));
    });
}

Since 1.0, some more features have been added to make it nicer to use and have some extra functionality, but it’s still tiny regardless; just not “put the whole mod in your description” levels of tiny.

Harness the power of QSL Resource Loader in the resources directory. You already know the format; data goes in data, assets go in assets. Maybe you’ve got some zips you don’t want to extract, maybe since you’re managing them with Packwiz to update packs someone else manages? Cool, drop them in packs.

On first run, a QDResLoader-README.txt file will be dropped into resources to give you a quick explainer on how to use the mod. Here’s what it says:

This directory is created and handled by QDResLoader. You can delete this README

once any of the following things exist.

This directory itself is loaded as a datapack and resourcepack, so any pack.mcmeta

will be considered (using a default provided by QSL if not present) and any data in

“data”, as well as resources in “assets” on the client, will be loaded.

You may also create a “packs” directory, and put directories, zips, or jars in there

that will all be loaded as packs. For organization purposes, you may also create a

“datapacks” or “resourcepacks” directory — packs in those directories will only be

loaded as one type instead of both.

The resources in the main directory cannot be disabled by users, but will be visible

in the “Resource Packs” and “Data Packs” menu, and can be reordered. Packs in all

three pack directories can be disabled as the user pleases, but are all enabled by

default.

Jars are recognized as packs so you can take “datapack-as-mod” JARs and drop them

here instead of in mods, if that’s something you would like to do.

常见问题

QDResLoader 支持哪些 Minecraft 版本?

QDResLoader 支持 Minecraft Java 版 1.18–1.20.1,共 9 个版本,可用的加载器:Quilt。下载时注意选择和你游戏版本一致的文件。

QDResLoader 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 Quilt,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:客户端 / 服务端。

评论

登录后评论和评分

exaptations 的其他作品

查看全部 →