mirror of
https://github.com/PaperMC/Paper.git
synced 2025-05-19 13:40:24 -07:00
Fix writing headers and update to be more papery (#12459)
This commit is contained in:
parent
04b91129a5
commit
def0532ffc
@ -101,6 +101,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
|||||||
The world configuration options have been moved inside
|
The world configuration options have been moved inside
|
||||||
their respective world folder. The files are named %s
|
their respective world folder. The files are named %s
|
||||||
|
|
||||||
|
File Reference: https://docs.papermc.io/paper/reference/global-configuration/
|
||||||
Docs: https://docs.papermc.io/
|
Docs: https://docs.papermc.io/
|
||||||
Discord: https://discord.gg/papermc
|
Discord: https://discord.gg/papermc
|
||||||
Website: https://papermc.io/""", WORLD_CONFIG_FILE_NAME);
|
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
|
Configuration options here apply to all worlds, unless you specify overrides inside
|
||||||
the world-specific config file inside each world folder.
|
the world-specific config file inside each world folder.
|
||||||
|
|
||||||
|
File Reference: https://docs.papermc.io/paper/reference/world-configuration/
|
||||||
Docs: https://docs.papermc.io/
|
Docs: https://docs.papermc.io/
|
||||||
Discord: https://discord.gg/papermc
|
Discord: https://discord.gg/papermc
|
||||||
Website: https://papermc.io/""";
|
Website: https://papermc.io/""";
|
||||||
@ -124,6 +126,8 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
|
|||||||
This is a world configuration file for Paper.
|
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
|
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)""",
|
World: %s (%s)""",
|
||||||
PaperConfigurations.CONFIG_DIR,
|
PaperConfigurations.CONFIG_DIR,
|
||||||
PaperConfigurations.WORLD_DEFAULTS_CONFIG_FILE_NAME,
|
PaperConfigurations.WORLD_DEFAULTS_CONFIG_FILE_NAME,
|
||||||
|
@ -432,7 +432,9 @@ public final class CraftServer implements Server {
|
|||||||
|
|
||||||
this.configuration = YamlConfiguration.loadConfiguration(this.getConfigFile());
|
this.configuration = YamlConfiguration.loadConfiguration(this.getConfigFile());
|
||||||
this.configuration.options().copyDefaults(true);
|
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;
|
ConfigurationSection legacyAlias = null;
|
||||||
if (!this.configuration.isString("aliases")) {
|
if (!this.configuration.isString("aliases")) {
|
||||||
legacyAlias = this.configuration.getConfigurationSection("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);
|
if (this.commandsConfiguration.contains("aliases")) commandsDefaults.set("aliases", null);
|
||||||
this.commandsConfiguration.setDefaults(commandsDefaults);
|
this.commandsConfiguration.setDefaults(commandsDefaults);
|
||||||
// Paper end - don't enforce icanhasbukkit default if alias block exists
|
// Paper end - don't enforce icanhasbukkit default if alias block exists
|
||||||
|
this.commandsConfiguration.options().setHeader(commandsDefaults.options().getHeader());
|
||||||
this.saveCommandsConfig();
|
this.saveCommandsConfig();
|
||||||
|
|
||||||
// Migrate aliases from old file and add previously implicit $1- to pass all arguments
|
// 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 = YamlConfiguration.loadConfiguration(helpYamlFile);
|
||||||
this.helpYaml.options().copyDefaults(true);
|
this.helpYaml.options().copyDefaults(true);
|
||||||
this.helpYaml.setDefaults(defaultConfig);
|
this.helpYaml.setDefaults(defaultConfig);
|
||||||
|
this.helpYaml.options().setHeader(defaultConfig.options().getHeader());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (!helpYamlFile.exists()) {
|
|
||||||
this.helpYaml.save(helpYamlFile);
|
this.helpYaml.save(helpYamlFile);
|
||||||
}
|
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
server.getLogger().log(Level.SEVERE, "Could not save " + helpYamlFile, 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 File CONFIG_FILE;
|
||||||
private static final String HEADER = """
|
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
|
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.
|
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,
|
If you need help with the configuration or have any questions related to Paper,
|
||||||
join us at the Discord or drop by our forums and leave a post.
|
join us in our Discord or check the docs page.
|
||||||
|
|
||||||
Discord: https://www.spigotmc.org/go/discord
|
File Reference: https://docs.papermc.io/paper/reference/spigot-configuration/
|
||||||
Forums: http://www.spigotmc.org/
|
Docs: https://docs.papermc.io/
|
||||||
|
Discord: https://discord.gg/papermc
|
||||||
|
Website: https://papermc.io/
|
||||||
""";
|
""";
|
||||||
/*========================================================================*/
|
/*========================================================================*/
|
||||||
public static YamlConfiguration config;
|
public static YamlConfiguration config;
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
# This is the main configuration file for Bukkit.
|
# This is the Bukkit configuration file in Paper.
|
||||||
# As you can see, there's actually not that much to configure without any plugins.
|
# As you can see, there's actually not that much to configure without any plugins.
|
||||||
# For a reference for any variable inside this file, check out the Bukkit Wiki at
|
|
||||||
# https://www.spigotmc.org/go/bukkit-yml
|
|
||||||
#
|
#
|
||||||
# If you need help on this file, feel free to join us on Discord or leave a message
|
# If you need help with the configuration or have any questions related to Paper,
|
||||||
# on the forums asking for advice.
|
# join us in our Discord or check the docs page.
|
||||||
#
|
#
|
||||||
# Discord: https://www.spigotmc.org/go/discord
|
# File Reference: https://docs.papermc.io/paper/reference/bukkit-configuration/
|
||||||
# Forums: https://www.spigotmc.org/
|
# Docs: https://docs.papermc.io/
|
||||||
# Bug tracker: https://www.spigotmc.org/go/bugs
|
# Discord: https://discord.gg/papermc
|
||||||
|
# Website: https://papermc.io/
|
||||||
|
|
||||||
settings:
|
settings:
|
||||||
allow-end: true
|
allow-end: true
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
# This is the commands configuration file for Bukkit.
|
# This is the Bukkit commands configuration file for Paper.
|
||||||
# For documentation on how to make use of this file, check out the Bukkit Wiki at
|
|
||||||
# https://www.spigotmc.org/go/commands-yml
|
|
||||||
#
|
#
|
||||||
# If you need help on this file, feel free to join us on Discord or leave a message
|
# If you need help with the configuration or have any questions related to Paper,
|
||||||
# on the forums asking for advice.
|
# join us in our Discord or check the docs page.
|
||||||
#
|
#
|
||||||
# Discord: https://www.spigotmc.org/go/discord
|
# File Reference: https://docs.papermc.io/paper/reference/bukkit-commands-configuration/
|
||||||
# Forums: https://www.spigotmc.org/
|
# Docs: https://docs.papermc.io/
|
||||||
# Bug tracker: https://www.spigotmc.org/go/bugs
|
# Discord: https://discord.gg/papermc
|
||||||
|
# Website: https://papermc.io/
|
||||||
|
|
||||||
command-block-overrides: []
|
command-block-overrides: []
|
||||||
ignore-vanilla-permissions: false
|
ignore-vanilla-permissions: false
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# This is the help configuration file for Bukkit.
|
# This is the Bukkit help configuration file for Paper.
|
||||||
#
|
#
|
||||||
# By default you do not need to modify this file. Help topics for all plugin commands are automatically provided by
|
# By default you do not need to modify this file. Help topics for all plugin commands are automatically provided by
|
||||||
# or extracted from your installed plugins. You only need to modify this file if you wish to add new help pages to
|
# or extracted from your installed plugins. You only need to modify this file if you wish to add new help pages to
|
||||||
@ -53,3 +53,10 @@
|
|||||||
# - PluginNameOne
|
# - PluginNameOne
|
||||||
# - PluginNameTwo
|
# - PluginNameTwo
|
||||||
# - PluginNameThree
|
# - PluginNameThree
|
||||||
|
#
|
||||||
|
# If you need help with the configuration or have any questions related to Paper,
|
||||||
|
# join us in our Discord or check the docs page.
|
||||||
|
#
|
||||||
|
# Docs: https://docs.papermc.io/
|
||||||
|
# Discord: https://discord.gg/papermc
|
||||||
|
# Website: https://papermc.io/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user