| 5 | import org.bukkit.command.CommandSender; |
| 6 | |
| 7 | public class StopCommand extends VanillaCommand { |
| 8 | public StopCommand() { |
| 9 | super("stop"); |
| 10 | this.description = "Stops the server"; |
| 11 | this.usageMessage = "/stop"; |
| 12 | this.setPermission("bukkit.command.stop"); |
| 13 | } |
| 14 | |
| 15 | @Override |
| 16 | public boolean execute(CommandSender sender, String currentAlias, String[] args) { |
| 17 | if (!testPermission(sender)) return true; |
| 18 | |
| 19 | Command.broadcastCommandMessage(sender, "Stopping the server.."); |
| 20 | Bukkit.shutdown(); |
| 21 | |
| 22 | return true; |
| 23 | } |
| 24 | |
| 25 | @Override |
| 26 | public boolean matches(String input) { |
| 27 | return input.startsWith("stop"); |
| 28 | } |
| 29 | } |
nothing calls this directly
no outgoing calls
no test coverage detected