MCPcopy Create free account
hub / github.com/PaperMC/Paper / init

Method init

paper-server/src/main/java/org/spigotmc/SpigotConfig.java:54–74  ·  view source on GitHub ↗
(File configFile)

Source from the content-addressed store, hash-verified

52 /*========================================================================*/
53
54 public static void init(File configFile) {
55 SpigotConfig.CONFIG_FILE = configFile;
56 SpigotConfig.config = new YamlConfiguration();
57 try {
58 SpigotConfig.config.load(SpigotConfig.CONFIG_FILE);
59 } catch (IOException ignored) {
60 } catch (InvalidConfigurationException ex) {
61 Bukkit.getLogger().log(Level.SEVERE, "Could not load spigot.yml, please correct your syntax errors", ex);
62 throw Throwables.propagate(ex);
63 }
64
65 SpigotConfig.config.options().header(SpigotConfig.HEADER);
66 SpigotConfig.config.options().copyDefaults(true);
67
68 SpigotConfig.commands = new HashMap<>();
69 SpigotConfig.commands.put("spigot", new SpigotCommand("spigot"));
70
71 SpigotConfig.version = SpigotConfig.getInt("config-version", 13);
72 SpigotConfig.set("config-version", 13);
73 SpigotConfig.readConfig(SpigotConfig.class, null);
74 }
75
76 public static void registerCommands() {
77 for (Map.Entry<String, Command> entry : SpigotConfig.commands.entrySet()) {

Callers

nothing calls this directly

Calls 10

getLoggerMethod · 0.95
getIntMethod · 0.95
setMethod · 0.95
readConfigMethod · 0.95
loadMethod · 0.65
optionsMethod · 0.65
putMethod · 0.65
logMethod · 0.45
headerMethod · 0.45
copyDefaultsMethod · 0.45

Tested by

no test coverage detected