From e167f93de0fb16cd5323578cbf5cd6ff07b8ce4c Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Wed, 8 Sep 2021 15:32:19 +0200 Subject: [PATCH] Adds tab completion for the set lore command --- .../bookswithoutborders/command/CommandSetLore.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/knarcraft/bookswithoutborders/command/CommandSetLore.java b/src/main/java/net/knarcraft/bookswithoutborders/command/CommandSetLore.java index 45cfd1f..2f27996 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/command/CommandSetLore.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/command/CommandSetLore.java @@ -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 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 options = new ArrayList<>(); + options.add(""); + return options; + } }