mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-26 12:46:04 +01:00
/npc owner [name] supported again
This commit is contained in:
parent
4ecf09050a
commit
25f341ef63
@ -1430,7 +1430,13 @@ public class NPCCommands {
|
||||
Messaging.sendTr(sender, Messages.NPC_OWNER, npc.getName(), ownerTrait.getOwnerId());
|
||||
return;
|
||||
}
|
||||
UUID uuid = args.getString(1).equals("SERVER") ? null : UUID.fromString(args.getString(1));
|
||||
OfflinePlayer p = Bukkit.getOfflinePlayer(args.getString(1));
|
||||
UUID uuid;
|
||||
if (p != null) {
|
||||
uuid = p.getUniqueId();
|
||||
} else {
|
||||
uuid = args.getString(1).equals("SERVER") ? null : UUID.fromString(args.getString(1));
|
||||
}
|
||||
if (ownerTrait.isOwnedBy(uuid))
|
||||
throw new CommandException(Messages.ALREADY_OWNER, uuid, npc.getName());
|
||||
ownerTrait.setOwner(uuid);
|
||||
|
Loading…
Reference in New Issue
Block a user