mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-28 03:57:33 +01:00
Fixed command recognition
This commit is contained in:
parent
047446bcd6
commit
322b81a28d
@ -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.
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user