// Path: src/main/java/com/gmail/jannyboy11/customrecipes/gui/ListRecipesInventoryHolder.java
// public class ListRecipesInventoryHolder implements InventoryHolder {
// 	
// 	private static final int MAX_RECIPES_PER_PAGE = 9 * 5;
// 	
// 	private final List<ItemStack> recipeItems = new ArrayList<>();
// 	private final List<Inventory> pages = new ArrayList<>();
// 	private int pageNr = 0;
// 	
// 	public ListRecipesInventoryHolder(String type, Iterable<? extends ItemStack> items) {
// 		items.forEach(recipeItems::add);
// 		
// 		//fill page inventories
// 		int recipeIndex = 0;
// 		Inventory inventory = null;
// 		do {
// 			int inPageIndex = recipeIndex % MAX_RECIPES_PER_PAGE;
// 			if (inPageIndex == 0) {
// 				inventory = Bukkit.createInventory(this, 54, type + " recipes");
// 				pages.add(inventory);
// 			}
// 			
// 			inventory.setItem(inPageIndex, recipeItems.get(recipeIndex));
// 		} while (++recipeIndex < recipeItems.size());
// 		
// 		//add previous and next buttons where applicable
// 		for (int pageNr = 0; pageNr < pages.size(); pageNr++) {
// 			Inventory page = pages.get(pageNr);
// 			if (pageNr != 0) {
// 				page.setItem(45, ListRecipesListener.previousItem());
// 			}
// 			if (pageNr != pages.size() - 1) {
// 				page.setItem(53, ListRecipesListener.nextItem());
// 			}
// 		}
// 	}
// 
// 	@Override
// 	public Inventory getInventory() {
// 		return pages.get(pageNr);
// 	}
// 
// 	public void nextPage() {
// 		this.pageNr = Math.min(pageNr + 1, pages.size());
// 	}
// 
// 	public void previousPage() {
// 		this.pageNr = Math.max(pageNr - 1, 0);
// 	}
// 
// }


import java.util.List;
import java.util.Map;
import java.util.function.BiConsumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.Recipe;
import com.gmail.jannyboy11.customrecipes.gui.ListRecipesInventoryHolder;
package com.gmail.jannyboy11.customrecipes.commands;




public class ListRecipesCommandExecutor implements CommandExecutor {
	
	private final Function<String, ? extends List<? extends Recipe>> recipesByTypeMapper;
	private final Map<String, Function<? super Recipe, ? extends ItemStack>> recipeToItemMap;
	private final Map<String, BiConsumer<? super Recipe, ? super CommandSender>> recipeToCommandSenderDiplayMap;
	
	public ListRecipesCommandExecutor(Function<String, ? extends List<? extends Recipe>> recipesByTypeMapper,
			Map<String, Function<? super Recipe, ? extends ItemStack>> recipeToItemMap,
			Map<String, BiConsumer<? super Recipe, ? super CommandSender>> recipeToCommandSenderDiplayMap) {
		this.recipesByTypeMapper = recipesByTypeMapper;
		this.recipeToItemMap = recipeToItemMap;
		this.recipeToCommandSenderDiplayMap = recipeToCommandSenderDiplayMap;
	}
	
// Path: src/main/java/com/gmail/jannyboy11/customrecipes/gui/ListRecipesInventoryHolder.java
// public class ListRecipesInventoryHolder implements InventoryHolder {
// 	
// 	private static final int MAX_RECIPES_PER_PAGE = 9 * 5;
// 	
// 	private final List<ItemStack> recipeItems = new ArrayList<>();
// 	private final List<Inventory> pages = new ArrayList<>();
// 	private int pageNr = 0;
// 	
// 	public ListRecipesInventoryHolder(String type, Iterable<? extends ItemStack> items) {
// 		items.forEach(recipeItems::add);
// 		
// 		//fill page inventories
// 		int recipeIndex = 0;
// 		Inventory inventory = null;
// 		do {
// 			int inPageIndex = recipeIndex % MAX_RECIPES_PER_PAGE;
// 			if (inPageIndex == 0) {
// 				inventory = Bukkit.createInventory(this, 54, type + " recipes");
// 				pages.add(inventory);
// 			}
// 			
// 			inventory.setItem(inPageIndex, recipeItems.get(recipeIndex));
// 		} while (++recipeIndex < recipeItems.size());
// 		
// 		//add previous and next buttons where applicable
// 		for (int pageNr = 0; pageNr < pages.size(); pageNr++) {
// 			Inventory page = pages.get(pageNr);
// 			if (pageNr != 0) {
// 				page.setItem(45, ListRecipesListener.previousItem());
// 			}
// 			if (pageNr != pages.size() - 1) {
// 				page.setItem(53, ListRecipesListener.nextItem());
// 			}
// 		}
// 	}
// 
// 	@Override
// 	public Inventory getInventory() {
// 		return pages.get(pageNr);
// 	}
// 
// 	public void nextPage() {
// 		this.pageNr = Math.min(pageNr + 1, pages.size());
// 	}
// 
// 	public void previousPage() {
// 		this.pageNr = Math.max(pageNr - 1, 0);
// 	}
// 
// }


// Path: src/main/java/com/gmail/jannyboy11/customrecipes/commands/ListRecipesCommandExecutor.java
import java.util.List;
import java.util.Map;
import java.util.function.BiConsumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.Recipe;
import com.gmail.jannyboy11.customrecipes.gui.ListRecipesInventoryHolder;

package com.gmail.jannyboy11.customrecipes.commands;




public class ListRecipesCommandExecutor implements CommandExecutor {
	
	private final Function<String, ? extends List<? extends Recipe>> recipesByTypeMapper;
	private final Map<String, Function<? super Recipe, ? extends ItemStack>> recipeToItemMap;
	private final Map<String, BiConsumer<? super Recipe, ? super CommandSender>> recipeToCommandSenderDiplayMap;
	
	public ListRecipesCommandExecutor(Function<String, ? extends List<? extends Recipe>> recipesByTypeMapper,
			Map<String, Function<? super Recipe, ? extends ItemStack>> recipeToItemMap,
			Map<String, BiConsumer<? super Recipe, ? super CommandSender>> recipeToCommandSenderDiplayMap) {
		this.recipesByTypeMapper = recipesByTypeMapper;
		this.recipeToItemMap = recipeToItemMap;
		this.recipeToCommandSenderDiplayMap = recipeToCommandSenderDiplayMap;
	}
	
	@Override