Fix writing headers and update to be more papery (#12459)
This commit is contained in:
@@ -101,6 +101,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
The world configuration options have been moved inside
|
||||
their respective world folder. The files are named %s
|
||||
|
||||
File Reference: https://docs.papermc.io/paper/reference/global-configuration/
|
||||
Docs: https://docs.papermc.io/
|
||||
Discord: https://discord.gg/papermc
|
||||
Website: https://papermc.io/""", WORLD_CONFIG_FILE_NAME);
|
||||
@@ -116,6 +117,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
Configuration options here apply to all worlds, unless you specify overrides inside
|
||||
the world-specific config file inside each world folder.
|
||||
|
||||
File Reference: https://docs.papermc.io/paper/reference/world-configuration/
|
||||
Docs: https://docs.papermc.io/
|
||||
Discord: https://discord.gg/papermc
|
||||
Website: https://papermc.io/""";
|
||||
@@ -124,6 +126,8 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
||||
This is a world configuration file for Paper.
|
||||
This file may start empty but can be filled with settings to override ones in the %s/%s
|
||||
|
||||
For more information, see https://docs.papermc.io/paper/reference/configuration/#per-world-configuration
|
||||
|
||||
World: %s (%s)""",
|
||||
PaperConfigurations.CONFIG_DIR,
|
||||
PaperConfigurations.WORLD_DEFAULTS_CONFIG_FILE_NAME,
|
||||
|
||||
@@ -432,7 +432,9 @@ public final class CraftServer implements Server {
|
||||
|
||||
this.configuration = YamlConfiguration.loadConfiguration(this.getConfigFile());
|
||||
this.configuration.options().copyDefaults(true);
|
||||
this.configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(this.getClass().getClassLoader().getResourceAsStream("configurations/bukkit.yml"), StandardCharsets.UTF_8)));
|
||||
YamlConfiguration configurationDefaults = YamlConfiguration.loadConfiguration(new InputStreamReader(this.getClass().getClassLoader().getResourceAsStream("configurations/bukkit.yml"), StandardCharsets.UTF_8));
|
||||
this.configuration.setDefaults(configurationDefaults);
|
||||
this.configuration.options().setHeader(configurationDefaults.options().getHeader());
|
||||
ConfigurationSection legacyAlias = null;
|
||||
if (!this.configuration.isString("aliases")) {
|
||||
legacyAlias = this.configuration.getConfigurationSection("aliases");
|
||||
@@ -449,6 +451,7 @@ public final class CraftServer implements Server {
|
||||
if (this.commandsConfiguration.contains("aliases")) commandsDefaults.set("aliases", null);
|
||||
this.commandsConfiguration.setDefaults(commandsDefaults);
|
||||
// Paper end - don't enforce icanhasbukkit default if alias block exists
|
||||
this.commandsConfiguration.options().setHeader(commandsDefaults.options().getHeader());
|
||||
this.saveCommandsConfig();
|
||||
|
||||
// Migrate aliases from old file and add previously implicit $1- to pass all arguments
|
||||
|
||||
@@ -32,11 +32,10 @@ public class HelpYamlReader {
|
||||
this.helpYaml = YamlConfiguration.loadConfiguration(helpYamlFile);
|
||||
this.helpYaml.options().copyDefaults(true);
|
||||
this.helpYaml.setDefaults(defaultConfig);
|
||||
this.helpYaml.options().setHeader(defaultConfig.options().getHeader());
|
||||
|
||||
try {
|
||||
if (!helpYamlFile.exists()) {
|
||||
this.helpYaml.save(helpYamlFile);
|
||||
}
|
||||
this.helpYaml.save(helpYamlFile);
|
||||
} catch (IOException ex) {
|
||||
server.getLogger().log(Level.SEVERE, "Could not save " + helpYamlFile, ex);
|
||||
}
|
||||
|
||||
@@ -33,17 +33,17 @@ public class SpigotConfig {
|
||||
|
||||
private static File CONFIG_FILE;
|
||||
private static final String HEADER = """
|
||||
This is the main configuration file for Spigot.
|
||||
This is the Spigot configuration file for Paper.
|
||||
As you can see, there's tons to configure. Some options may impact gameplay, so use
|
||||
with caution, and make sure you know what each option does before configuring.
|
||||
For a reference for any variable inside this file, check out the Spigot wiki at
|
||||
http://www.spigotmc.org/wiki/spigot-configuration/
|
||||
|
||||
If you need help with the configuration or have any questions related to Spigot,
|
||||
join us at the Discord or drop by our forums and leave a post.
|
||||
If you need help with the configuration or have any questions related to Paper,
|
||||
join us in our Discord or check the docs page.
|
||||
|
||||
Discord: https://www.spigotmc.org/go/discord
|
||||
Forums: http://www.spigotmc.org/
|
||||
File Reference: https://docs.papermc.io/paper/reference/spigot-configuration/
|
||||
Docs: https://docs.papermc.io/
|
||||
Discord: https://discord.gg/papermc
|
||||
Website: https://papermc.io/
|
||||
""";
|
||||
/*========================================================================*/
|
||||
public static YamlConfiguration config;
|
||||
|
||||
Reference in New Issue
Block a user