2019-06-22 19:21:57 -07:00

26 lines
836 B
Java

package com.gmail.nossr50.skills.repair;
import com.gmail.nossr50.datatypes.items.ItemMatch;
import org.bukkit.inventory.PlayerInventory;
/**
* Represents one item in a Repair Transaction
*/
public interface RepairCost<T extends ItemMatch<?>> {
/**
* Searches a player inventory for a matching ItemStack that can be used to pay for the repair transaction
* @param playerInventory inventory of player attempting to pay the cost
* @return any compatible payment items if found, can be null
*/
T findPayment(PlayerInventory playerInventory);
/**
* Whether or not there is an item that can be used for this repair cost in the player's inventory
* @param playerInventory target player
* @return true if payment is found
*/
boolean hasPayment(PlayerInventory playerInventory);
}