package me.shedaniel.plugin.smoker; import me.shedaniel.api.IRecipe; import net.minecraft.block.entity.SmokerBlockEntity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.recipe.Ingredient; import net.minecraft.recipe.smelting.SmokingRecipe; import java.util.*; import java.util.stream.Collectors; public class VanillaSmokerRecipe implements IRecipe { private final SmokingRecipe recipe; @Override public String getId() { return "smoker"; } public VanillaSmokerRecipe(SmokingRecipe recipe) { this.recipe = recipe; } @Override public List getOutput() { List output = new LinkedList<>(); output.add(recipe.getOutput().copy()); return output; } @Override public List> getInput() { List> input = new LinkedList<>(); for(Ingredient ingredient : recipe.getPreviewInputs()) { List ingredients = Arrays.asList(ingredient.getStackArray()); input.add(ingredients); } input.add(SmokerBlockEntity.createBurnableMap().keySet().stream().map(Item::getDefaultStack).collect(Collectors.toList())); return input; } @Override public List> getRecipeRequiredInput() { List> input = new LinkedList<>(); for(Ingredient ingredient : recipe.getPreviewInputs()) Collections.addAll(input, new LinkedList<>(Arrays.asList(ingredient.getStackArray()))); return input; } public SmokingRecipe getRecipe() { return recipe; } }