Fire PermissionRefreshEvent after the nodes have actually updated

This commit is contained in:
Luck 2016-09-01 13:00:22 +01:00
parent 1a2fa5d8c3
commit 5c760aabd4
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
2 changed files with 4 additions and 5 deletions

View File

@ -106,12 +106,13 @@ public class BukkitUser extends User {
/* Must be called sync, as #recalculatePermissions is an unmodified Bukkit API call that is absolutely not thread safe.
Shouldn't be too taxing on the server. This only gets called when permissions have actually changed,
which is like once per user per login, assuming their permissions don't get modified. */
plugin.doSync(() -> attachment.getPermissible().recalculatePermissions());
plugin.doSync(() -> {
attachment.getPermissible().recalculatePermissions();
plugin.getApiProvider().fireEventAsync(new UserPermissionRefreshEvent(new UserLink(this)));
});
} catch (Exception e) {
e.printStackTrace();
}
plugin.getApiProvider().fireEventAsync(new UserPermissionRefreshEvent(new UserLink(this)));
}
}

View File

@ -43,8 +43,6 @@ class SpongeUser extends User {
@Override
public void refreshPermissions() {
plugin.getApiProvider().fireEventAsync(new UserPermissionRefreshEvent(new UserLink(this)));
// Do nothing. Should be grabbed from PermissionService.
/*
plugin.doSync(() -> {