Skip to content

Commit c28c654

Browse files
authored
Fix LuckPerms sync load for online players (#6563)
Fixes #6519
1 parent 26a5447 commit c28c654

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎Essentials/src/main/java/com/earth2me/essentials/perm/impl/LuckPermsHandler.java‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,13 @@ public List<String> getGroups() {
9393

9494
@Override
9595
public boolean isOfflinePermissionSet(UUID uuid, String node) {
96-
final net.luckperms.api.model.user.User user = this.luckPerms.getUserManager().loadUser(uuid).join();
96+
// Try to get the user from LuckPerms' cache first to avoid blocking the main
97+
// thread with a database lookup. In the context of a player join (e.g.
98+
// PlayerServerFullCheckEvent), the user should already be loaded.
99+
net.luckperms.api.model.user.User user = this.luckPerms.getUserManager().getUser(uuid);
100+
if (user == null) {
101+
user = this.luckPerms.getUserManager().loadUser(uuid).join();
102+
}
97103
if (user == null) {
98104
return false;
99105
}

0 commit comments

Comments
 (0)