Adds UUID fetching on player join. See #12
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:
src/main/java/net/knarcraft/stargate
listener
portal
utility
@ -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
|
||||
*
|
||||
|
Reference in New Issue
Block a user