mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 21: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) {
|
||||
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();
|
||||
if (cmd == null) {
|
||||
MainUtil.sendMessage(plr, C.DID_YOU_MEAN, "/plot help");
|
||||
}
|
||||
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;
|
||||
|
@ -29,6 +29,7 @@ import java.util.ArrayList;
|
||||
import com.intellectualcrafters.plot.PS;
|
||||
import com.intellectualcrafters.plot.object.PlotPlayer;
|
||||
import com.intellectualcrafters.plot.util.MainUtil;
|
||||
import com.intellectualcrafters.plot.util.StringMan;
|
||||
import com.intellectualcrafters.plot.util.TaskManager;
|
||||
import com.plotsquared.general.commands.CommandDeclaration;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user