ResourceToggle
一款适用于 Minecraft 26.2 的客户端模组,允许你在游戏内即时切换所有非原版资源包,以便进行测试或调试。
功能特性
- 切换按钮:在主菜单和暂停屏幕(右上角)提供。
- 快捷键:在控制设置 → 杂项 (Controls → Misc) 中,默认未绑定。
- 动作栏反馈:切换时在动作栏显示提示。
- 服务器无法感知切换:资源包始终被接受、下载并报告为已应用于服务器(包括所需的服务器端资源包);仅渲染用的资源包堆栈发生切换。不发送任何数据包,也不更改仓库选择。
- 三种切换模式,可在
config/resourcetoggle.json 中配置:
| 模式 |
行为 |
gpu |
两个资源包堆栈均预加载;切换时保持备用堆栈在内存中预热,仅重新上传至 GPU。 |
ram(默认) |
两个堆栈均缓存在 RAM 中;切换在首次预热后不再接触磁盘/ZIP 文件或网络。 |
on_demand |
每次切换执行类似原版 Vanilla 的重载(内存占用最低)。 |
在 ram / gpu 模式下,会话中的第一次切换仍是完整加载;随后的切换直接从内存提供服务,速度应明显快于正常的 F3+T 重载。
关于“即时”的说明:26.2 引入了新的渲染管线(Vulkan/GL 渲染图、RenderPipeline、应用时重新上传图集),无论模组如何操作,都会在重载的应用阶段重新上传纹理。同时保持两个完全活跃的渲染图并不现实,因此 gpu 模式提供的是“预热堆栈 + 最小化 GPU 工作”的切换方式,而非真正的零成本指针交换。
配置
config/resourcetoggle.json(首次运行时创建):
{
"mode": "ram",
"keepLoaderPacks": true,
"toastOnToggle": true,
"extraKeepPacks": [],
"extraExcludePacks": []
}
mode:"gpu"、"ram" 或 "on_demand"。
keepLoaderPacks:在纯原版模式下保留模组提供的资产(大多数模组渲染所必需)。
extraKeepPacks / extraExcludePacks:通过资源包 ID 强制将某些资源包包含或排除在纯原版堆栈之外。
toastOnToggle:切换时在动作栏显示消息。
构建
需要 JDK 25。
./gradlew build
输出:build/libs/ResourceToggle-1.0.jar —— 兼容 Fabric 和 NeoForge 客户端。将其放入 mods 文件夹即可。无需 Fabric API 或其他模组支持。
ResourceToggle
A client-side Minecraft 26.2 mod that lets you instantly toggle all non-vanilla resource packs in-game for testing/debugging.
Features
- Toggle button on the title screen and pause screen (top-right corner).
- Hotkey in Controls → Misc (unbound by default).
- Action bar feedback on switch.
- Server never sees the switch: packs are always accepted, downloaded and
reported as applied to the server (including required server packs); only the rendered resource stack switches. No packets are sent, no repository
selection is changed.
- Three switch modes, configurable in
config/resourcetoggle.json:
| mode |
behaviour |
gpu |
Both resource stacks are pre-loaded; the switch keeps the alternate stack warm in memory and only re-uploads to the GPU. |
ram (default) |
Both stacks are cached in RAM; switching never touches disk/zip/network again after the first warm-up. |
on_demand |
A regular vanilla-style reload on every switch (lowest memory use). |
In ram/gpu mode the first switch in a session is still a full load; every
following switch is served from memory and should be noticeably faster than a normal
F3+T reload.
Note on "instant": 26.2's new render pipeline (Vulkan/GL render graph,
RenderPipeline, atlas re-upload on apply) re-uploads textures during the
reload's apply phase regardless of what the mod does. Keeping two fully live
render graphs simultaneously is not practical, so the gpu mode provides the
warm-stack + minimal-GPU-work switch rather than a true zero-cost pointer
swap.
Config
config/resourcetoggle.json (created on first run):
{
"mode": "ram",
"keepLoaderPacks": true,
"toastOnToggle": true,
"extraKeepPacks": [],
"extraExcludePacks": []
}
mode: "gpu", "ram" or "on_demand".
keepLoaderPacks: keep mod-provided assets in vanilla-only mode (required
for most mods to render).
extraKeepPacks / extraExcludePacks: force packs in or out of the
vanilla-only stack by pack id.
toastOnToggle: show the action-bar message on switch.
Building
Requires JDK 25.
./gradlew build
Output: build/libs/ResourceToggle-1.0.jar — works on both Fabric and
NeoForge clients. Drop it into the mods folder. No Fabric API or other mods required.
评论 0
登录后参与评分
还没有评论,来抢沙发吧