|
6 | 6 | import org.bukkit.command.CommandSender; |
7 | 7 | import org.jetbrains.annotations.NotNull; |
8 | 8 |
|
9 | | -public class ServerHelperCommand implements CommandExecutor |
10 | | -{ |
11 | | - final String permission = "serverhelper.reload"; |
| 9 | +public class ServerHelperCommand implements CommandExecutor { |
| 10 | + final String permission = "serverhelper.reload"; |
12 | 11 |
|
13 | | - // TODO: Create a debug "toolchain" which includes config reloading and GC, not limited to players (while |
14 | | - // retaining the current command structure as the primary structure). Ideally a root command with subcommands. |
15 | | - @Override |
16 | | - public boolean onCommand(CommandSender sender, @NotNull Command cmd, @NotNull String label, String[] args) |
17 | | - { |
18 | | - if (sender.hasPermission("serverhelper.main")) |
19 | | - { |
20 | | - if (args.length == 0) |
21 | | - { |
22 | | - sender.sendMessage("§aServerHelper is a plugin made for debugging and administration of this " + |
23 | | - "Minecraft server. You can view the source code at " + |
24 | | - "https://github.com/CyberFlameGO/ServerHelper"); |
25 | | - if (sender.hasPermission(permission)) |
26 | | - { |
27 | | - sender.sendMessage("§eSub-command syntax: §6/serverhelper [subcommand]\n" + |
28 | | - "§3Subcommands: §6reload §7- §2Reloads the plugin configuration."); |
29 | | - } |
30 | | - } |
31 | | - else |
32 | | - { |
33 | | - if (args[0].equals("reload") && sender.hasPermission(permission)) |
34 | | - { |
35 | | - ServerHelperPlugin.getInstance().reloadConfig(); |
36 | | - sender.sendMessage("§ePlugin configuration has been §2reloaded§c!"); |
37 | | - } |
38 | | - else |
39 | | - { |
40 | | - sender.sendMessage("§cUnrecognized parameters. Type §6/serverhelper §cto view the " + |
41 | | - "sub-command syntax and applicable arguments."); |
42 | | - } |
43 | | - } |
44 | | - return true; |
45 | | - } |
46 | | - else return false; |
47 | | - } |
| 12 | + // TODO: Create a debug "toolchain" which includes config reloading and GC, not limited to players |
| 13 | + // (while |
| 14 | + // retaining the current command structure as the primary structure). Ideally a root command with |
| 15 | + // subcommands. |
| 16 | + @Override |
| 17 | + public boolean onCommand( |
| 18 | + CommandSender sender, @NotNull Command cmd, @NotNull String label, String[] args) { |
| 19 | + if (sender.hasPermission("serverhelper.main")) { |
| 20 | + if (args.length == 0) { |
| 21 | + sender.sendMessage( |
| 22 | + "§aServerHelper is a plugin made for debugging and administration of this " |
| 23 | + + "Minecraft server. You can view the source code at " |
| 24 | + + "https://github.com/CyberFlameGO/ServerHelper"); |
| 25 | + if (sender.hasPermission(permission)) { |
| 26 | + sender.sendMessage( |
| 27 | + "§eSub-command syntax: §6/serverhelper [subcommand]\n" |
| 28 | + + "§3Subcommands: §6reload §7- §2Reloads the plugin configuration."); |
| 29 | + } |
| 30 | + } else { |
| 31 | + if (args[0].equals("reload") && sender.hasPermission(permission)) { |
| 32 | + ServerHelperPlugin.getInstance().reloadConfig(); |
| 33 | + sender.sendMessage("§ePlugin configuration has been §2reloaded§c!"); |
| 34 | + } else { |
| 35 | + sender.sendMessage( |
| 36 | + "§cUnrecognized parameters. Type §6/serverhelper §cto view the " |
| 37 | + + "sub-command syntax and applicable arguments."); |
| 38 | + } |
| 39 | + } |
| 40 | + return true; |
| 41 | + } else return false; |
| 42 | + } |
48 | 43 | } |
0 commit comments