Adds UUID fetching on player join. See

Whenever a player joins, their names will be checked against a map containing all names which need to be migrated to UUID. All portals the player has created which still use the player name will be updated.
This commit is contained in:
2021-11-01 15:13:22 +01:00
parent 91a0316e6e
commit 2a61480684
4 changed files with 168 additions and 36 deletions
src/main/java/net/knarcraft/stargate

@ -43,6 +43,22 @@ public class PortalOwner {
return ownerUUID;
}
/**
* Sets the unique id for a portal owner without one
*
* <p>This method is only meant to be used to set the unique id for an owner without one. If the owner already has
* an unique id, an exception will be thrown.</p>
*
* @param uniqueId <p>The new unique id for the portal owner</p>
*/
public void setUUID(UUID uniqueId) {
if (ownerUUID == null) {
ownerUUID = uniqueId;
} else {
throw new IllegalArgumentException("An existing UUID cannot be overwritten.");
}
}
/**
* Gets the name of this owner
*