mirror of
https://github.com/songoda/EpicHeads.git
synced 2024-11-25 20:16:14 +01:00
Added a search command.
This commit is contained in:
parent
3641097d6e
commit
6f81b6886b
@ -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;
|
||||
|
@ -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<String> 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.";
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user