From 539ebeb3268dc614191c0b500180ccda3eeab401 Mon Sep 17 00:00:00 2001 From: graywolf336 Date: Sat, 28 Dec 2013 13:17:31 -0600 Subject: [PATCH] Don't allow jailing of players who are already jailed. --- .../com/graywolf336/jail/command/commands/JailCommand.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/graywolf336/jail/command/commands/JailCommand.java b/src/main/java/com/graywolf336/jail/command/commands/JailCommand.java index 755caca..1620949 100644 --- a/src/main/java/com/graywolf336/jail/command/commands/JailCommand.java +++ b/src/main/java/com/graywolf336/jail/command/commands/JailCommand.java @@ -35,6 +35,7 @@ public class JailCommand implements Command { * * - If there are any jails. * - If the command can be parsed correctly. + * - If the player is already jailed. * - If the given time can be parsed correctly, defaults to what is defined in the config * - If the jail is reasonable or not, else sets the one from the config * - If the cell is not empty then checks to be sure that cell exists @@ -56,6 +57,12 @@ public class JailCommand implements Command { return true; } + //Check if the given player is already jailed or not + if(jm.isPlayerJailed(params.player())) { + sender.sendMessage(ChatColor.RED + "That player is already jailed."); + return true; + } + //Try to parse the time, if they give us nothing in the time parameter then we get the default time //from the config and if that isn't there then we default to thirty minutes. Long time = 10L;