Contents Director
Contents Director 是一款用于 Minecraft 整合包的运行时模组和文件安装工具。它使用整合包作者提供的配置,下载并安装无法直接打包进整合包的文件。
它主要面向整合包作者,旨在提供一种可复现的方式,在启动整合包时获取可选的、外部的或由提供商托管的文件。
功能特性
- 从直接 URL 下载文件
- 从 CurseForge 和 Modrinth 引用中安装文件
- 通过哈希值验证下载的文件
- 在替换现有文件之前暂存下载内容
- 支持可选的用户自定义组件
- 覆盖、禁用、移动、重命名或删除旧文件
- 解压 ZIP 兼容格式的压缩包
- 加载捆绑和远程配置
- 按客户端/服务端过滤条目
- 检查整合包版本
- 在图形化客户端上提供手动 CurseForge 下载的备用方案
- 本地化用户界面,支持英语、日语和简体中文
兼容性
分发的项目文件为合并后的阴影制品(shaded artifact):
ContentsDirector-<version>-all.jar
它同时包含 LaunchWrapper 和 ModLauncher 集成,是正常使用的推荐制品。
Contents Director 支持:
- 通过 LaunchWrapper 支持的 Forge 1.7.10–1.12.2
- Forge 及兼容的 ModLauncher 时代加载器
- NeoForge(最高至 Minecraft 1.21.8)
已知限制: NeoForge 1.21.9 及更高版本更改了加载器行为,目前尚不支持。
Contents Director 针对 Java 8 字节码进行编译以确保运行时兼容性。
安装
将 Contents Director 的 -all.jar 放入整合包常规的 mods 目录中。
对于 LaunchWrapper 时代的 Forge(1.7.10–1.12.2),请添加以下启动参数:
--tweakClass com.juanmuscaria.modpackdirector.launchwrapper.ModpackDirectorTweaker
ModLauncher 时代的环境会通过转换服务自动发现该集成。
配置
配置文件通常位于:
config/mod-director/
一个简单的直接下载条目示例 example.url.json 如下所示:
{
"url": "https://example.invalid/example-mod.jar",
"fileName": "example-mod.jar"
}
Contents Director 支持多种配置类型:
*.url.json — 直接下载
*.curse.json — CurseForge 文件
*.modrinth.json — Modrinth 版本
*.modify.json — 移动、重命名、禁用或删除文件
*.bundle.json — 组合多个条目
*.remote.json — 从 HTTP(S) 加载配置
modpack.json — 整合包级别的 UI 和版本设置
有关完整的格式和示例,请参阅 配置文档。
安全性与可靠性
下载内容会在提交到实际安装目录之前进行暂存。在替换文件之前会检查配置的哈希值,暂存失败或验证失败不会覆盖现有的有效文件。
压缩包解压和文件修改操作会验证路径,以防止跳出预期的安装目录。
文档
致谢
Contents Director 延续了以下项目的开发工作:
Contents Director
Contents Director is a runtime mod and file installer for Minecraft modpacks. It downloads and installs files that cannot be bundled directly with a modpack, using configuration supplied by the pack author.
It is intended primarily for modpack authors who need a reproducible way to fetch optional, external, or provider-hosted files when a pack starts.
Features
- Download files from direct URLs
- Install files from CurseForge and Modrinth references
- Verify downloaded files with hashes
- Stage downloads before replacing existing files
- Support optional user-selectable components
- Supersede, disable, move, rename, or delete old files
- Extract ZIP-compatible archives
- Load bundled and remote configuration
- Filter entries by client/server side
- Check modpack versions
- Provide a manual CurseForge download fallback on graphical clients
- Localized UI with English, Japanese, and Simplified Chinese support
Compatibility
The distributed project file is the combined shaded artifact:
ContentsDirector-<version>-all.jar
It contains both the LaunchWrapper and ModLauncher integrations and is the recommended artifact for normal use.
Contents Director supports:
- Forge 1.7.10–1.12.2 through LaunchWrapper
- Forge and compatible ModLauncher-era loaders
- NeoForge through Minecraft 1.21.8
Known limitation: NeoForge 1.21.9 and newer changed loader behavior and are not currently supported.
Contents Director targets Java 8 bytecode for runtime compatibility.
Installation
Place the Contents Director -all.jar in the modpack's normal mods directory.
For LaunchWrapper-era Forge (1.7.10–1.12.2), add the following launch argument:
--tweakClass com.juanmuscaria.modpackdirector.launchwrapper.ModpackDirectorTweaker
ModLauncher-era environments discover the integration automatically through the transformation service.
Configuration
Configuration files normally belong in:
config/mod-director/
A minimal direct-download entry, for example example.url.json, looks like:
{
"url": "https://example.invalid/example-mod.jar",
"fileName": "example-mod.jar"
}
Contents Director supports several configuration types:
*.url.json — direct downloads
*.curse.json — CurseForge files
*.modrinth.json — Modrinth versions
*.modify.json — move, rename, disable, or delete files
*.bundle.json — combine multiple entries
*.remote.json — load configuration from HTTP(S)
modpack.json — pack-level UI and version settings
For the complete format and examples, see the configuration documentation.
Safety and reliability
Downloads are staged before being committed to the live installation. Configured hashes are checked before replacement, and failed staging or validation does not overwrite an existing working file.
Archive extraction and file modification operations validate paths to prevent escaping the intended installation directory.
Documentation
Credits
Contents Director continues the work of:
评论 0
登录后参与评分
还没有评论,来抢沙发吧