Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idea for a rewrite #15

Open
Brancieq-Paul opened this issue Jun 6, 2023 · 2 comments
Open

Idea for a rewrite #15

Brancieq-Paul opened this issue Jun 6, 2023 · 2 comments

Comments

@Brancieq-Paul
Copy link
Owner

The main problem the mod wants to solve:
Actually, in a modpack, there is no way to edit options on update without overriding configs files


Actual mod


The way the actual mod tries to fix it:

  • It gives a way to apply an overrides folder containing the files named and stored as in the architecture of the original instance:
    • If the original file does not exist, it is created with the override file
    • If the original file already exists, for each key:
      • If the key does not exist in the original file, create it with the new value
      • Else replace it with the new value

What the actual mod needs to work well:

  • Know the actual version of the modpack
  • An override folder for the actual and FOR EACH precedent version of the modpack (a lot of data accumulating)
  • Merge successively all the concerned versions override for each update (if you just updated, from the version you configs to the version you just updated to) (it's a heavy process)

Rewritten mod

The main idea is to simplify the mod for easier development, usage, and give more general features, and fix the ambiguity of how to implement default options.

Mains points:

  • Only one override folder (the only data that interest us is the last updated one)
  • This override folder act as a default values folder (this way, we keep one folder as a base for the update and as default options)
  • For each version, an index of each key/file/folder that should be forced when updated (we do not keep an entire override folder anymore, just an index which should be overridden with the values in the only override folder)

The process of the mod on game launch:

  • If the modpack was just updated (= config version does not match with modpack version)
    • Compile all the forced keys/files/folders from the intermediate updates (between config version and the actual version you just updated too) in one list of forced keys/files/folders
  • Apply override:
    • For each file in the override (default config):
      • If the file does not exist in the instance, create it as a copy of the default file
      • Else if the file exists:
        • For each key in the default file:
          • If the key exists in the instance file and the key/file/folder is in the forced list, replace with the default value
          • If the key exist but not forced, do nothing
          • If the key does not exist in the instance, create it
@HB-Stratos
Copy link

Sounds like an interesting upgrade. Are you still working on this?
I'd love to use this mod in it's current form, though not all configs I need to work with are supported, e.g. json5. I do absolutely love the idea of having all my changed config settings in one place so I always know what I changed and never need to touch the config files themselves. The latter gets very annoying to handle when updating a modpack as I can never tell what was touched and what wasn't.

@Brancieq-Paul
Copy link
Owner Author

Sounds like an interesting upgrade. Are you still working on this? I'd love to use this mod in it's current form, though not all configs I need to work with are supported, e.g. json5. I do absolutely love the idea of having all my changed config settings in one place so I always know what I changed and never need to touch the config files themselves. The latter gets very annoying to handle when updating a modpack as I can never tell what was touched and what wasn't.

I want to work on this again this year, for now I'm other projects. I learned a lot in java since I made this first version, so I should be able to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants