The server was still overwriting an existing server.properties file despite an earlier patch, so writes must be guarded at the central store point as well as the dedicated-server save path.
Ensure configuration persistence never clobbers an existing file created or managed externally.
Description
Add import java.nio.file.Files and an early-exit if (Files.exists(path)) return; guard to Settings.store(Path) so the base store method will skip writes when the target exists.
Add the same Files.exists(this.path) check to DedicatedServerSettings.save() to prevent the dedicated-server save flow from overwriting an existing file.
Update the patch file patches/server/0313-Prevent-server-properties-overwrite.patch to include both changes so both codepaths are covered.
### Motivation
- The server was still overwriting an existing `server.properties` file despite an earlier patch, so writes must be guarded at the central store point as well as the dedicated-server save path.
- Ensure configuration persistence never clobbers an existing file created or managed externally.
### Description
- Add `import java.nio.file.Files` and an early-exit `if (Files.exists(path)) return;` guard to `Settings.store(Path)` so the base store method will skip writes when the target exists.
- Add the same `Files.exists(this.path)` check to `DedicatedServerSettings.save()` to prevent the dedicated-server save flow from overwriting an existing file.
- Update the patch file `patches/server/0313-Prevent-server-properties-overwrite.patch` to include both changes so both codepaths are covered.
### Testing
- No automated tests were run for this change.
------
[Codex Task](https://chatgpt.com/codex/tasks/task_e_696fa6096ac8832fa894d6a343f480ae)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Motivation
server.propertiesfile despite an earlier patch, so writes must be guarded at the central store point as well as the dedicated-server save path.Description
import java.nio.file.Filesand an early-exitif (Files.exists(path)) return;guard toSettings.store(Path)so the base store method will skip writes when the target exists.Files.exists(this.path)check toDedicatedServerSettings.save()to prevent the dedicated-server save flow from overwriting an existing file.patches/server/0313-Prevent-server-properties-overwrite.patchto include both changes so both codepaths are covered.Testing
Codex Task