mirror of
https://github.com/TotalFreedomMC/TFGuilds.git
synced 2025-01-03 13:38:19 +00:00
check if target is player
This commit is contained in:
parent
6479bbc76b
commit
592dafb83f
1 changed files with 7 additions and 0 deletions
|
@ -49,6 +49,12 @@ public class GuildKickCommand extends GBase implements CommandExecutor
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (target == player)
|
||||||
|
{
|
||||||
|
sender.sendMessage(ChatColor.RED + "You may not kick yourself.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
List<String> players = plugin.guilds.getStringList("guilds." + guild + ".members");
|
List<String> players = plugin.guilds.getStringList("guilds." + guild + ".members");
|
||||||
players.remove(target.getName());
|
players.remove(target.getName());
|
||||||
plugin.guilds.set("guilds." + guild + ".members", players);
|
plugin.guilds.set("guilds." + guild + ".members", players);
|
||||||
|
@ -61,6 +67,7 @@ public class GuildKickCommand extends GBase implements CommandExecutor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sender.sendMessage(ChatColor.GREEN + "Successfully kicked " + target.getName() + " from the guild");
|
sender.sendMessage(ChatColor.GREEN + "Successfully kicked " + target.getName() + " from the guild");
|
||||||
|
target.sendMessage(ChatColor.RED + "You have been kicked from guild " + guild);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue