Adds tab completion for the set lore command

This commit is contained in:
Kristian Knarvik 2021-09-08 15:32:19 +02:00
parent 58c8f76984
commit e167f93de0

View File

@ -5,8 +5,8 @@ import net.knarcraft.bookswithoutborders.utility.InventoryHelper;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
@ -18,7 +18,7 @@ import java.util.List;
/**
* Command executor for the set lore command
*/
public class CommandSetLore implements CommandExecutor {
public class CommandSetLore implements TabExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
@ -58,4 +58,11 @@ public class CommandSetLore implements CommandExecutor {
return true;
}
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
//TODO: Figure out if there is a better way to display that an argument is required
List<String> options = new ArrayList<>();
options.add("<new lore>");
return options;
}
}