mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2025-01-19 14:51:38 +01:00
Attempt to parse uuid from username string in Vault hook
This commit is contained in:
parent
58ab3c325c
commit
759ec5d499
@ -40,6 +40,7 @@ import me.lucko.luckperms.common.model.Group;
|
||||
import me.lucko.luckperms.common.model.PermissionHolder;
|
||||
import me.lucko.luckperms.common.model.User;
|
||||
import me.lucko.luckperms.common.node.factory.NodeFactory;
|
||||
import me.lucko.luckperms.common.utils.Uuids;
|
||||
import me.lucko.luckperms.common.verbose.event.MetaCheckEvent;
|
||||
import me.lucko.luckperms.common.verbose.event.PermissionCheckEvent;
|
||||
|
||||
@ -95,6 +96,12 @@ public class VaultPermissionHook extends AbstractVaultPermission {
|
||||
return onlinePlayer.getUniqueId();
|
||||
}
|
||||
|
||||
// account for plugins that for some reason think it's valid to pass the uuid as a string.
|
||||
UUID uuid = Uuids.parse(player);
|
||||
if (uuid != null) {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
// are we on the main thread?
|
||||
if (!this.plugin.getBootstrap().isServerStarting() && Bukkit.isPrimaryThread() && !this.plugin.getConfiguration().get(ConfigKeys.VAULT_UNSAFE_LOOKUPS)) {
|
||||
throw new RuntimeException(
|
||||
@ -109,7 +116,7 @@ public class VaultPermissionHook extends AbstractVaultPermission {
|
||||
}
|
||||
|
||||
// lookup a username from the database
|
||||
UUID uuid = this.plugin.getStorage().getPlayerUuid(player.toLowerCase()).join();
|
||||
uuid = this.plugin.getStorage().getPlayerUuid(player.toLowerCase()).join();
|
||||
if (uuid == null) {
|
||||
uuid = this.plugin.getBootstrap().lookupUuid(player).orElse(null);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user