Add set to the jail time command and unit test it.
This commit is contained in:
@ -142,7 +142,7 @@ public class PrisonerManager {
|
||||
* @param player who is the prisoner
|
||||
* @param prisoner data containing everything pertaining to them
|
||||
*/
|
||||
public void jailPrisoner(Jail jail, Cell cell, Player player, Prisoner prisoner) {
|
||||
protected void jailPrisoner(Jail jail, Cell cell, Player player, Prisoner prisoner) {
|
||||
//If they have handcuffs on them, then let's remove them before we continue
|
||||
//this way the handcuff listeners and this aren't battleing each other
|
||||
if(pl.getHandCuffManager().isHandCuffed(player.getUniqueId())) {
|
||||
|
@ -15,7 +15,7 @@ import com.graywolf336.jail.enums.Lang;
|
||||
needsPlayer = false,
|
||||
pattern = "time|t",
|
||||
permission = "jail.command.jailtime",
|
||||
usage = "/jail time [add|remove|show] [name] <time>"
|
||||
usage = "/jail time [add|remove|set|show] [name] <time>"
|
||||
)
|
||||
public class JailTimeCommand implements Command {
|
||||
public boolean execute(JailManager jm, CommandSender sender, String... args) throws Exception {
|
||||
@ -35,6 +35,8 @@ public class JailTimeCommand implements Command {
|
||||
p.addTime(Util.getTime(args[3]));
|
||||
}else if(args[1].equalsIgnoreCase("remove")) {
|
||||
p.subtractTime(Util.getTime(args[3]));
|
||||
}else if(args[1].equalsIgnoreCase("set")) {
|
||||
p.setRemainingTime(Util.getTime(args[3]));
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user