概述
该模组使您能够加载从互联网下载内容的资源包。
为什么需要这个?
一些玩家、模组和整合包可能需要保持其资源的最新状态。
此外,有些资源直接分发可能不合法,因此需要在运行时下载。
配置格式
将配置文件放在 .minecraft/config/RemoteResourcePack/ 目录(或其子目录)中,后缀为 .json。
以下是一个示例。请注意,配置文件中不允许有注释。
{
"schema": 1, // 必填项
// 资源包过时并需要重新下载的时间
// 例如:2min / 3d / 11h45min14s
// 可以是 "always" 或 "never"
"autoUpdate": "2h",
// 控制资源包包含哪些文件的配置
"zipconfig": "https://featurehouse.github.io/epx_packs/v2/dl/zipconfig.json",
"args": { // 动态内容参数
"poem": "random", // 可以是字面值 "random"
"splashes": 0 // 可以是数字索引
},
// 远程内容 URL 的基本 URL
"base": "https://featurehouse.github.io/epx_packs/v2/dl/index.html"
}
zipconfig 格式(也不允许注释):
{
"static": { // 始终包含的文件
"pack.mcmeta": { // 可以直接定义
"raw": "{\"pack\":{\"pack_format\":18,\"description\":\"Hello World\"}}"
},
"assets/example/test.bin": { // 可以使用 base64 定义
"base64": "TmV2ZXIgR29ubmEgR2l2ZSBZb3UgVXAh"
},
"assets/example/songs/dynamic/rickroll.ogg": { // 可以从互联网下载
"fetch": "https://www.example.net/songs/Rick%20Astley/Never_Gonna_Give_You_Up-HiRes.ogg"
},
"assets/example/lang/fr_fr.json": { // 可以使用相对 URL,其基本 URL 在上述配置中定义
"fetch": "/my-interesting-example-mod/resources/i18n/fr_fr.json"
}
},
"dynamic": {
"example-arg": { // 见上述配置中的 "args"
"default": "random", // 随机选择一个项目。可以在 args.example-arg 中覆盖。
"items": [{
"weight": 250, // 可以省略,默认为 100
"files": { // 与 "static" 中相同
"assets/example/news/content.json": {"fetch": "/my-interesting-example-mod/news-channel/1.json"},
"assets/example/news/timestamp.txt": {"raw": "2023-10-10T09:24:30+08:00"}
}
}, {
"files": {
"assets/example/news/content.json": {"fetch": "/my-interesting-example-mod/news-channel/2.json"},
"assets/example/news/timestamp.txt": {"raw": "2023-10-10T09:25:21+08:00"}
}
}]
},
"another_arg": {
"default": 0,
"items": [
{},
{
"files": {
"assets/example/textures/items/silver_ingot.png": {
"fetch": "/my-interesting-example-mod/experimental/resources/silver_ingot/2023-10-10.png"
}
}
}
]
}
}
}
模组的内置配置
模组可以在 JAR 的根目录下的 RemoteResourcePack.json 中包含其配置。
以下是一个示例:
{
"end-poem-extension/recommended-pack-v2.json": {
"schema": 1,
"_description": [
"End Poem Extension Recommended Pack",
"Contents may differ between downloads as they are picked randomly"
],
"autoUpdate": "2h",
"args": {
"poem": "random",
"splashes": 0
},
"base": "https://featurehouse.github.io/epx_packs/v2/dl/index.html",
"zipconfig": "https://featurehouse.github.io/epx_packs/v2/dl/zipconfig.json"
}
}
配置将被转储到 .minecraft/config/RemoteResourcePack/end-poem-extension/recommended-pack-v2.json(如果不存在),并由此加载。