diff --git a/src/main/java/com/songoda/epicheads/command/CommandManager.java b/src/main/java/com/songoda/epicheads/command/CommandManager.java index f33f3f7..b6fd70e 100644 --- a/src/main/java/com/songoda/epicheads/command/CommandManager.java +++ b/src/main/java/com/songoda/epicheads/command/CommandManager.java @@ -35,6 +35,7 @@ public class CommandManager implements CommandExecutor { addCommand(new CommandGive(commandEpicHeads)); addCommand(new CommandGiveToken(commandEpicHeads)); addCommand(new CommandAdd(commandEpicHeads)); + addCommand(new CommandSearch(commandEpicHeads)); for (AbstractCommand abstractCommand : commands) { if (abstractCommand.getParent() != null) continue; diff --git a/src/main/java/com/songoda/epicheads/command/commands/CommandSearch.java b/src/main/java/com/songoda/epicheads/command/commands/CommandSearch.java new file mode 100644 index 0000000..ece444f --- /dev/null +++ b/src/main/java/com/songoda/epicheads/command/commands/CommandSearch.java @@ -0,0 +1,49 @@ +package com.songoda.epicheads.command.commands; + +import com.songoda.epicheads.EpicHeads; +import com.songoda.epicheads.command.AbstractCommand; +import com.songoda.epicheads.gui.GUIHeads; +import com.songoda.epicheads.head.Head; +import org.bukkit.Bukkit; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +public class CommandSearch extends AbstractCommand { + + public CommandSearch(AbstractCommand parent) { + super(parent, true, "search"); + } + + @Override + protected ReturnType runCommand(EpicHeads instance, CommandSender sender, String... args) { + + GUIHeads.doSearch((Player)sender); + return ReturnType.SUCCESS; + } + + @Override + protected List onTab(EpicHeads instance, CommandSender sender, String... args) { + return null; + } + + @Override + public String getPermissionNode() { + return "epicheads.search"; + } + + @Override + public String getSyntax() { + return "/heads search"; + } + + @Override + public String getDescription() { + return "Opens a gui displaying your search results."; + } +}