Spigot Configuration

Provides the basic infrastructure to load and save the Spigot configuration file, spigot.yml

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2013-07-07 09:32:53 +10:00
parent 6b0bae2fb6
commit cba0d1f1ec
7 changed files with 318 additions and 27 deletions

View File

@@ -945,6 +945,7 @@ public final class CraftServer implements Server {
this.logger.log(Level.WARNING, "Failed to load banned-players.json, " + ex.getMessage());
}
org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot
for (ServerLevel world : this.console.getAllLevels()) {
world.serverLevelData.setDifficulty(config.difficulty);
world.setSpawnSettings(config.spawnMonsters);
@@ -959,11 +960,13 @@ public final class CraftServer implements Server {
}
}
}
world.spigotConfig.init(); // Spigot
}
this.pluginManager.clearPlugins();
this.commandMap.clearCommands();
this.reloadData();
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");

View File

@@ -134,6 +134,14 @@ public class Main {
this.acceptsAll(Main.asList("demo"), "Demo mode");
this.acceptsAll(Main.asList("initSettings"), "Only create configuration files and then exit"); // SPIGOT-5761: Add initSettings option
// Spigot Start
this.acceptsAll(Main.asList("S", "spigot-settings"), "File for spigot settings")
.withRequiredArg()
.ofType(File.class)
.defaultsTo(new File("spigot.yml"))
.describedAs("Yml file");
// Spigot End
}
};