跳到正文

MEOWS

作者:encode42

my existing options will survive (default files)

收藏

介绍

中文介绍正在准备中,下面暂时显示原文。

MEOWS

my existing options will survive

What?

Similar to YOSBR
or Configured Defaults, this mod provides a way to copy default game
files when Minecraft is started.
This is useful for mod pack creators who need to include configuration files but don’t want to reset user changes after
every update.

Different from the aforementioned mods, MEOWS implements an “actions” system, in which certain actions can be performed
during startup, such as overwriting or deleting specified files. Actions will only run once.

How?

Every file in the defaults directory will be copied to their relevant places in the game’s root directory. For
example, .minecraft/defaults/options.txt will be copied to .minecraft/options.txt if the file doesn’t already exist.

The mod can be configured from the config/meows/config.json file. This includes the current version of the default
files (for actions), and the actions to perform per each version. To use MEOWS like YOSBR or Configured Defaults, these
options can be ignored.

Actions are stored as an array of objects, each containing an array of files to overwrite or delete and the relevant
version. Here’s an example that will overwrite the options.txt file:

{
  "version": 2,
  "actions": [
    {
      "version": 2,
      "overwrite": [
        "options.txt"
      ]
    }
  ]
}

When the game is started, MEOWS will perform these actions if it hasn’t already. The local MEOWS version will then be
updated so these actions cannot be performed again.

For overwrite actions, the file must have a corresponding file located in the defaults directory.

{
  "version": 3,
  "actions": [
    {
      "version": 3,
      "delete": [
        "options.txt"
      ]
    },
    {
      "version": 2,
      "overwrite": [
        "options.txt"
      ]
    }
  ]
}

In this example, the top-most action will take precedence. options.txt will be deleted, despite being overwritten in
the previous version.

Note that, if the options.txt file is still included in the defaults directory, it will be copied if non-existent
when the game is next started as actions are only processed once.

Why?

From my experience maintaining mod packs, I’ve found that similar mods are lacking in one crucial way: how could a mod
pack author control file changes?
After all, they only copy files if they don’t already exist, meaning that major
configuration file changes or updating files that have already been generated are impossible. MEOWS solves this issue
with its actions system, providing the method of performing one-time operations on files.

FAQ

Will this be ported to more mod loaders?

In the future, probably.

Will this be ported to more Minecraft versions?

In the future, probably.

Why does this use preLaunch rather than serving as a language provider on Fabric?

Ideally, this mod should be absolutely effortless to maintain. As such, I opted for the “right” ways when it came to
many architectural decisions, notably avoiding the hacky language provider method other similar mods use in order to run
as soon as possible. This does mean that some other mods might create files before MEOWS is able to copy their defaults.
However, I’ve found that these cases are uncommon enough to where it’s not much of an issue.

常见问题

MEOWS 支持哪些 Minecraft 版本?

MEOWS 支持 Minecraft Java 版 26.1–26.2,共 4 个版本,可用的加载器:Fabric。下载时注意选择和你游戏版本一致的文件。

MEOWS 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:客户端 / 服务端。

评论

登录后评论和评分

encode42 的其他作品

查看全部 →