Fix tab completion

This commit is contained in:
thislooksfun
2020-03-19 17:23:11 -05:00
parent 8a70f97445
commit a22bcb1c2a
2 changed files with 8 additions and 4 deletions

View File

@ -654,6 +654,8 @@ public class WorldEditPlugin extends JavaPlugin { //implements TabCompleter
int firstSpace = buffer.indexOf(' ');
if (firstSpace < 0) return;
String label = buffer.substring(0, firstSpace);
// Strip leading slash, if present.
label = label.startsWith("/") ? label.substring(1) : label;
final Optional<org.enginehub.piston.Command> command
= WorldEdit.getInstance().getPlatformManager().getPlatformCommandManager().getCommandManager().getCommand(label);
if (!command.isPresent()) return;