blob: 2a640178bf0dfe050b6fb19d38a3edeeb5f36fd8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
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<ItemStack> {
private final SmokingRecipe recipe;
@Override
public String getId() {
return "smoker";
}
public VanillaSmokerRecipe(SmokingRecipe recipe) {
this.recipe = recipe;
}
@Override
public List<ItemStack> getOutput() {
List<ItemStack> output = new LinkedList<>();
output.add(recipe.getOutput().copy());
return output;
}
@Override
public List<List<ItemStack>> getInput() {
List<List<ItemStack>> input = new LinkedList<>();
for(Ingredient ingredient : recipe.getPreviewInputs()) {
List<ItemStack> 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<List<ItemStack>> getRecipeRequiredInput() {
List<List<ItemStack>> input = new LinkedList<>();
for(Ingredient ingredient : recipe.getPreviewInputs())
Collections.addAll(input, new LinkedList<>(Arrays.asList(ingredient.getStackArray())));
return input;
}
public SmokingRecipe getRecipe() {
return recipe;
}
}
|