Change users being updated async and refactor update task
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package me.lucko.luckperms.runnables;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import me.lucko.luckperms.LuckPermsPlugin;
|
||||
|
||||
@AllArgsConstructor
|
||||
public class UpdateTask implements Runnable {
|
||||
private final LuckPermsPlugin plugin;
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
plugin.getLogger().info("Running update task.");
|
||||
|
||||
// Reload all of the groups
|
||||
plugin.getDatastore().loadAllGroups();
|
||||
String defaultGroup = plugin.getConfiguration().getDefaultGroupName();
|
||||
if (!plugin.getGroupManager().isLoaded(defaultGroup)) {
|
||||
plugin.getDatastore().createAndLoadGroup(defaultGroup);
|
||||
}
|
||||
|
||||
// Refresh all online users.
|
||||
plugin.getUserManager().updateAllUsers();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user