Implement not being able to jail people who can't be jailed.

This commit is contained in:
graywolf336
2013-12-24 22:47:17 -06:00
parent 63032ad6cc
commit 38a4a859e4
3 changed files with 11 additions and 1 deletions

View File

@ -93,6 +93,13 @@ public class JailCommand implements Command {
Prisoner pris = new Prisoner(params.player(), params.muted(), time);
Player p = jm.getPlugin().getServer().getPlayer(params.player());
//If the player instance is not null and the player has the permission
//'jail.cantbejailed' then don't allow this to happen
if(p != null && p.hasPermission("jail.cantbejailed")) {
sender.sendMessage(jm.getPlugin().getJailIO().getLanguageString(LangString.CANTBEJAILED));
return true;
}
//call the event
PrisonerJailedEvent event = new PrisonerJailedEvent(j, pris, p, p == null, sender.getName());
jm.getPlugin().getServer().getPluginManager().callEvent(event);