Remember My Txt
Remember My Txt 确保在更改其他选项时,options.txt 文件中未被识别的值也能被保存,从而防止在你等待某个模组移植到新版 Minecraft 时出现按键绑定丢失等问题。
那么问题出在哪里?
关于 options.txt 的工作原理可以在此查看,但可简要总结为以下几点:
- 读取该文件
- 仅保留 Minecraft 所需的值
- 仅保存 Minecraft 已知的值
假设你的 options.txt 文件中有一个自定义选项 key_gui.xaero_toggle_waypoints。
通常情况下,如果你安装了 Fabric 模组 Xaero's Minimap,该选项以及许多其他选项都由 Minecraft 处理。
问题在于,即使你仅在启动 Minecraft 的某一次运行中没有启用该模组,options.txt 也会丢失 key_gui.xaero_toggle_waypoints 选项或该模组提供的任何其他选项。
当你将 Minecraft 更新到新版本时,这种情况极易发生,因为你可能无法立即获取所有想要的模组。
那么解决方案是什么?
解决方案非常简单。所有未被识别的选项都将被记住,这也是模组名称的由来。 然后,那些尚未被 Minecraft 识别的记忆中的选项将与已被识别的选项一起保存。
在 Minecraft 加载 options.txt 后,它会暂时存储所有选项。
此时,Remember My Txt 介入并将所有这些选项存储在内存中一个名为“unaccepted”(未接受)的独立选项集中。
对于 Minecraft 实际读取的每一个选项,该选项会从“unaccepted”选项列表中移除。
此后,我们就有了一个列表,其中包含我们知道 Minecraft 不会保存到 options.txt 的选项。
因此,当 Minecraft 开始再次保存 options.txt 时,我们可以使用这个未使用选项的列表,并将其重新放入 options.txt 中。
使用说明/法律须知
如果你想将此模组包含在你的整合包中,请随意!
如果你想将该代码实现到你自己的模组中,请先征得许可。
本模组采用 MIT 许可证,因此这些规则在法律上没有任何约束力,但我希望你尊重它们。
我未能找到能够实现此功能的模组,如果看起来像是我窃取了其他开发者的成果,对此表示歉意。
Remember My Txt
Remember My Txt makes sure unrecognized values in the options.txt file get saved when changing other options, preventing things like losing keybinds when you are waiting for a mod to port to a newer version of Minecraft.
So what's the problem?
The way options.txt works can be found here, but can be summed up as follows:
- Read the file
- Take only the values Minecraft wants
- Save only the values Minecraft has
Imagine you have a custom option called key_gui.xaero_toggle_waypoints in the options file.
This option, along with many others, is usually handled by Minecraft if you have the fabric mod Xaero's Minimap installed.
The problem is when you don't have the mod on for even a single launch of Minecraft, the options.txt will lose the key_gui.xaero_toggle_waypoints option, or any other options that the mod provides.
This can very easily happen when you update your Minecraft to a newer version, as you might not be able get all the mods you want immediately.
So what's the solution?
The solution is very simple. All unrecognized options will simply be remembered, hence the name of the mod. The remembered options which are not already recognized by Minecraft will then be saved along with the recognized ones.
Directly after minecraft loads options.txt, it temporarily stores all the options. At this point, Remember My Txt comes in and stores all those options in memory in a seperate set of options called the "unaccepted". For every single option that Minecraft actually reads, that options gets removed from the "unaccepted" options. After this, we have a list of options which we know Minecraft will not save to the options.txt. So when Minecraft starts to save options.txt again, we can use this list of unused options and put them back in the options.txt
Usage/Legal Notes
If you want to include this in your modpack, go ahead!
If you want to implement the code into your own mod, please ask permission first.
The license is MIT, so these rules do not have legal implications by any means, however I ask that you respect them.
I was unable to find a mod which accomplishes what this mod does, so apologies if it appears that I have stolen from another developer.
下载 Remember My Txt
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Remember My Txt
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Remember My Txt
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Remember My Txt
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Remember My Txt
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Remember My Txt
下载 Remember My Txt
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Remember My Txt
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Remember My Txt
下载 Remember My Txt
- 修复选项加载失败导致的崩溃(感谢 @Wyvest)
- 其他多项调整
移植到 26.1.2
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个基于构建器的 Minecraft 配置库!
模组
? 使用命令保存和加载玩家或他人的背包/套装。
模组
一款轻量级模组,允许服务器管理员对抗透视作弊者。
模组
恢复所有账户的游戏聊天访问权限
模组
通过图形界面控制模组加载。适用于需要可选功能的整合包和服务器,也适合不想手动操作文件而希望直接管理模组的极客用户。
模组
实体tick优化
评论 0
登录后参与评分
还没有评论,来抢沙发吧