mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-02-18 13:21:45 +01:00
equalsIgnoreCase in /npc owner
This commit is contained in:
parent
19c07ff1f5
commit
21e924f04c
@ -1430,12 +1430,14 @@ public class NPCCommands {
|
|||||||
Messaging.sendTr(sender, Messages.NPC_OWNER, npc.getName(), ownerTrait.getOwnerId());
|
Messaging.sendTr(sender, Messages.NPC_OWNER, npc.getName(), ownerTrait.getOwnerId());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
OfflinePlayer p = Bukkit.getOfflinePlayer(args.getString(1));
|
OfflinePlayer p;
|
||||||
UUID uuid;
|
UUID uuid;
|
||||||
if (p != null) {
|
if (args.getString(1).equalsIgnoreCase("SERVER")) {
|
||||||
|
uuid = null;
|
||||||
|
} else if ((p = Bukkit.getOfflinePlayer(args.getString(1))) != null) {
|
||||||
uuid = p.getUniqueId();
|
uuid = p.getUniqueId();
|
||||||
} else {
|
} else {
|
||||||
uuid = args.getString(1).equals("SERVER") ? null : UUID.fromString(args.getString(1));
|
uuid = UUID.fromString(args.getString(1));
|
||||||
}
|
}
|
||||||
if (ownerTrait.isOwnedBy(uuid))
|
if (ownerTrait.isOwnedBy(uuid))
|
||||||
throw new CommandException(Messages.ALREADY_OWNER, uuid, npc.getName());
|
throw new CommandException(Messages.ALREADY_OWNER, uuid, npc.getName());
|
||||||
|
Loading…
Reference in New Issue
Block a user