Fix /claiminfo displaying public and wilderness owner incorrectly.

This commit is contained in:
bloodshot 2019-07-28 10:27:25 -04:00
parent 347419a7fd
commit af5fade803
2 changed files with 12 additions and 5 deletions

View File

@ -262,25 +262,25 @@ public void execute(CommandSender src, String[] args) {
for (UUID uuid : accessorList) {
final String userName = PlayerUtil.getInstance().getUserName(uuid);
if (userName != null) {
accessors += PlayerUtil.getInstance().getUserName(uuid) + " ";
accessors += userName + " ";
}
}
for (UUID uuid : builderList) {
final String userName = PlayerUtil.getInstance().getUserName(uuid);
if (userName != null) {
builders += PlayerUtil.getInstance().getUserName(uuid) + " ";
builders += userName + " ";
}
}
for (UUID uuid : containerList) {
final String userName = PlayerUtil.getInstance().getUserName(uuid);
if (userName != null) {
containers += PlayerUtil.getInstance().getUserName(uuid) + " ";
containers += userName + " ";
}
}
for (UUID uuid : managerList) {
final String userName = PlayerUtil.getInstance().getUserName(uuid);
if (userName != null) {
managers += PlayerUtil.getInstance().getUserName(uuid) + " ";
managers += userName + " ";
}
}
@ -361,7 +361,7 @@ public void execute(CommandSender src, String[] args) {
Component ownerLine = TextComponent.builder("")
.append("Owner", TextColor.YELLOW)
.append(" : ")
.append(ownerName != null && !claim.isAdminClaim() ? ownerName : "administrator", TextColor.GOLD).build();
.append(ownerName != null && !claim.isAdminClaim() && !claim.isWilderness() ? ownerName : "administrator", TextColor.GOLD).build();
Component adminShowText = TextComponent.empty();
Component basicShowText = TextComponent.empty();
Component subdivisionShowText = TextComponent.empty();

View File

@ -99,6 +99,13 @@ public String lookupPlayerName(String uuid) {
@Nullable
public String getUserName(UUID uuid) {
if (uuid == GriefDefenderPlugin.PUBLIC_UUID) {
return "public";
}
if (uuid == GriefDefenderPlugin.ADMIN_USER_UUID || uuid == GriefDefenderPlugin.WORLD_USER_UUID) {
return "administrator";
}
final GDPermissionUser user = PermissionHolderCache.getInstance().getOrCreateUser(uuid);
if (user == null) {
return null;