EngineHub / WorldGuard

🛡️ Protect your Minecraft server and lets players claim areas
https://enginehub.org/worldguard/
Other
811 stars 528 forks source link

config.yml written without comments #2078

Open SlimeDog opened 2 months ago

SlimeDog commented 2 months ago

WorldEdit Version

7.3.1-6745

WorldGuard Version

7.0.10-2266

Platform Version

Spigot 1.20.6-4142

Confirmations

Bug Description

On server start-up, plugins/WorldGuard/config.yml is (re)written without comments at top of file. The comments are contained in the defaults/config.yml file in the JAR. The comments are (re)written on Paper 1.20.6, and on both Paper and Spigot with previous versions of WorldGuard.

Expected Behavior

Rewrite file with comments, regardless of platform.

Reproduction Steps

  1. Update to Spigot 1.20.6
  2. Update to WorldGuard build 2266
  3. Start server
  4. Compare files

Optional WorldGuard-Report

No response

Anything Else?

No response

wizjany commented 2 months ago

i don't think we do anything paper-specific here tbh, only way i can see this happening is if spigot ships a broken snakeyaml lib and paper doesn't somehow.

SlimeDog commented 2 months ago

OK, thanks. I'll pursue that line.

SlimeDog commented 2 months ago
$ unzip -l paper-1.20.6-36.jar | grep snakeyaml
        0  05-02-2024 11:29   META-INF/libraries/org/yaml/snakeyaml/
        0  05-02-2024 11:29   META-INF/libraries/org/yaml/snakeyaml/2.2/
   334352  05-02-2024 11:29   META-INF/libraries/org/yaml/snakeyaml/2.2/snakeyaml-2.2.jar
$ unzip -l spigot-1.20.6-4142.jar | grep snakeyaml
   334352  05-03-2024 09:06   META-INF/libraries/snakeyaml-2.2.jar
aurorasmiles commented 1 month ago

This doesn't seem to be a spigot-specific issue, I get the same behaviour on Paper. When the files are initially created they have comments, after you restart your server once the comments are gone.

SlimeDog commented 3 weeks ago

This doesn't seem to be a spigot-specific issue, I get the same behaviour on Paper. When the files are initially created they have comments, after you restart your server once the comments are gone.

Agreed. Paper wasn't available when I originally posted the issue. Changed title to reflect generality.