(File configFile)
| 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()) { |
nothing calls this directly
no test coverage detected