#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:
+1
-1
@@ -55,7 +55,7 @@ public class ChangePasswordAdminCommand implements ExecutableCommand {
|
||||
|
||||
// Set the password
|
||||
final String playerNameLowerCase = playerName.toLowerCase();
|
||||
bukkitService.runTaskAsynchronously(new Runnable() {
|
||||
bukkitService.runTaskOptionallyAsync(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
@@ -55,7 +55,7 @@ public class RegisterAdminCommand implements ExecutableCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
bukkitService.runTaskAsynchronously(new Runnable() {
|
||||
bukkitService.runTaskOptionallyAsync(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -80,7 +80,7 @@ public class RegisterAdminCommand implements ExecutableCommand {
|
||||
ConsoleLogger.info(sender.getName() + " registered " + playerName);
|
||||
final Player player = bukkitService.getPlayerExact(playerName);
|
||||
if (player != null) {
|
||||
bukkitService.scheduleSyncDelayedTask(new Runnable() {
|
||||
bukkitService.scheduleSyncTaskFromOptionallyAsyncTask(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
limboCache.restoreData(player);
|
||||
|
||||
@@ -41,7 +41,7 @@ public class SetEmailCommand implements ExecutableCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
bukkitService.runTaskAsynchronously(new Runnable() {
|
||||
bukkitService.runTaskOptionallyAsync(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// Validate the user
|
||||
@@ -68,7 +68,6 @@ public class SetEmailCommand implements ExecutableCommand {
|
||||
|
||||
// Show a status message
|
||||
commandService.send(sender, MessageKey.EMAIL_CHANGED_SUCCESS);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user