diff --git a/README.md b/README.md index 139ea82a..38b664ac 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ -![https://s3.postimg.cc/dikyxlz5v/Sub_Banner.png](https://s3.postimg.cc/dikyxlz5v/Sub_Banner.png)
-SubServers 2 is a rewrite of SubServers, the Server Management Platform.   [![Build Status](https://src.me1312.net/jenkins/job/SubServers%20Platform/badge/icon)](https://src.me1312.net/jenkins/job/SubServers%20Platform/)
+# ![https://s3.postimg.cc/dikyxlz5v/Sub_Banner.png](https://s3.postimg.cc/dikyxlz5v/Sub_Banner.png) +[![Build Status](https://src.me1312.net/jenkins/job/SubServers%20Platform/badge/icon)](https://src.me1312.net/jenkins/job/SubServers%20Platform/) +[![Release Verison](https://img.shields.io/github/release/ME1312/SubServers-2/all.svg)](https://github.com/ME1312/SubServers-2/releases) [![Snapshot Verison](https://img.shields.io/badge/dynamic/xml.svg?label=snapshot&url=https%3A%2F%2Fsrc.me1312.net%2Fmaven%2Fnet%2FME1312%2FSubServers%2FSubServers.Bungee%2Fmaven-metadata.xml&query=%2F%2Fversioning%2Frelease&colorB=blue)](https://src.me1312.net/jenkins/job/SubServers%20Platform/)

+SubServers 2 is a rewrite of SubServers, the Server Management Platform.
> [https://www.spigotmc.org/resources/subservers-bungee.11264/](https://www.spigotmc.org/resources/subservers-bungee.11264/)
> [https://www.spigotmc.org/resources/subservers-host.38833/](https://www.spigotmc.org/resources/subservers-host.38833/)
> [https://www.spigotmc.org/resources/subservers-sync.46124/](https://www.spigotmc.org/resources/subservers-sync.46124/)
@@ -10,10 +12,10 @@ SubServers 2 is a rewrite of SubServers, the Server Management Platform.   These are some quick links for common resources of SubServers 2. ### How to Install -[https://github.com/ME1312/SubServers-2/wiki/Install](https://github.com/ME1312/SubServers-2/wiki/Install) +> [https://github.com/ME1312/SubServers-2/wiki/Install](https://github.com/ME1312/SubServers-2/wiki/Install) ### Snapshot Downloads -[https://src.me1312.net/jenkins/job/SubServers Platform](https://src.me1312.net/jenkins/job/SubServers%20Platform) +> [https://src.me1312.net/jenkins/job/SubServers Platform](https://src.me1312.net/jenkins/job/SubServers%20Platform) ### Javadocs for Developers > [https://src.me1312.net/jenkins/job/SubServers Platform/javadoc/SubServers.Bungee/](https://src.me1312.net/jenkins/job/SubServers%20Platform/javadoc/SubServers.Bungee/)
diff --git a/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/SubCommand.java b/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/SubCommand.java index 92def903..8e1607c1 100644 --- a/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/SubCommand.java +++ b/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/SubCommand.java @@ -11,6 +11,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; +import org.bukkit.command.ConsoleCommandSender; import org.bukkit.entity.Player; import java.io.BufferedReader; @@ -33,10 +34,10 @@ public boolean onCommand(CommandSender sender, Command command, String label, St label = "/" + label; if (plugin.subdata == null) { new IllegalStateException("SubData is not connected").printStackTrace(); - return false; + if (!(sender instanceof ConsoleCommandSender)) sender.sendMessage(ChatColor.RED + "An exception has occurred while running this command"); } else if (plugin.lang == null) { new IllegalStateException("There are no lang options available at this time").printStackTrace(); - return false; + if (!(sender instanceof ConsoleCommandSender)) sender.sendMessage(ChatColor.RED + "An exception has occurred while running this command"); } else { if (sender.hasPermission("subservers.command")) { if (args.length > 0) { @@ -460,8 +461,8 @@ public boolean onCommand(CommandSender sender, Command command, String label, St } else { sender.sendMessage(plugin.api.getLang("SubServers", "Command.Generic.Invalid-Permission").replace("$str$", "subservers.command")); } - return true; } + return true; } private String[] printHelp(String label) { diff --git a/SubServers.Client/Bukkit/src/plugin.yml b/SubServers.Client/Bukkit/src/plugin.yml index 7ee4ddfb..69c5eec7 100644 --- a/SubServers.Client/Bukkit/src/plugin.yml +++ b/SubServers.Client/Bukkit/src/plugin.yml @@ -7,13 +7,13 @@ website: 'https://github.com/ME1312/SubServers-2' commands: subservers: description: 'The SubServers Command' - usage: 'An exception may have occurred while running this command' + usage: '/subservers help' subserver: description: 'The SubServers Command' - usage: 'An exception may have occurred while running this command' + usage: '/subserver help' sub: description: 'The SubServers Command' - usage: 'An exception may have occurred while running this command' + usage: '/sub help' permissions: subservers.*: description: 'Grants Access to to Everything in SubServers.Client' diff --git a/SubServers.Client/Sponge/src/net/ME1312/SubServers/Client/Sponge/SubCommand.java b/SubServers.Client/Sponge/src/net/ME1312/SubServers/Client/Sponge/SubCommand.java index 92b90b41..bbebeec4 100644 --- a/SubServers.Client/Sponge/src/net/ME1312/SubServers/Client/Sponge/SubCommand.java +++ b/SubServers.Client/Sponge/src/net/ME1312/SubServers/Client/Sponge/SubCommand.java @@ -100,13 +100,11 @@ public CommandSpec spec() { .build(); } - private boolean canRun(CommandSource sender) { + private boolean canRun(CommandSource sender) throws CommandException { if (plugin.subdata == null) { - new IllegalStateException("SubData is not connected").printStackTrace(); - return false; + throw new CommandException(Text.builder("An exception has occurred while running this command").color(TextColors.RED).build(), new IllegalStateException("SubData is not connected"), false); } else if (plugin.lang == null) { - new IllegalStateException("There are no lang options available at this time").printStackTrace(); - return false; + throw new CommandException(Text.builder("An exception has occurred while running this command").color(TextColors.RED).build(), new IllegalStateException("There are no lang options available at this time"), false); } else { return sender.hasPermission("subservers.command"); }