#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:
@@ -67,7 +67,8 @@ public class AsyncRegister implements AsynchronousProcess {
|
||||
private BukkitService bukkitService;
|
||||
|
||||
|
||||
AsyncRegister() { }
|
||||
AsyncRegister() {
|
||||
}
|
||||
|
||||
private boolean preRegisterCheck(Player player, String password) {
|
||||
final String name = player.getName().toLowerCase();
|
||||
@@ -171,12 +172,7 @@ public class AsyncRegister implements AsynchronousProcess {
|
||||
}
|
||||
|
||||
if (!service.getProperty(RegistrationSettings.FORCE_LOGIN_AFTER_REGISTER) && autoLogin) {
|
||||
bukkitService.runTaskAsynchronously(new Runnable(){
|
||||
@Override
|
||||
public void run() {
|
||||
asynchronousLogin.login(player, "dontneed", true);
|
||||
}
|
||||
});
|
||||
bukkitService.runTaskOptionallyAsync(() -> asynchronousLogin.login(player, "dontneed", true));
|
||||
}
|
||||
syncProcessManager.processSyncPasswordRegister(player);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user