#937 Add option for AuthMe to run in sync

- Create BukkitService#runTaskOptionallyAsync and BukkitService#scheduleSyncTaskFromOptionallyAsyncTask whose behavior depends on a new setting
- Use the new methods where applicable
- Declare events async or sync depending on the new setting
This commit is contained in:
ljacqu
2016-09-18 21:58:14 +02:00
parent ff9f50f63f
commit 4eab258993
20 changed files with 169 additions and 172 deletions
@@ -58,9 +58,10 @@ public class Initializer {
/**
* Loads the plugin's settings.
*
* @return The settings instance, or null if it could not be constructed
* @param authMe the plugin instance
* @return the settings instance, or null if it could not be constructed
*/
public Settings createSettings() throws Exception {
public static Settings createSettings(AuthMe authMe) throws Exception {
File configFile = new File(authMe.getDataFolder(), "config.yml");
PropertyResource resource = new YamlFileResource(configFile);
SettingsMigrationService migrationService = new SettingsMigrationService(authMe.getDataFolder());