Adds tab completion to the "delete public" command

This commit is contained in:
Kristian Knarvik 2021-09-08 15:37:00 +02:00
parent 83c639b7f6
commit e1d1ff83b4

View File

@ -1,17 +1,24 @@
package net.knarcraft.bookswithoutborders.command; package net.knarcraft.bookswithoutborders.command;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import java.util.List;
/** /**
* Command executor for the "delete public" command * Command executor for the "delete public" command
*/ */
public class CommandDeletePublic extends CommandDelete implements CommandExecutor { public class CommandDeletePublic extends CommandDelete implements TabExecutor {
@Override @Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
return deleteBook(sender, args, true); return deleteBook(sender, args, true);
} }
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
return doTabCompletion(sender, args, true);
}
} }