2020-01-27 23:25:59 +01:00
|
|
|
package com.simibubi.create.compat.jei;
|
|
|
|
|
2020-07-10 13:48:59 +02:00
|
|
|
import javax.annotation.ParametersAreNonnullByDefault;
|
|
|
|
|
2020-05-23 14:02:38 +02:00
|
|
|
import com.simibubi.create.AllRecipeTypes;
|
2020-01-27 23:25:59 +01:00
|
|
|
import com.simibubi.create.Create;
|
2020-05-23 14:02:38 +02:00
|
|
|
import com.simibubi.create.content.contraptions.processing.ProcessingRecipe;
|
2020-09-04 01:23:09 +02:00
|
|
|
import com.simibubi.create.content.contraptions.processing.ProcessingRecipeBuilder;
|
|
|
|
import com.simibubi.create.content.contraptions.processing.ProcessingRecipeBuilder.ProcessingRecipeParams;
|
2020-01-27 23:25:59 +01:00
|
|
|
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraft.item.crafting.Ingredient;
|
|
|
|
import net.minecraft.util.ResourceLocation;
|
|
|
|
import net.minecraft.world.World;
|
|
|
|
import net.minecraftforge.items.wrapper.RecipeWrapper;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Helper recipe type for displaying an item relationship in JEI
|
|
|
|
*/
|
2020-07-10 13:48:59 +02:00
|
|
|
@ParametersAreNonnullByDefault
|
2020-01-27 23:25:59 +01:00
|
|
|
public class ConversionRecipe extends ProcessingRecipe<RecipeWrapper> {
|
|
|
|
|
|
|
|
static int counter = 0;
|
|
|
|
|
|
|
|
public static ConversionRecipe create(ItemStack from, ItemStack to) {
|
2020-09-04 01:23:09 +02:00
|
|
|
ResourceLocation recipeId = Create.asResource("conversion_" + counter++);
|
|
|
|
return new ProcessingRecipeBuilder<>(ConversionRecipe::new, recipeId)
|
|
|
|
.withItemIngredients(Ingredient.fromStacks(from))
|
|
|
|
.withSingleItemOutput(to)
|
|
|
|
.build();
|
2020-01-27 23:25:59 +01:00
|
|
|
}
|
|
|
|
|
2020-09-04 01:23:09 +02:00
|
|
|
public ConversionRecipe(ProcessingRecipeParams params) {
|
|
|
|
super(AllRecipeTypes.CONVERSION, params);
|
2020-01-27 23:25:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean matches(RecipeWrapper inv, World worldIn) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2020-09-04 01:23:09 +02:00
|
|
|
@Override
|
|
|
|
protected int getMaxInputCount() {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected int getMaxOutputCount() {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2020-01-27 23:25:59 +01:00
|
|
|
}
|