mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-28 05:35:26 +01:00
Make sync command reload sponge data too - resolves #98
This commit is contained in:
parent
fc4750706b
commit
8795383e7c
@ -366,4 +366,11 @@ public interface LuckPermsPlugin {
|
||||
*/
|
||||
BufferedRequest<Void> getUpdateTaskBuffer();
|
||||
|
||||
/**
|
||||
* Called at the end of the sync task.
|
||||
*/
|
||||
default void onPostUpdate() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -54,6 +54,8 @@ public class UpdateTask implements Runnable {
|
||||
// Refresh all online users.
|
||||
plugin.getUserManager().updateAllUsers();
|
||||
|
||||
plugin.onPostUpdate();
|
||||
|
||||
plugin.getApiProvider().fireEvent(new PostSyncEvent());
|
||||
}
|
||||
}
|
||||
|
@ -62,6 +62,8 @@ import me.lucko.luckperms.sponge.managers.SpongeGroupManager;
|
||||
import me.lucko.luckperms.sponge.managers.SpongeUserManager;
|
||||
import me.lucko.luckperms.sponge.service.LuckPermsService;
|
||||
import me.lucko.luckperms.sponge.service.ServiceCacheHousekeepingTask;
|
||||
import me.lucko.luckperms.sponge.service.base.LPSubjectCollection;
|
||||
import me.lucko.luckperms.sponge.service.persisted.PersistedCollection;
|
||||
import me.lucko.luckperms.sponge.timings.LPTimings;
|
||||
import me.lucko.luckperms.sponge.utils.VersionData;
|
||||
|
||||
@ -305,6 +307,16 @@ public class LPSpongePlugin implements LuckPermsPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostUpdate() {
|
||||
for (LPSubjectCollection collection : service.getCollections().values()) {
|
||||
if (collection instanceof PersistedCollection) {
|
||||
((PersistedCollection) collection).loadAll();
|
||||
}
|
||||
}
|
||||
service.invalidateParentCaches();
|
||||
}
|
||||
|
||||
@SuppressWarnings("ResultOfMethodCallIgnored")
|
||||
@Override
|
||||
public File getMainDir() {
|
||||
|
Loading…
Reference in New Issue
Block a user