mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-28 12:07:35 +01:00
Registered BungeeCord tab completion
This commit is contained in:
parent
12fa5cf942
commit
8c7f4f44af
@ -23,8 +23,9 @@ import com.djrapitops.plugin.task.RunnableFactory;
|
||||
import net.md_5.bungee.api.CommandSender;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
import net.md_5.bungee.api.plugin.Command;
|
||||
import net.md_5.bungee.api.plugin.TabExecutor;
|
||||
|
||||
public class BungeeCommand extends Command {
|
||||
public class BungeeCommand extends Command implements TabExecutor {
|
||||
|
||||
private final RunnableFactory runnableFactory;
|
||||
private final Subcommand command;
|
||||
@ -53,4 +54,13 @@ public class BungeeCommand extends Command {
|
||||
}
|
||||
}).runTaskAsynchronously();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<String> onTabComplete(CommandSender sender, String[] args) {
|
||||
if (sender instanceof ProxiedPlayer) {
|
||||
return command.getArgumentResolver().apply(new BungeePlayerCMDSender((ProxiedPlayer) sender), new Arguments(args));
|
||||
} else {
|
||||
return command.getArgumentResolver().apply(new BungeeCMDSender(sender), new Arguments(args));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user