mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 23:26:45 +01:00
Fixed command recommendations
This commit is contained in:
parent
de52b70ad3
commit
f1d76beb3a
@ -335,13 +335,13 @@ public class MainCommand extends CommandManager<PlotPlayer> {
|
|||||||
if (cmd == null) {
|
if (cmd == null) {
|
||||||
MainUtil.sendMessage(plr, C.NOT_VALID_SUBCOMMAND);
|
MainUtil.sendMessage(plr, C.NOT_VALID_SUBCOMMAND);
|
||||||
{
|
{
|
||||||
ArrayList<Command<PlotPlayer>> cmds = getCommands();
|
List<Command<PlotPlayer>> cmds = getCommands(null, plr);
|
||||||
cmd = new StringComparison<>(label, cmds).getMatchObject();
|
cmd = new StringComparison<>(label, cmds).getMatchObject();
|
||||||
if (cmd == null) {
|
if (cmd == null) {
|
||||||
MainUtil.sendMessage(plr, C.DID_YOU_MEAN, "/plot help");
|
MainUtil.sendMessage(plr, C.DID_YOU_MEAN, "/plot help");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
MainUtil.sendMessage(plr, C.DID_YOU_MEAN, cmd.getUsage().replaceAll("\\{label\\}", label));
|
MainUtil.sendMessage(plr, C.DID_YOU_MEAN, cmd.getUsage().replaceAll("\\{label\\}", parts[0]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return CommandHandlingOutput.NOT_FOUND;
|
return CommandHandlingOutput.NOT_FOUND;
|
||||||
|
@ -29,6 +29,7 @@ import java.util.ArrayList;
|
|||||||
import com.intellectualcrafters.plot.PS;
|
import com.intellectualcrafters.plot.PS;
|
||||||
import com.intellectualcrafters.plot.object.PlotPlayer;
|
import com.intellectualcrafters.plot.object.PlotPlayer;
|
||||||
import com.intellectualcrafters.plot.util.MainUtil;
|
import com.intellectualcrafters.plot.util.MainUtil;
|
||||||
|
import com.intellectualcrafters.plot.util.StringMan;
|
||||||
import com.intellectualcrafters.plot.util.TaskManager;
|
import com.intellectualcrafters.plot.util.TaskManager;
|
||||||
import com.plotsquared.general.commands.CommandDeclaration;
|
import com.plotsquared.general.commands.CommandDeclaration;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user