mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-10-31 07:51:05 +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();
|
return ref.getSubjectIdentifier();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Optional<String> getFriendlyIdentifier() {
|
||||||
|
return getHandle().thenApply(LPSubject::getFriendlyIdentifier).join();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<Context> getActiveContexts() {
|
public Set<Context> getActiveContexts() {
|
||||||
return getHandle().thenApply(handle -> CompatibilityUtil.convertContexts(handle.getActiveContextSet())).join();
|
return getHandle().thenApply(handle -> CompatibilityUtil.convertContexts(handle.getActiveContextSet())).join();
|
||||||
|
@ -150,7 +150,8 @@ public class SpongeGroup extends Group {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<String> getFriendlyIdentifier() {
|
public Optional<String> getFriendlyIdentifier() {
|
||||||
return Optional.of(parent.getFriendlyName());
|
String rawDisplayName = parent.getRawDisplayName();
|
||||||
|
return rawDisplayName.equals(getIdentifier()) ? Optional.empty() : Optional.of(rawDisplayName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -94,6 +94,11 @@ public class SpongeUser extends User {
|
|||||||
return plugin.getUuidCache().getExternalUUID(parent.getUuid()).toString();
|
return plugin.getUuidCache().getExternalUUID(parent.getUuid()).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Optional<String> getFriendlyIdentifier() {
|
||||||
|
return parent.getName();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<CommandSource> getCommandSource() {
|
public Optional<CommandSource> getCommandSource() {
|
||||||
final UUID uuid = plugin.getUuidCache().getExternalUUID(parent.getUuid());
|
final UUID uuid = plugin.getUuidCache().getExternalUUID(parent.getUuid());
|
||||||
|
Loading…
Reference in New Issue
Block a user