EssentialsX

EssentialsX

2M Downloads

Allow setting / removing nick name based on their UUID.

mibby opened this issue ยท 5 comments

commented

Would it be possible to allow nicknaming players via UUID while offline? That way you can have the command /nick {UUID] off run automatically at the end of the month to remove nicknames from players who should no longer have access to nick in the event they changed their minecraft name.

commented

I think this is supposed to already be possible - have you tried it?

commented

Yes, I've tried it @md678685. However it does not seem to work when the player is offline. Only while they are online does it match the UUID to a player.

commented

@md678685 Any possible update on this issue? :(

commented

This can be fixed by trying to call UserMap#getUser(UUID) at the start of this method:

public User getUser(final String name) {
try {
final String sanitizedName = StringUtil.safeString(name);
if (names.containsKey(sanitizedName)) {
final UUID uuid = names.get(sanitizedName);
return getUser(uuid);
}
final File userFile = getUserFileFromString(sanitizedName);
if (userFile.exists()) {
ess.getLogger().info("Importing user " + name + " to usermap.");
User user = new User(new OfflinePlayer(sanitizedName, ess.getServer()), ess);
trackUUID(user.getBase().getUniqueId(), user.getName(), true);
return user;
}
return null;
} catch (UncheckedExecutionException ex) {
return null;
}
}

commented

Closed by #2606 - loop commands (like /nick) can now accept UUIDs as parameters.