diff --git a/readme.md b/readme.md index 2921399..1ddfd25 100644 --- a/readme.md +++ b/readme.md @@ -13,7 +13,60 @@ during startup, such as overwriting or deleting specified files. Actions will on ## How? -(TODO) +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? diff --git a/src/main/java/dev/encode42/meows/Meows.java b/src/main/java/dev/encode42/meows/Meows.java index a66c932..a41960b 100644 --- a/src/main/java/dev/encode42/meows/Meows.java +++ b/src/main/java/dev/encode42/meows/Meows.java @@ -54,10 +54,6 @@ public class Meows implements PreLaunchEntrypoint { this.logger.info("Copying default files and processing actions..."); filesystem.walkSource(); - - // todo: walk source is copying default files after first run (even when specified to be deleted) - // might be fine, might need warning - filesystem.walkActions(); this.logger.info("Done!");