Fire PermissionRefreshEvent after the nodes have actually updated

This commit is contained in:
Luck committed 2016-09-01 13:00:22 +01:00
1 parent 1a2fa5d8c3
commit 5c760aabd4
2 files changed
+4 -5

No files matched your search

@@ -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)));
}
}