Skip to content

Commit

Permalink
Merge pull request #509 from DansPlugins/transfer-fix
Browse files Browse the repository at this point in the history
added a check to the transfer command
  • Loading branch information
dmccoystephenson authored Jul 26, 2020
2 parents 81dec72 + b265e00 commit ffe0624
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/factionsystem/Commands/TransferCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ public boolean transferOwnership(CommandSender sender, String[] args) {
UUID playerUUID = findUUIDBasedOnPlayerName(args[1]);
if (faction.isMember(playerUUID)) {

if (playerUUID.equals(player.getUniqueId())) {
player.sendMessage(ChatColor.RED + "You can't transfer ownership of your faction to yourself!");
return false;
}

if (faction.isOfficer(playerUUID)) {
faction.removeOfficer(playerUUID);
}
Expand Down

0 comments on commit ffe0624

Please sign in to comment.