Resource Reload Guard
Resource Reload Guard 是适用于 Minecraft Java 版的一个客户端模组。
在大型整合包中,重新加载客户端资源可能需要数分钟,并可能导致长时间的垃圾回收暂停、卡死或崩溃。本模组并不会加快资源加载速度,而是保护已知的用户操作,防止昂贵且不必要的重新加载意外或不必要地触发。
支持的环境
Resource Reload Guard 仅支持客户端,并提供以下版本:
- Fabric(需要 Fabric API)
- Forge
- NeoForge
功能
资源包
- 检测已启用、已禁用及重新排序的资源包。
- 当资源包 ID 和顺序未发生变化时,跳过应用选择的操作。
- 允许你返回编辑界面而不会丢失当前的选择状态。
- 可以丢弃当前选择,并从打开该屏幕之前的状态进行恢复。
- 可以选择立即应用,或将选择保存至下次启动时生效。
语言
- 当所选语言未发生变化时,跳过重新加载。
- 在应用前显示当前语言和所选语言。
- 可以选择立即应用,或将语言设置保存至下次启动时生效。
Mipmap 级别
- 在离开视频设置界面之前检测 mipmap 级别的变化。
- 可以选择返回视频设置界面,仅放弃 mipmap 更改、将其推迟至下次启动,或立即应用。
- 仅在选择了 立即应用 时才重新加载客户端纹理。
安全措施
- 危险操作按钮初始状态下不会获得焦点。
- 按
Esc 键始终返回安全界面。
- 危险按钮需等待配置的客户端刻数以及等效的单调时间经过后才会激活。
- 初始加载、模组发起的重载、服务器资源包、恢复性重载以及来源不明的重载不会被全局取消。
F3+T
- 在原版重载开始前停止它。
- 仅在明确确认后执行重载。
- 防止因按键重复导致的重复提示和重载。
- 在重载活动期间拒绝额外的用户请求。
配置
首次启动时会生成一个带注释的 TOML 配置文件:
config/resource_reload_guard.toml
| 键 |
默认值 |
描述 |
debugKeyPolicy |
CONFIRM |
F3+T 的策略 |
resourcePackPolicy |
CONFIRM |
资源包变更的策略 |
languagePolicy |
CONFIRM |
语言变更的策略 |
mipmapPolicy |
CONFIRM |
mipmap 级别变更的策略 |
skipUnchangedResourcePackApply |
true |
跳过未变更的资源包选择 |
allowDeferredResourcePackApply |
true |
允许延迟应用资源包变更 |
allowDeferredLanguageApply |
true |
允许延迟应用语言变更 |
allowDeferredMipmapApply |
true |
允许延迟应用 mipmap 变更 |
blockUserRequestsWhileReloading |
true |
在重载期间拒绝其他受保护请求 |
dangerousButtonDelayTicks |
20 |
危险按钮激活前的延迟刻数 |
showLoadedModCount |
true |
显示已加载模组数量作为上下文信息 |
largeEnvironmentWarningThreshold |
200 |
非阻塞警告的模组数量阈值 |
可用的策略值为 ALLOW、CONFIRM、BLOCK 和 RESTART_ONLY。已加载模组数量仅用于提供信息性警告;它绝不会自动阻止重载或估算重载持续时间。
已知限制
- 本模组无法预测重载持续时间,也无法优化重载流程。
- 大幅替换资源包、语言或视频设置界面的模组——或注入相同原版方法的模组——可能会与本模组的 Mixins 发生冲突。
- 服务器资源包以及来源无法识别的重载不在本模组的保护范围内。
- 本模组不会自动重启 Minecraft 进程。
Resource Reload Guard
Resource Reload Guard is a client-side mod for Minecraft Java Edition.
Reloading client resources can take several minutes in large modpacks and may cause long garbage-collection pauses, hangs, or crashes. This mod does not make resource loading faster. Instead, it guards known user actions so an expensive reload does not begin accidentally or unnecessarily.
Supported environments
Resource Reload Guard is client-side only and is available for:
- Fabric (Fabric API required)
- Forge
- NeoForge
Features
Resource packs
- Detects enabled, disabled, and reordered packs.
- Skips applying a selection when the pack IDs and order are unchanged.
- Lets you return to editing without losing the current selection.
- Can discard the selection and restore the state from before the screen was opened.
- Can apply now or save the selection for the next launch.
Language
- Skips the reload when the selected language is unchanged.
- Shows the current and selected languages before applying.
- Can apply now or save the language for the next launch.
Mipmap levels
- Detects a mipmap-level change before leaving Video Settings.
- Can return to Video Settings, discard only the mipmap change, defer it until the next launch, or apply it now.
- Reloads client textures only when Apply now is selected.
Safety measures
- Dangerous actions never receive initial focus.
Esc always returns to a safe screen.
- Dangerous buttons remain disabled until both the configured number of client ticks and the equivalent monotonic time have elapsed.
- Initial loading, mod-initiated reloads, server resource packs, recovery reloads, and reloads of unknown origin are not globally cancelled.
F3+T
- Stops the vanilla reload before it starts.
- Runs it only after explicit confirmation.
- Prevents duplicate prompts and reloads caused by key repeat.
- Rejects additional user requests while a reload is active.
Configuration
A commented TOML file is generated on first launch:
config/resource_reload_guard.toml
| Key |
Default |
Description |
debugKeyPolicy |
CONFIRM |
Policy for F3+T |
resourcePackPolicy |
CONFIRM |
Policy for resource-pack changes |
languagePolicy |
CONFIRM |
Policy for language changes |
mipmapPolicy |
CONFIRM |
Policy for mipmap-level changes |
skipUnchangedResourcePackApply |
true |
Skip unchanged pack selections |
allowDeferredResourcePackApply |
true |
Allow pack changes to be deferred |
allowDeferredLanguageApply |
true |
Allow language changes to be deferred |
allowDeferredMipmapApply |
true |
Allow mipmap changes to be deferred |
blockUserRequestsWhileReloading |
true |
Reject additional guarded requests during reloads |
dangerousButtonDelayTicks |
20 |
Delay before dangerous buttons become active |
showLoadedModCount |
true |
Show the loaded mod count as context |
largeEnvironmentWarningThreshold |
200 |
Mod-count threshold for a non-blocking warning |
Available policy values are ALLOW, CONFIRM, BLOCK, and RESTART_ONLY. The loaded mod count is used only for an informational warning; it never automatically blocks a reload or estimates its duration.
Known limitations
- The mod does not predict reload duration or optimize the reload pipeline.
- Mods that substantially replace the Resource Packs, Language, or Video Settings screens—or inject into the same vanilla methods—may conflict with its Mixins.
- Server resource packs and reloads whose origin cannot be identified are outside the guard's scope.
- The mod does not restart the Minecraft process automatically.
评论 0
登录后参与评分
还没有评论,来抢沙发吧