Send a message to the unjailer when they unjail someone.

This commit is contained in:
graywolf336
2014-07-14 21:11:46 -05:00
parent 9e1b75c602
commit 049ea63102
5 changed files with 17 additions and 11 deletions

View File

@ -34,8 +34,7 @@ public class UnJailCommand implements Command {
//Check if the player has offline pending and their remaining time is above 0, if so then
//forceably unjail them
if(pris.isOfflinePending() && pris.getRemainingTime() != 0L) {
jm.getPlugin().getPrisonerManager().forceUnJail(j, j.getCellPrisonerIsIn(pris.getUUID()), p, pris);
sender.sendMessage(jm.getPlugin().getJailIO().getLanguageString(LangString.FORCEUNJAILED, args[0]));
jm.getPlugin().getPrisonerManager().forceUnJail(j, j.getCellPrisonerIsIn(pris.getUUID()), p, pris, sender);
}else {
//The player is not, so we'll set the remaining time to zero and do it when they login next
pris.setRemainingTime(0L);
@ -45,7 +44,7 @@ public class UnJailCommand implements Command {
}else {
//Player is online, so let's try unjailing them
try {
jm.getPlugin().getPrisonerManager().unJail(j, j.getCellPrisonerIsIn(pris.getUUID()), p, pris);
jm.getPlugin().getPrisonerManager().unJail(j, j.getCellPrisonerIsIn(pris.getUUID()), p, pris, sender);
} catch (Exception e) {
sender.sendMessage(ChatColor.RED + e.getMessage());
}

View File

@ -22,8 +22,7 @@ public class UnJailForceCommand implements Command {
public boolean execute(JailManager jm, CommandSender sender, String... args) {
//Check if the player is jailed
if(jm.isPlayerJailedByLastKnownUsername(args[0])) {
jm.getPlugin().getPrisonerManager().forceRelease(jm.getPrisonerByLastKnownName(args[0]));
sender.sendMessage(jm.getPlugin().getJailIO().getLanguageString(LangString.FORCEUNJAILED, args[0]));
jm.getPlugin().getPrisonerManager().forceRelease(jm.getPrisonerByLastKnownName(args[0]), sender);
if(jm.getPlugin().getConfig().getBoolean(Settings.LOGJAILINGTOCONSOLE.getPath())) {
jm.getPlugin().getLogger().info(ChatColor.stripColor(jm.getPlugin().getJailIO().getLanguageString(LangString.BROADCASTUNJAILING, new String[] { args[0], sender.getName() })));