Paper icon indicating copy to clipboard operation
Paper copied to clipboard

Only create paper.yml-README.txt when config conversion happens

Open TetraTheta opened this issue 2 years ago • 4 comments

Currently, Paper always creates paper.yml-README.txt if there is no such file in main directory.

With this PR, Paper will only generate paper.yml-README.txt file config file conversion happens.

If there are any other situation I should check too, let me know.

This PR may resolve #8332 (forgot to mention, thanks for remind me!)

TetraTheta avatar Aug 28 '22 18:08 TetraTheta

But the method I used is very ugly. Since GlobalConfiguration.get().misc was null, I had to use this way. If there is any better way to get the value, please tell me.

Yeah I'm not sure there is really. Unless you moved the whole readme file creation logic until after the global configuration was initialized. I guess you could technically do that, move it to PaperConfigurations#initializeGlobalConfig, but your way is probably cleaner than that.

Machine-Maker avatar Aug 28 '22 20:08 Machine-Maker

Wouldn't it be simpler to only create the file if the newer config files don't exist already?

Astralchroma avatar Aug 29 '22 14:08 Astralchroma

Updated PR to reflect suggestion. I think server admin should manually check config about README file generation, but this new method is cleaner way to check things. No manual value check with plain string key.

TetraTheta avatar Aug 30 '22 06:08 TetraTheta

imho, it literally just needs to create the file when creating a new config folder, nothing more, nothing less; There is literally 0 reasons to have a config for this for any reason, the literal sole intent is to just say "we moved this"

I don't think it's only relevant to those upgrading from new configs, as we see the odd person who installed a new server and is still referring to old documentation from around the web, etc

electronicboy avatar Sep 04 '22 07:09 electronicboy