| 10 | import org.jetbrains.annotations.NotNull; |
| 11 | |
| 12 | public class ReloadCommand extends BukkitCommand { |
| 13 | public ReloadCommand(@NotNull String name) { |
| 14 | super(name); |
| 15 | this.description = "Reloads the server configuration and plugins"; |
| 16 | this.usageMessage = "/reload"; |
| 17 | this.setPermission("bukkit.command.reload"); |
| 18 | this.setAliases(Arrays.asList("rl")); |
| 19 | } |
| 20 | |
| 21 | @Override |
| 22 | public boolean execute(@NotNull CommandSender sender, @NotNull String currentAlias, @NotNull String[] args) { |
| 23 | if (!testPermission(sender)) return true; |
| 24 | |
| 25 | Command.broadcastCommandMessage(sender, ChatColor.RED + "Please note that this command is not supported and may cause issues when using some plugins."); |
| 26 | Command.broadcastCommandMessage(sender, ChatColor.RED + "If you encounter any issues please use the /stop command to restart your server."); |
| 27 | Bukkit.reload(); |
| 28 | Command.broadcastCommandMessage(sender, ChatColor.GREEN + "Reload complete."); |
| 29 | |
| 30 | return true; |
| 31 | } |
| 32 | |
| 33 | @NotNull |
| 34 | @Override |
| 35 | public List<String> tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException { |
| 36 | return Collections.emptyList(); |
| 37 | } |
| 38 | } |
nothing calls this directly
no outgoing calls
no test coverage detected