Перейти к содержимому
Mineforgian

QDResLoader

A dead-simple resource loader that reuses existing functionality.

15K загрузок10 подписчиковCC0-1.0quilt

Обновлён 6 июля 2023 г. · опубликован 23 декабря 2022 г.

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.

Версии

ВерсияКаналИграЗагрузчикиДатаСкачать
2.0.1Релиз1.19.4, 1.20, 1.20.1quilt6 июля 2023 г.Скачать (10 КБ)
2.0+1.19.4Релиз1.19.4quilt27 марта 2023 г.Скачать (10 КБ)
2.0+1.19.2Релиз1.19.2quilt15 января 2023 г.Скачать (11 КБ)
1.2.2Релиз1.18.1, 1.18.2, 1.19, 1.19.1quilt26 декабря 2022 г.Скачать (9 КБ)
1.2.1Релиз1.18.1, 1.18.2, 1.19, 1.19.1quilt26 декабря 2022 г.Скачать (6 КБ)
1.2Релиз1.18.1, 1.18.2, 1.19, 1.19.1quilt25 декабря 2022 г.Скачать (6 КБ)
1.1.1Релиз1.18.1, 1.18.2, 1.19, 1.19.1quilt25 декабря 2022 г.Скачать (5 КБ)
1.1Релиз1.18.1, 1.18.2, 1.19, 1.19.1quilt23 декабря 2022 г.Скачать (5 КБ)
1.0Релиз1.18.1, 1.18.2, 1.19, 1.19.1quilt23 декабря 2022 г.Скачать (3 КБ)

Ченджлог

2.0.1Релиз1.19.4, 1.20, 1.20.1 · 6 июля 2023 г.
  • Updated to 1.20 by EnnuiL, thanks!
2.0+1.19.4Релиз1.19.4 · 27 марта 2023 г.
  • Ported to 1.19.4 by EnnuiL (#2
2.0+1.19.2Релиз1.19.2 · 15 января 2023 г.
  • Ported to the new APIs added in QSL 3.0.0-beta.25, as a result:
  • Packs now show up in the Resource Packs and Data Packs management UIs, and can be disabled piecemeal by users
  • Worldgen JSON changes now work properly instead of causing strange errors
  • Users can now modify the load order relative to their own packs instead of QDRL always overriding
  • No longer using implementation classes, pure API :)
1.2.2Релиз1.18.2, 1.19, 1.19.1 · 26 декабря 2022 г.
  • Switch to a mixin to inject packs, as Top can't affect the biome registry and clobbers user packs
1.2.1Релиз1.18.2, 1.19, 1.19.1 · 26 декабря 2022 г.
  • Fixed resources being loaded as default instead of on top
1.2Релиз1.18.2, 1.19, 1.19.1 · 25 декабря 2022 г.
  • Add "resourcepacks" and "datapacks" directories, for organization purposes
  • Fix directory packs
  • Ignore directory packs that end in .disabled
  • Drop a README file into resources if there's nothing recognized in it
1.1.1Релиз1.18.2, 1.19, 1.19.1 · 25 декабря 2022 г.
  • Only load files in packs that end in .zip or .jar — directories are still loaded
  • Give a friendlier error message when a pack can't be opened
  • Catch all errors when injecting packs to avoid resource loading explosions
1.1Релиз1.18.2, 1.19, 1.19.1 · 23 декабря 2022 г.
  • Added pack loading functionality

Комментарии

Загружаем…