mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-29 12:37:40 +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);
|
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.
|
@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
|
* @param plugin Current instance of Plan
|
||||||
*/
|
*/
|
||||||
public ReloadCommand(Plan plugin) {
|
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;
|
this.plugin = plugin;
|
||||||
}
|
}
|
||||||
@ -33,7 +33,7 @@ public class ReloadCommand extends SubCommand {
|
|||||||
plugin.onDisable();
|
plugin.onDisable();
|
||||||
plugin.reloadConfig();
|
plugin.reloadConfig();
|
||||||
plugin.onEnable();
|
plugin.onEnable();
|
||||||
sender.sendMessage(Phrase.RELOAD_COMPLETE + "");
|
sender.sendMessage(Phrase.RELOAD_COMPLETE.toString());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,14 +5,15 @@ import com.djrapitops.plugin.command.ISender;
|
|||||||
import com.djrapitops.plugin.command.SubCommand;
|
import com.djrapitops.plugin.command.SubCommand;
|
||||||
import com.djrapitops.plugin.task.AbsRunnable;
|
import com.djrapitops.plugin.task.AbsRunnable;
|
||||||
import com.djrapitops.plugin.utilities.FormattingUtils;
|
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.Permissions;
|
||||||
import main.java.com.djrapitops.plan.Phrase;
|
import main.java.com.djrapitops.plan.Phrase;
|
||||||
import main.java.com.djrapitops.plan.Plan;
|
import main.java.com.djrapitops.plan.Plan;
|
||||||
import main.java.com.djrapitops.plan.utilities.Check;
|
import main.java.com.djrapitops.plan.utilities.Check;
|
||||||
import main.java.com.djrapitops.plan.utilities.MiscUtils;
|
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.
|
* 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 {
|
} else {
|
||||||
sender.sendMessage(Phrase.CMD_MATCH + "" + FormattingUtils.collectionToStringNoBrackets(names));
|
sender.sendMessage(Phrase.CMD_MATCH + "" + FormattingUtils.collectionToStringNoBrackets(names));
|
||||||
}
|
}
|
||||||
sender.sendMessage(Phrase.CMD_FOOTER + "");
|
sender.sendMessage(Phrase.CMD_FOOTER.toString());
|
||||||
} finally {
|
} finally {
|
||||||
this.cancel();
|
this.cancel();
|
||||||
}
|
}
|
||||||
|
@ -49,14 +49,14 @@ public class PlanCommandPreprocessListener implements Listener {
|
|||||||
boolean combineCommandAliasesToMainCommand = Settings.COMBINE_COMMAND_ALIASES_TO_MAIN_COMMAND.isTrue();
|
boolean combineCommandAliasesToMainCommand = Settings.COMBINE_COMMAND_ALIASES_TO_MAIN_COMMAND.isTrue();
|
||||||
|
|
||||||
if (doNotLogUnknownCommands || combineCommandAliasesToMainCommand) {
|
if (doNotLogUnknownCommands || combineCommandAliasesToMainCommand) {
|
||||||
Command command = plugin.getServer().getPluginCommand(commandName);
|
Command command = plugin.getServer().getPluginCommand(commandName.substring(1, commandName.length()));
|
||||||
if (command == null) {
|
if (command == null) {
|
||||||
if (doNotLogUnknownCommands) {
|
if (doNotLogUnknownCommands) {
|
||||||
Log.debug("Ignored command, command is unknown");
|
Log.debug("Ignored command, command is unknown");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (combineCommandAliasesToMainCommand) {
|
} 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.");
|
Log.debug("Ignored command, player had ignore permission.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
handler.handleCommand(commandName);
|
handler.handleCommand(commandName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user