Add option to use the servers uuid cache/lookup facility (#354)
This commit is contained in:
@@ -510,6 +510,17 @@ public class LPBukkitPlugin extends JavaPlugin implements LuckPermsPlugin {
|
||||
return getServer().getPlayer(uuidCache.getExternalUUID(user.getUuid()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<UUID> lookupUuid(String username) {
|
||||
try {
|
||||
//noinspection deprecation
|
||||
return Optional.ofNullable(getServer().getOfflinePlayer(username)).flatMap(p -> Optional.ofNullable(p.getUniqueId()));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Optional.empty();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Contexts getContextForUser(User user) {
|
||||
Player player = getPlayer(user);
|
||||
|
||||
@@ -66,6 +66,10 @@ apply-global-world-groups: true
|
||||
# forwarding.
|
||||
use-server-uuids: true
|
||||
|
||||
# If the servers own UUID cache/lookup facility should be used when there is no record for a player
|
||||
# in the LuckPerms cache.
|
||||
use-server-uuid-cache: false
|
||||
|
||||
# If the plugin should send log notifications to users whenever permissions are modified.
|
||||
log-notify: true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user