From d6ad4df991e4713846812ffb526fc1681f53597f Mon Sep 17 00:00:00 2001 From: graywolf336 Date: Wed, 22 Jan 2014 17:48:32 -0600 Subject: [PATCH] Log the unjailing to console if we have that enabled. --- .../com/graywolf336/jail/command/commands/UnjailCommand.java | 5 +++++ src/main/java/com/graywolf336/jail/enums/LangString.java | 2 ++ src/main/resources/en.yml | 1 + 3 files changed, 8 insertions(+) diff --git a/src/main/java/com/graywolf336/jail/command/commands/UnjailCommand.java b/src/main/java/com/graywolf336/jail/command/commands/UnjailCommand.java index dd33a98..c29f6a4 100644 --- a/src/main/java/com/graywolf336/jail/command/commands/UnjailCommand.java +++ b/src/main/java/com/graywolf336/jail/command/commands/UnjailCommand.java @@ -9,6 +9,7 @@ import com.graywolf336.jail.beans.Jail; import com.graywolf336.jail.command.Command; import com.graywolf336.jail.command.CommandInfo; import com.graywolf336.jail.enums.LangString; +import com.graywolf336.jail.enums.Settings; @CommandInfo( maxArgs = 1, @@ -40,6 +41,10 @@ public class UnjailCommand implements Command { sender.sendMessage(ChatColor.RED + e.getMessage()); } } + + if(jm.getPlugin().getConfig().getBoolean(Settings.LOGJAILING.getPath())) { + jm.getPlugin().getLogger().info(jm.getPlugin().getJailIO().getLanguageString(LangString.BROADCASTUNJAILING, new String[] { args[0], sender.getName() })); + } }else { //The player is not currently jailed sender.sendMessage(jm.getPlugin().getJailIO().getLanguageString(LangString.NOTJAILED, args[0])); diff --git a/src/main/java/com/graywolf336/jail/enums/LangString.java b/src/main/java/com/graywolf336/jail/enums/LangString.java index b2140b0..fa8b72e 100644 --- a/src/main/java/com/graywolf336/jail/enums/LangString.java +++ b/src/main/java/com/graywolf336/jail/enums/LangString.java @@ -28,6 +28,8 @@ public enum LangString { BROADCASTMESSAGEFOREVER ("jailing"), /** The message sent when we broadcast/log the message for any time above -1. */ BROADCASTMESSAGEFORMINUTES ("jailing"), + /** The message sent to the broadcast/log the unjailing of someone. */ + BROADCASTUNJAILING ("jailing"), /** The message sent to the sender when trying to jail someone and a plugin cancels it but doesn't leave a message why. */ CANCELLEDBYANOTHERPLUGIN ("jailing"), /** The message sent when trying to jail someone who can't be jailed by permission. */ diff --git a/src/main/resources/en.yml b/src/main/resources/en.yml index 6f5f36a..3407ebb 100644 --- a/src/main/resources/en.yml +++ b/src/main/resources/en.yml @@ -26,6 +26,7 @@ language: alreadyjailed: '&cThat player is already jailed.' broadcastmessageforever: '&9%0% has been jailed forever.' broadcastmessageforminutes: '&9%0% has been jailed for %1% minutes.' + broadcastunjailing: '&9%0% has been unjailed by %1%.' cancelledbyanotherplugin: '&cJailing %0% was cancelled by another plugin and they did not leave you a message.' cantbejailed: '&cThat player can not be jailed.' cellnotempty: '&cThe destination cell, %0%, already has a prisoner in it.'