Add group setdisplayname command (#493)
This commit is contained in:
@@ -288,4 +288,29 @@ public class SpongeGroupManager implements GroupManager, LPSubjectCollection {
|
||||
public void suggestUnload(String identifier) {
|
||||
// noop
|
||||
}
|
||||
|
||||
@Override
|
||||
public Group getByDisplayName(String name) {
|
||||
// try to get an exact match first
|
||||
Group g = getIfLoaded(name);
|
||||
if (g != null) {
|
||||
return g;
|
||||
}
|
||||
|
||||
// then try exact display name matches
|
||||
for (Group group : getAll().values()) {
|
||||
if (group.getDisplayName().isPresent() && group.getDisplayName().get().equals(name)) {
|
||||
return group;
|
||||
}
|
||||
}
|
||||
|
||||
// then try case insensitive name matches
|
||||
for (Group group : getAll().values()) {
|
||||
if (group.getDisplayName().isPresent() && group.getDisplayName().get().equalsIgnoreCase(name)) {
|
||||
return group;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,8 +151,7 @@ public class SpongeGroup extends Group {
|
||||
|
||||
@Override
|
||||
public Optional<String> getFriendlyIdentifier() {
|
||||
String rawDisplayName = parent.getRawDisplayName();
|
||||
return rawDisplayName.equals(getIdentifier()) ? Optional.empty() : Optional.of(rawDisplayName);
|
||||
return parent.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -89,12 +89,6 @@ world-rewrite {
|
||||
# world_the_end="world"
|
||||
}
|
||||
|
||||
# Rewrites group names. The underlying name of the group does not change, just the output in
|
||||
# commands / placeholders / Vault.
|
||||
group-name-rewrite {
|
||||
# default="Member"
|
||||
}
|
||||
|
||||
# Controls how temporary permissions/parents/meta should be accumulated
|
||||
#
|
||||
# The default behaviour is "deny"
|
||||
|
||||
Reference in New Issue
Block a user