From f1d76beb3aeafc13811a5861d113891b48dea1bc Mon Sep 17 00:00:00 2001 From: boy0001 Date: Sat, 1 Aug 2015 03:07:49 +1000 Subject: [PATCH] Fixed command recommendations --- .../com/intellectualcrafters/plot/commands/MainCommand.java | 4 ++-- .../java/com/intellectualcrafters/plot/commands/plugin.java | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java b/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java index 00520dcd3..a51c8f274 100644 --- a/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java +++ b/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java @@ -335,13 +335,13 @@ public class MainCommand extends CommandManager { if (cmd == null) { MainUtil.sendMessage(plr, C.NOT_VALID_SUBCOMMAND); { - ArrayList> cmds = getCommands(); + List> 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; diff --git a/src/main/java/com/intellectualcrafters/plot/commands/plugin.java b/src/main/java/com/intellectualcrafters/plot/commands/plugin.java index 036c8c9d9..fd6843d75 100644 --- a/src/main/java/com/intellectualcrafters/plot/commands/plugin.java +++ b/src/main/java/com/intellectualcrafters/plot/commands/plugin.java @@ -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;