mirror of
https://github.com/ME1312/SubServers-2.git
synced 2024-11-22 18:26:06 +01:00
Update error messages
This commit is contained in:
parent
ed1b45fccb
commit
86fbb2c2b6
10
README.md
10
README.md
@ -1,5 +1,7 @@
|
|||||||
![https://s3.postimg.cc/dikyxlz5v/Sub_Banner.png](https://s3.postimg.cc/dikyxlz5v/Sub_Banner.png)<br>
|
# ![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/)<br>
|
[![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/)<br><br>
|
||||||
|
SubServers 2 is a rewrite of SubServers, the Server Management Platform.<br>
|
||||||
> [https://www.spigotmc.org/resources/subservers-bungee.11264/](https://www.spigotmc.org/resources/subservers-bungee.11264/)<br>
|
> [https://www.spigotmc.org/resources/subservers-bungee.11264/](https://www.spigotmc.org/resources/subservers-bungee.11264/)<br>
|
||||||
> [https://www.spigotmc.org/resources/subservers-host.38833/](https://www.spigotmc.org/resources/subservers-host.38833/)<br>
|
> [https://www.spigotmc.org/resources/subservers-host.38833/](https://www.spigotmc.org/resources/subservers-host.38833/)<br>
|
||||||
> [https://www.spigotmc.org/resources/subservers-sync.46124/](https://www.spigotmc.org/resources/subservers-sync.46124/)<br>
|
> [https://www.spigotmc.org/resources/subservers-sync.46124/](https://www.spigotmc.org/resources/subservers-sync.46124/)<br>
|
||||||
@ -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.
|
These are some quick links for common resources of SubServers 2.
|
||||||
|
|
||||||
### How to Install
|
### 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
|
### 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
|
### 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/)<br>
|
> [https://src.me1312.net/jenkins/job/SubServers Platform/javadoc/SubServers.Bungee/](https://src.me1312.net/jenkins/job/SubServers%20Platform/javadoc/SubServers.Bungee/)<br>
|
||||||
|
@ -11,6 +11,7 @@ import org.bukkit.ChatColor;
|
|||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.command.ConsoleCommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
@ -33,10 +34,10 @@ public final class SubCommand implements CommandExecutor {
|
|||||||
label = "/" + label;
|
label = "/" + label;
|
||||||
if (plugin.subdata == null) {
|
if (plugin.subdata == null) {
|
||||||
new IllegalStateException("SubData is not connected").printStackTrace();
|
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) {
|
} else if (plugin.lang == null) {
|
||||||
new IllegalStateException("There are no lang options available at this time").printStackTrace();
|
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 {
|
} else {
|
||||||
if (sender.hasPermission("subservers.command")) {
|
if (sender.hasPermission("subservers.command")) {
|
||||||
if (args.length > 0) {
|
if (args.length > 0) {
|
||||||
@ -460,8 +461,8 @@ public final class SubCommand implements CommandExecutor {
|
|||||||
} else {
|
} else {
|
||||||
sender.sendMessage(plugin.api.getLang("SubServers", "Command.Generic.Invalid-Permission").replace("$str$", "subservers.command"));
|
sender.sendMessage(plugin.api.getLang("SubServers", "Command.Generic.Invalid-Permission").replace("$str$", "subservers.command"));
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String[] printHelp(String label) {
|
private String[] printHelp(String label) {
|
||||||
|
@ -7,13 +7,13 @@ website: 'https://github.com/ME1312/SubServers-2'
|
|||||||
commands:
|
commands:
|
||||||
subservers:
|
subservers:
|
||||||
description: 'The SubServers Command'
|
description: 'The SubServers Command'
|
||||||
usage: 'An exception may have occurred while running this command'
|
usage: '/subservers help'
|
||||||
subserver:
|
subserver:
|
||||||
description: 'The SubServers Command'
|
description: 'The SubServers Command'
|
||||||
usage: 'An exception may have occurred while running this command'
|
usage: '/subserver help'
|
||||||
sub:
|
sub:
|
||||||
description: 'The SubServers Command'
|
description: 'The SubServers Command'
|
||||||
usage: 'An exception may have occurred while running this command'
|
usage: '/sub help'
|
||||||
permissions:
|
permissions:
|
||||||
subservers.*:
|
subservers.*:
|
||||||
description: 'Grants Access to to Everything in SubServers.Client'
|
description: 'Grants Access to to Everything in SubServers.Client'
|
||||||
|
@ -100,13 +100,11 @@ public final class SubCommand implements CommandExecutor {
|
|||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean canRun(CommandSource sender) {
|
private boolean canRun(CommandSource sender) throws CommandException {
|
||||||
if (plugin.subdata == null) {
|
if (plugin.subdata == null) {
|
||||||
new IllegalStateException("SubData is not connected").printStackTrace();
|
throw new CommandException(Text.builder("An exception has occurred while running this command").color(TextColors.RED).build(), new IllegalStateException("SubData is not connected"), false);
|
||||||
return false;
|
|
||||||
} else if (plugin.lang == null) {
|
} else if (plugin.lang == null) {
|
||||||
new IllegalStateException("There are no lang options available at this time").printStackTrace();
|
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);
|
||||||
return false;
|
|
||||||
} else {
|
} else {
|
||||||
return sender.hasPermission("subservers.command");
|
return sender.hasPermission("subservers.command");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user