Clean up the jailstop command, make it tell what all they stopped.

This commit is contained in:
graywolf336 2013-12-28 13:12:45 -06:00
parent b75f12c23c
commit 3ab161cbe8

View File

@ -1,5 +1,6 @@
package com.graywolf336.jail.command.commands;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import com.graywolf336.jail.JailManager;
@ -15,13 +16,17 @@ import com.graywolf336.jail.command.CommandInfo;
usage = "/jailstop"
)
public class JailStopCommand implements Command {
public boolean execute(JailManager jm, CommandSender sender, String... args) {
jm.removeJailCreationPlayer(sender.getName());
jm.removeCellCreationPlayer(sender.getName());
if(jm.isCreatingACell(sender.getName())) {
jm.removeCellCreationPlayer(sender.getName());
sender.sendMessage(ChatColor.RED + "You have stopped creating cells.");
}
if(jm.isCreatingAJail(sender.getName())) {
jm.removeJailCreationPlayer(sender.getName());
sender.sendMessage(ChatColor.RED + "You have stopped creating a jail.");
}
sender.sendMessage("Any creations, jail or cell, have been stopped.");
return true;
}
}