Skip to content

Commit

Permalink
equalsIgnoreCase in /npc owner
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Oct 20, 2021
1 parent 19c07ff commit 21e924f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions main/src/main/java/net/citizensnpcs/commands/NPCCommands.java
Expand Up @@ -1430,12 +1430,14 @@ public void owner(CommandContext args, CommandSender sender, NPC npc) throws Com
Messaging.sendTr(sender, Messages.NPC_OWNER, npc.getName(), ownerTrait.getOwnerId());
return;
}
OfflinePlayer p = Bukkit.getOfflinePlayer(args.getString(1));
OfflinePlayer p;
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();
} else {
uuid = args.getString(1).equals("SERVER") ? null : UUID.fromString(args.getString(1));
uuid = UUID.fromString(args.getString(1));
}
if (ownerTrait.isOwnedBy(uuid))
throw new CommandException(Messages.ALREADY_OWNER, uuid, npc.getName());
Expand Down

0 comments on commit 21e924f

Please sign in to comment.