Skip to content

Commit

Permalink
Add get/set UUID methods in owner
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Apr 13, 2014
1 parent 695a6b1 commit e130ad8
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions src/main/java/net/citizensnpcs/api/trait/trait/Owner.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ public String getOwner() {
return owner;
}

/**
* @return The owner's UUID, or <code>null</code> if the owner is the server
* or a UUID has not been collected for the owner.
*/
public UUID getOwnerId() {
return uuid;
}

/**
* Gets if the given {@link CommandSender} is the owner of an NPC.
*
Expand Down Expand Up @@ -97,8 +105,19 @@ public void setOwner(CommandSender sender) {
* Name of the player to set as owner of an NPC
*/
public void setOwner(String owner) {
this.owner = owner;
this.uuid = null;
setOwner(owner, null);
}

/**
* Sets the owner of an NPC.
* @param owner
* Name of the owner
* @param uuid
* UUID of the owner
*/
public void setOwner(String owner, UUID uuid) {
this.owner = owner;
this.uuid = uuid;
}

@Override
Expand Down

0 comments on commit e130ad8

Please sign in to comment.