Prevent server.properties from being overwritten #6

Merged
NotAlexNoyle merged 1 commits from codex/patch-purpur-server-to-protect-server.properties-u9g89e into ver/1.19.4 2026-03-16 06:18:57 -04:00
NotAlexNoyle commented 2026-03-16 06:10:31 -04:00 (Migrated from github.com)

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

### 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)
Sign in to join this conversation.