Ensure the server (and its fork components) never writes or overwrites server.properties so startup/shutdown only read the existing file and never persist changes.
Centralize the protection at the dedicated server settings layer which is used by Bukkit/Spigot/Paper/Purpur property flows.
Description
Added a new patch file patches/server/0313-Prevent-server-properties-from-being-written.patch that targets src/main/java/net/minecraft/server/dedicated/DedicatedServerSettings.java.
Changed DedicatedServerSettings#forceSave() to be an intentional no-op so shutdown/startup calls do not write server.properties.
Updated DedicatedServerSettings#update(UnaryOperator<DedicatedServerProperties>) to apply runtime property changes in-memory only and remove the .store(this.source) call to prevent any code path from persisting to disk.
Committed the patch to the repository (created patch and amended trailing whitespace fixes).
Testing
Ran git show --check --stat HEAD which displayed the new patch commit successfully. (succeeded)
Attempted to run JAVA_HOME=/root/.local/share/mise/installs/java/21.0.2 ./gradlew applyPatches to apply/validate patches, but the Gradle invocation failed to resolve the org.gradle.toolchains.foojay-resolver-convention:0.4.0 plugin due to repository access (HTTP 403), so applyPatches could not be executed in this environment. (failed to run)
### Motivation
- Ensure the server (and its fork components) never writes or overwrites `server.properties` so startup/shutdown only read the existing file and never persist changes.
- Centralize the protection at the dedicated server settings layer which is used by Bukkit/Spigot/Paper/Purpur property flows.
### Description
- Added a new patch file `patches/server/0313-Prevent-server-properties-from-being-written.patch` that targets `src/main/java/net/minecraft/server/dedicated/DedicatedServerSettings.java`.
- Changed `DedicatedServerSettings#forceSave()` to be an intentional no-op so shutdown/startup calls do not write `server.properties`.
- Updated `DedicatedServerSettings#update(UnaryOperator<DedicatedServerProperties>)` to apply runtime property changes in-memory only and remove the `.store(this.source)` call to prevent any code path from persisting to disk.
- Committed the patch to the repository (created patch and amended trailing whitespace fixes).
### Testing
- Ran `git show --check --stat HEAD` which displayed the new patch commit successfully. (succeeded)
- Attempted to run `JAVA_HOME=/root/.local/share/mise/installs/java/21.0.2 ./gradlew applyPatches` to apply/validate patches, but the Gradle invocation failed to resolve the `org.gradle.toolchains.foojay-resolver-convention:0.4.0` plugin due to repository access (HTTP 403), so `applyPatches` could not be executed in this environment. (failed to run)
------
[Codex Task](https://chatgpt.com/codex/tasks/task_e_69b7d483e1dc832fa6ef7dc54d2fffac)
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.propertiesso startup/shutdown only read the existing file and never persist changes.Description
patches/server/0313-Prevent-server-properties-from-being-written.patchthat targetssrc/main/java/net/minecraft/server/dedicated/DedicatedServerSettings.java.DedicatedServerSettings#forceSave()to be an intentional no-op so shutdown/startup calls do not writeserver.properties.DedicatedServerSettings#update(UnaryOperator<DedicatedServerProperties>)to apply runtime property changes in-memory only and remove the.store(this.source)call to prevent any code path from persisting to disk.Testing
git show --check --stat HEADwhich displayed the new patch commit successfully. (succeeded)JAVA_HOME=/root/.local/share/mise/installs/java/21.0.2 ./gradlew applyPatchesto apply/validate patches, but the Gradle invocation failed to resolve theorg.gradle.toolchains.foojay-resolver-convention:0.4.0plugin due to repository access (HTTP 403), soapplyPatchescould not be executed in this environment. (failed to run)Codex Task