package com.yutian.minerwar.util;

import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.MerchantRecipe;

import java.util.Arrays;

public class MerchantRecipeUtil {

    public static MerchantRecipe buildMerchantRecipe(Material material, int amount, int price) {
        MerchantRecipe merchantRecipe = new MerchantRecipe(new ItemStack(material, amount), Integer.MAX_VALUE);
        merchantRecipe.setIngredients(Arrays.asList(new ItemStack(Material.RAW_GOLD, price)));
        return merchantRecipe;
    }

    public static MerchantRecipe buildMerchantRecipe(ItemStack itemStack, int price) {
        MerchantRecipe merchantRecipe = new MerchantRecipe(itemStack, Integer.MAX_VALUE);
        merchantRecipe.setIngredients(Arrays.asList(new ItemStack(Material.RAW_GOLD, price)));
        return merchantRecipe;
    }

}
