mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2025-02-05 23:21:22 +01:00
Make Sponge's #getFriendlyIdentifier return usernames of Users and display names of Groups (#412)
This commit is contained in:
parent
3d2115ff3c
commit
5784458d03
@ -153,6 +153,11 @@ public class SubjectProxy implements Subject {
|
||||
return ref.getSubjectIdentifier();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<String> getFriendlyIdentifier() {
|
||||
return getHandle().thenApply(LPSubject::getFriendlyIdentifier).join();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Context> getActiveContexts() {
|
||||
return getHandle().thenApply(handle -> CompatibilityUtil.convertContexts(handle.getActiveContextSet())).join();
|
||||
|
@ -150,7 +150,8 @@ public class SpongeGroup extends Group {
|
||||
|
||||
@Override
|
||||
public Optional<String> getFriendlyIdentifier() {
|
||||
return Optional.of(parent.getFriendlyName());
|
||||
String rawDisplayName = parent.getRawDisplayName();
|
||||
return rawDisplayName.equals(getIdentifier()) ? Optional.empty() : Optional.of(rawDisplayName);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -94,6 +94,11 @@ public class SpongeUser extends User {
|
||||
return plugin.getUuidCache().getExternalUUID(parent.getUuid()).toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<String> getFriendlyIdentifier() {
|
||||
return parent.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<CommandSource> getCommandSource() {
|
||||
final UUID uuid = plugin.getUuidCache().getExternalUUID(parent.getUuid());
|
||||
|
Loading…
Reference in New Issue
Block a user