Ensure the server never overwrites an existing server.properties file so admin/customized values are preserved.
Avoid accidental configuration resets during server startup or config updates.
Description
Add a guard to DedicatedServerSettings.update to skip saving if this.path already exists by checking java.nio.file.Files.exists(this.path).
Add the same existence check to DedicatedServerSettings.save so server.properties is only written when it does not already exist.
Changes are delivered as a patch file at patches/server/0313-Prevent-server-properties-from-being-overwritten.patch that modifies src/main/java/net/minecraft/server/dedicated/DedicatedServerSettings.java.
Testing
No automated tests were executed for this patch because it is a small, patch-only change intended to alter save behavior.
### Motivation
- Ensure the server never overwrites an existing `server.properties` file so admin/customized values are preserved.
- Avoid accidental configuration resets during server startup or config updates.
### Description
- Add a guard to `DedicatedServerSettings.update` to skip saving if `this.path` already exists by checking `java.nio.file.Files.exists(this.path)`.
- Add the same existence check to `DedicatedServerSettings.save` so `server.properties` is only written when it does not already exist.
- Changes are delivered as a patch file at `patches/server/0313-Prevent-server-properties-from-being-overwritten.patch` that modifies `src/main/java/net/minecraft/server/dedicated/DedicatedServerSettings.java`.
### Testing
- No automated tests were executed for this patch because it is a small, patch-only change intended to alter save behavior.
------
[Codex Task](https://chatgpt.com/codex/tasks/task_e_69798521b7d8832f80d0d7ce7b824450)
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 so admin/customized values are preserved.Description
DedicatedServerSettings.updateto skip saving ifthis.pathalready exists by checkingjava.nio.file.Files.exists(this.path).DedicatedServerSettings.savesoserver.propertiesis only written when it does not already exist.patches/server/0313-Prevent-server-properties-from-being-overwritten.patchthat modifiessrc/main/java/net/minecraft/server/dedicated/DedicatedServerSettings.java.Testing
Codex Task