← Назад к ресурсам

MEOWS

my existing options will survive (default files)

Modrinth utility

Описание

# MEOWS *my existing options will survive* ## What? Similar to [YOSBR](https://modrinth.com/mod/yosbr) or [Configured Defaults](https://modrinth.com/mod/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: ```json { "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. ```json { "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.