aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/plugin/DefaultShapedDisplay.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/me/shedaniel/rei/plugin/DefaultShapedDisplay.java')
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultShapedDisplay.java45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/main/java/me/shedaniel/rei/plugin/DefaultShapedDisplay.java b/src/main/java/me/shedaniel/rei/plugin/DefaultShapedDisplay.java
new file mode 100644
index 000000000..5bf5586c5
--- /dev/null
+++ b/src/main/java/me/shedaniel/rei/plugin/DefaultShapedDisplay.java
@@ -0,0 +1,45 @@
+package me.shedaniel.rei.plugin;
+
+import com.google.common.collect.Lists;
+import net.minecraft.item.ItemStack;
+import net.minecraft.recipe.crafting.ShapedRecipe;
+
+import java.util.Arrays;
+import java.util.List;
+
+public class DefaultShapedDisplay implements DefaultCraftingDisplay<ShapedRecipe> {
+
+ private ShapedRecipe display;
+ private List<List<ItemStack>> input;
+ private List<ItemStack> output;
+
+ public DefaultShapedDisplay(ShapedRecipe recipe) {
+ this.display = recipe;
+ this.input = Lists.newArrayList();
+ recipe.getPreviewInputs().forEach(ingredient -> {
+ input.add(Arrays.asList(ingredient.getStackArray()));
+ });
+ this.output = Arrays.asList(recipe.getOutput());
+ }
+
+ @Override
+ public ShapedRecipe getRecipe() {
+ return display;
+ }
+
+ @Override
+ public List<List<ItemStack>> getInput() {
+ return input;
+ }
+
+ @Override
+ public List<ItemStack> getOutput() {
+ return output;
+ }
+
+ @Override
+ public List<List<ItemStack>> getRequiredItems() {
+ return input;
+ }
+
+}