Properly fixes usage of jail:jail
This commit is contained in:
parent
eb0c3ba46c
commit
b86229dc3c
@ -182,7 +182,10 @@ public class JailMain extends JavaPlugin {
|
||||
sender.sendMessage(Lang.PLUGINNOTLOADED.get());
|
||||
getServer().getConsoleSender().sendMessage(Lang.PLUGINNOTLOADED.get());
|
||||
} else {
|
||||
if (commandLabel.equalsIgnoreCase("jail") || commandLabel.equalsIgnoreCase("j")) {
|
||||
if (commandLabel.equalsIgnoreCase("jail:jail") ||
|
||||
commandLabel.equalsIgnoreCase("jail") ||
|
||||
commandLabel.equalsIgnoreCase("jail:j") ||
|
||||
commandLabel.equalsIgnoreCase("j")) {
|
||||
jh.parseCommand(jailManager, sender, args);
|
||||
} else {
|
||||
cmdHand.handleCommand(jailManager, sender, command.getName().toLowerCase(), args);
|
||||
@ -200,7 +203,10 @@ public class JailMain extends JavaPlugin {
|
||||
} else {
|
||||
debug("Tab Complete Args (" + args.length + ") for '" + commandLabel + "': " + Util.getStringFromArray(", ", args));
|
||||
try {
|
||||
if (commandLabel.equalsIgnoreCase("jail") || commandLabel.equalsIgnoreCase("j")) {
|
||||
if (commandLabel.equalsIgnoreCase("jail:jail") ||
|
||||
commandLabel.equalsIgnoreCase("jail") ||
|
||||
commandLabel.equalsIgnoreCase("jail:j") ||
|
||||
commandLabel.equalsIgnoreCase("j")) {
|
||||
return jh.parseTabComplete(jailManager, sender, args);
|
||||
} else {
|
||||
return cmdHand.parseTabComplete(jailManager, sender, command.getName().toLowerCase(), args);
|
||||
|
@ -65,7 +65,7 @@ public class JailHandler {
|
||||
for (Command c : commands.values()) {
|
||||
CommandInfo i = c.getClass().getAnnotation(CommandInfo.class);
|
||||
//Skip the jail subcommand instance, since it is unique
|
||||
if (i.pattern().equalsIgnoreCase("jail|j")) {
|
||||
if (i.pattern().equalsIgnoreCase("jail:jail|jail|jail:j|j")) {
|
||||
hasJailPermission = sender.hasPermission(i.permission());
|
||||
continue;
|
||||
}
|
||||
@ -101,9 +101,9 @@ public class JailHandler {
|
||||
CommandInfo i = c.getClass().getAnnotation(CommandInfo.class);
|
||||
|
||||
//since the pattern won't ever match the jail plugin
|
||||
//we can skip it but first we need to see if they have
|
||||
//we can skip it, but first we need to see if they have
|
||||
//permission to do the jailing
|
||||
if (i.pattern().equalsIgnoreCase("jail|j")) {
|
||||
if (i.pattern().equalsIgnoreCase("jail:jail|jail|jail:j|j")) {
|
||||
hasJailPermission = sender.hasPermission(i.permission());
|
||||
continue;
|
||||
}
|
||||
|
@ -65,7 +65,6 @@ public class JailCommand implements Command {
|
||||
if (!arguments.contains("-p")) {
|
||||
arguments.add(0, "-p");
|
||||
}
|
||||
arguments.removeIf(String::isEmpty);
|
||||
|
||||
Jailing params;
|
||||
|
||||
@ -146,6 +145,9 @@ public class JailCommand implements Command {
|
||||
String jailName;
|
||||
if (!params.isJail()) {
|
||||
String dJail = jm.getPlugin().getConfig().getString(Settings.DEFAULTJAIL.getPath());
|
||||
if (dJail == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (dJail.equalsIgnoreCase("nearest")) {
|
||||
jailName = jm.getNearestJail(sender).getName();
|
||||
|
Loading…
Reference in New Issue
Block a user