Skip to content

Commit

Permalink
fixed a command
Browse files Browse the repository at this point in the history
  • Loading branch information
dmccoystephenson committed Jun 7, 2020
1 parent a85c39c commit 3586c6f
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions src/factionsystem/Commands/KickCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,26 @@ public static boolean kickPlayer(CommandSender sender, String[] args, ArrayList<
owner = true;
if (faction.isMember(args[1])) {
if (!(args[1].equalsIgnoreCase(player.getName()))) {
faction.removeMember(args[1]);
try {
sendAllPlayersInFactionMessage(faction, ChatColor.RED + player.getName() + " has been kicked from " + faction.getName());
} catch (Exception ignored) {
if (!(args[1].equalsIgnoreCase(faction.getOwner()))) {
faction.removeMember(args[1]);
try {
sendAllPlayersInFactionMessage(faction, ChatColor.RED + player.getName() + " has been kicked from " + faction.getName());
} catch (Exception ignored) {

}
try {
Player target = Bukkit.getServer().getPlayer(args[1]);
target.sendMessage(ChatColor.RED + "You have been kicked from your faction by " + player.getName() + ".");
} catch (Exception ignored) {
}
try {
Player target = Bukkit.getServer().getPlayer(args[1]);
target.sendMessage(ChatColor.RED + "You have been kicked from your faction by " + player.getName() + ".");
} catch (Exception ignored) {

}
return true;
}
else {
player.sendMessage(ChatColor.RED + "You can't kick the owner.");
return false;
}
return true;

}
else {
player.sendMessage(ChatColor.RED + "You can't kick yourself.");
Expand Down

0 comments on commit 3586c6f

Please sign in to comment.