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

Fill README with latest info #6

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

Conversation

User-green
Copy link

@User-green User-green commented Feb 12, 2025

I thought that README is a bit outdated, so I updated it.

@oxydien
Copy link
Owner

oxydien commented Feb 12, 2025

Thanks for the PR!

It's true that the previous README was lacking some informations...

Anyway, everything seems good, except for:

  • Line 64: Typo in the word modyfy in the note.
    • Just want to clarify that simple-mod-sync will remove any file that's name starts with the name of the mod in the json and does not match with the version. Code for it here
  • Line 70: Once again a small typo bouth
    • Theoretically, modifications run AFTER content download, so it should not cause any harm, if done correctly... Code for it here

Thanks again! This helps a lot. If you have any questions or comments, feel free to put them here :D.

- oxydien

@User-green
Copy link
Author

User-green commented Feb 13, 2025

Just want to clarify that simple-mod-sync will remove any file that's name starts with the name of the mod in the json and does not match with the version. Code for it here

Oh. So there IS a way to automate it...
Alright, I will have to update static translator.
Can you please explain this part with a bit more detail? I have tried to read the code, but I am no java programmer, so I understood nothing.
Is it registr-sensetive? It searches for modname inside the mod or only in the filename?
Will it search for version inside the mod, or will it remeber version from the last time?

Theoretically, modifications run AFTER content download, so it should not cause any harm, if done correctly... Code for it here

Still, better to tell users to avoid this whenever possible, as it have to be done CORRECTLY.
If modification is remove, than it will cause harm, 100%.
Thought, it would be great if you can just put "remove" with "./mods/*" and have everything but synced stuff removed.

@User-green User-green marked this pull request as draft February 13, 2025 14:14
@oxydien
Copy link
Owner

oxydien commented Feb 13, 2025

Sorry that I didn't explain this earlier...
Let me clarify how the mod handles content synchronization:

File Naming Convention:
The mod uses a simple filename-based approach to minimize complexity (no additional metadata files). Each file follows this format:
[contentName]-[contentVersion].[extension]
where the extension is determined by the content type (e.g., .jar for mods)

Sync Process:

  1. For each content entry in the sync config (JSON):
    • The mod searches for matching files using only the contentName in the working directory (e.g., ./mods/ for mods)
    • Since SMS doesn't track previous versions, it relies solely on filename matching
  2. If no matching file is found:
    • Downloads the content
  3. If a matching file exists:
    • Compares the contentVersion
    • If versions differ (in anyway, using text), replaces the old file with the newer version

Important Notes:

  • All content names are sanitized before any filesystem operations
  • This mod doesn't inspect mod metadata - it only handles file placement in the Minecraft filesystem
  • The config content has to use metadata that is located at ./[path]/sms_[contentName]-[contentVersion].json

Regarding file modifications (remove/rename operations): While the mod performs these as specified, users should be careful with their sync configurations as potentially harmful operations could affect the filesystem

I hope this helps clarify the implementation. Let me know if you need any further explanation.
- oxydien

@User-green
Copy link
Author

Quick question. Is rename modification already implemented?

@User-green
Copy link
Author

Wasn't able to find rename, so let it be like this for the time being. You can anyway emulate rename with remove + sync

@User-green User-green marked this pull request as ready for review February 13, 2025 16:47
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

Successfully merging this pull request may close these issues.

2 participants