/
ShapelessRecipesWrapper.java
47 lines (37 loc) · 1.13 KB
/
ShapelessRecipesWrapper.java
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
package mezz.jei.plugins.vanilla.crafting;
import javax.annotation.Nonnull;
import java.util.Collections;
import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.ShapelessRecipes;
import mezz.jei.api.recipe.wrapper.ICraftingRecipeWrapper;
import mezz.jei.plugins.vanilla.VanillaRecipeWrapper;
public class ShapelessRecipesWrapper extends VanillaRecipeWrapper implements ICraftingRecipeWrapper {
@Nonnull
private final ShapelessRecipes recipe;
public ShapelessRecipesWrapper(@Nonnull ShapelessRecipes recipe) {
this.recipe = recipe;
for (Object input : this.recipe.recipeItems) {
if (input instanceof ItemStack) {
ItemStack itemStack = (ItemStack) input;
if (itemStack.stackSize > 1) {
itemStack.stackSize = 1;
}
}
}
}
@Nonnull
@Override
public List getInputs() {
return recipe.recipeItems;
}
@Nonnull
@Override
public List<ItemStack> getOutputs() {
return Collections.singletonList(recipe.getRecipeOutput());
}
@Override
public void drawInfo(@Nonnull Minecraft minecraft) {
}
}