
警告: 由于该模组使用了 %APPDATA% 文件路径,目前仅支持 Windows 电脑。在 Linux / macOS 机器上,此模组几乎肯定会崩溃或行为异常。
简介
你好!这是我制作的一个模组,旨在解决每次更新时都需要手动安装 30 多个模组的麻烦。现在,你不必再为此烦恼了!欢迎使用 Auto Updater:一个简单却极其实用的模组,只需点击一下按钮即可为你更新 所有模组!(有关更新后的模组下载位置信息,请参阅“如何安装这些更新的模组?”)
依赖项
- Fabric API(适用于 Minecraft 版本 26.2)
功能说明
当你按下 Q 键(或其他自定义按键)时,会弹出一个窗口,询问你 是否想要更新你的模组。
选择“是”将 自动下载你所有模组的新版本。
如果未找到更新版本(例如,如果你的模组是从 Curseforge 下载的,或者还没有针对最新可用版本的模组),Auto Updater 会将该模组原封不动地移动到 updated 文件夹中。
如何安装这些更新的模组?
如果你希望忽略 mods 文件夹中的任何模组,请在文件名末尾添加 _IGNORE(例如 sodium_IGNORE.jar)。
所有模组下载完成后,导航至 %APPDATA%.minecraft\mods 文件夹。(也可以表示为 C:\Users\[你的用户名]\AppData\Roaming.minecraft\mods)
然后,将你之前的所有模组移动到一个 备份文件夹,并将子文件夹 updated 中的所有文件移动到主 mods 文件夹中。确认一切正常后,你可以选择删除旧模组。
删除 updated 文件夹是完全安全的。
(上述所有内容都在模组 GUI 中有概述,但我认为还是在这里粘贴一遍比较好。)
图片

前往画廊查看更多图片!
即将推出
一些即将推出的功能包括:
- 取消 按钮
- 与 Minecraft 特别是渲染器的更好集成
- 在非世界状态下也能按下 Q 键的功能
...以及 更多内容!
链接
本模组的 GitHub 仓库
发现问题?报告它!
模组工作原理
本节内容适用于 v1.3.0 及以上版本。
此模组主要使用免费的 Modrinth API 来获取模组文件。
它使用 Java HttpClient 库来实现这一功能。
(以下步骤会对你 mods 目录中的每个文件重复执行)
步骤 1:模组获取文件的 SHA-512 哈希值,并使用 Modrinth 上的“通过文件哈希获取最新版本”API(https://api.modrinth.com/v2/version_file/{hash}/update)
步骤 2:模组在 JSON 的 files 部分中找到第一个文件(尚不支持多个文件,但它们似乎并不常见),并获取 url 数据。
步骤 3:然后,模组从 URL 下载 JAR 文件,并将其放置在你 mods 目录中的 updated 文件夹内。
步骤 4:如果文件哈希值与预期哈希值不匹配,则重新下载文件。当哈希值匹配时,程序将继续处理下一个文件并重复这些步骤。

WARNING: This mod currently supports Windows PCs only, due to it using the %APPDATA% file path. This mod will almost certainly crash or behave unpredictably on Linux / macOS machines.
Introduction
Hello! This is a mod I made to solve the issue of having to install 30+ mods manually every time something updated. Well, now you don't have to worry about that! Enter Auto Updater: a simple yet extremely useful mod to update all of your mods for you at the click of a button! (See "How do I install these updated mods?" for information on where they get downloaded to.)
Dependencies
- Fabric API for Minecraft version 26.2
What it does
When you press Q (or another custom key), a window opens up which asks you if you would like to update your mods.
Choosing "yes" will automatically download the newest versions of all of your mods.
If an updated version is not found (for instance, if your mod was downloaded on Curseforge or does not have a version for the latest update available yet), Auto Updater will simply move the mod without changes to the updated folder.
How do I install these updated mods?
If you would like any mod in your mods folder to be ignored, append _IGNORE to the end of the file name (e.g. sodium_IGNORE.jar).
After all mods are downloaded, navigate to the %APPDATA%.minecraft\mods folder. (can also be styled as C:\Users\[your user]\AppData\Roaming.minecraft\mods)
Then, move all your previous mods to a backup folder and move all files in the subfolder updated into the main mods folder. Once you are happy it all works, you can delete the old mods if you want.
It is completely safe to delete the updated folder.
(All of the above is outlined in the mod GUI, but I thought it would be good to paste it here anyways.)
Images

Go to the gallery for more images!
Coming soon
Some features that will come soon include:
- A Cancel button
- Better integration with Minecraft and especially the renderer
- The ability to press Q while not in a world
...and much more!
Links
My GitHub repository for this mod
Found an issue? Report it!
How this mod works
This section applies for versions v1.3.0 onwards.
This mod primarily uses the free Modrinth API in order to get the files for the mods.
It uses the Java HttpClient library to achieve this.
(These steps are repeated for each file in your mods directory)
Step 1: The mod gets the SHA-512 hash of the file and uses it with the "Get Latest Version from File Hash" API on Modrinth (https://api.modrinth.com/v2/version_file/{hash}/update)
Step 2: The mod finds the first file in the files section of the JSON (multiple files are not supported yet, though they don't seem to be common) and gets the url data.
Step 3: Then, the mod downloads the JAR from the URL and places it inside the updated folder in your mods directory.
Step 4: If the file hash does not match with the expected hash, the file is downloaded again. When the hashes do match, the program moves on to the next file and repeats these steps.
评论 0
登录后参与评分
还没有评论,来抢沙发吧