Fixed command recognition

This commit is contained in:
Fuzzlemann 2017-07-26 12:56:01 +02:00
parent 047446bcd6
commit 322b81a28d
4 changed files with 10 additions and 8 deletions

View File

@ -132,7 +132,7 @@ public class AnalyzeCommand extends SubCommand {
sendLink(sender, url);
}
}
sender.sendMessage(Phrase.CMD_FOOTER + "");
sender.sendMessage(Phrase.CMD_FOOTER.toString());
}
@Deprecated // TODO Will be rewritten to the RslPlugin abstractions in the future.

View File

@ -23,7 +23,7 @@ public class ReloadCommand extends SubCommand {
* @param plugin Current instance of Plan
*/
public ReloadCommand(Plan plugin) {
super("reload", CommandType.CONSOLE, Permissions.MANAGE.getPermission(), Phrase.CMD_USG_RELOAD + "");
super("reload", CommandType.CONSOLE, Permissions.MANAGE.getPermission(), Phrase.CMD_USG_RELOAD.toString());
this.plugin = plugin;
}
@ -33,7 +33,7 @@ public class ReloadCommand extends SubCommand {
plugin.onDisable();
plugin.reloadConfig();
plugin.onEnable();
sender.sendMessage(Phrase.RELOAD_COMPLETE + "");
sender.sendMessage(Phrase.RELOAD_COMPLETE.toString());
return true;
}

View File

@ -5,14 +5,15 @@ import com.djrapitops.plugin.command.ISender;
import com.djrapitops.plugin.command.SubCommand;
import com.djrapitops.plugin.task.AbsRunnable;
import com.djrapitops.plugin.utilities.FormattingUtils;
import java.util.Arrays;
import java.util.List;
import main.java.com.djrapitops.plan.Permissions;
import main.java.com.djrapitops.plan.Phrase;
import main.java.com.djrapitops.plan.Plan;
import main.java.com.djrapitops.plan.utilities.Check;
import main.java.com.djrapitops.plan.utilities.MiscUtils;
import java.util.Arrays;
import java.util.List;
/**
* This subcommand is used to search for a user, and to view all matches' data.
*
@ -57,7 +58,7 @@ public class SearchCommand extends SubCommand {
} else {
sender.sendMessage(Phrase.CMD_MATCH + "" + FormattingUtils.collectionToStringNoBrackets(names));
}
sender.sendMessage(Phrase.CMD_FOOTER + "");
sender.sendMessage(Phrase.CMD_FOOTER.toString());
} finally {
this.cancel();
}

View File

@ -49,14 +49,14 @@ public class PlanCommandPreprocessListener implements Listener {
boolean combineCommandAliasesToMainCommand = Settings.COMBINE_COMMAND_ALIASES_TO_MAIN_COMMAND.isTrue();
if (doNotLogUnknownCommands || combineCommandAliasesToMainCommand) {
Command command = plugin.getServer().getPluginCommand(commandName);
Command command = plugin.getServer().getPluginCommand(commandName.substring(1, commandName.length()));
if (command == null) {
if (doNotLogUnknownCommands) {
Log.debug("Ignored command, command is unknown");
return;
}
} else if (combineCommandAliasesToMainCommand) {
commandName = command.getName();
commandName = "/" + command.getName();
}
}
@ -66,6 +66,7 @@ public class PlanCommandPreprocessListener implements Listener {
Log.debug("Ignored command, player had ignore permission.");
return;
}
handler.handleCommand(commandName);
}
}