@Override
protected boolean isMachineItemValidForSlot(int slot, ItemStack item) {
if(!slotDefinition.isInputSlot(slot)) {
return false;
}
MachineRecipeInput newInput = new MachineRecipeInput(slot, item);
int otherSlot = slot == 0 ? 1 : 0;
if(inventory[otherSlot] == null) {
List<IMachineRecipe> recipes = MachineRecipeRegistry.instance.getRecipesForInput(getMachineName(), newInput);
if(recipes.isEmpty()) {
return false;
}
for(IMachineRecipe rec : recipes) {
if(rec != null && rec.isValidInput(newInput)) {
return true;
}
}
} else {
MachineRecipeInput[] inputs = new MachineRecipeInput[] {
newInput,
new MachineRecipeInput(otherSlot, inventory[otherSlot])
};
return MachineRecipeRegistry.instance.getRecipeForInputs(getMachineName(), inputs) != null;
}
return false;
}