diff options
Diffstat (limited to 'src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingDisplay.java')
| -rw-r--r-- | src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingDisplay.java | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingDisplay.java b/src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingDisplay.java new file mode 100644 index 000000000..4b30f0200 --- /dev/null +++ b/src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingDisplay.java @@ -0,0 +1,60 @@ +/* + * Roughly Enough Items by Danielshe. + * Licensed under the MIT License. + */ + +package me.shedaniel.rei.plugin.brewing; + +import com.google.common.collect.Lists; +import me.shedaniel.rei.api.RecipeDisplay; +import me.shedaniel.rei.plugin.DefaultPlugin; +import net.minecraft.block.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.recipe.Ingredient; +import net.minecraft.util.Identifier; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +public class DefaultBrewingDisplay implements RecipeDisplay { + + private ItemStack input, output; + private Ingredient reactant; + + public DefaultBrewingDisplay(ItemStack input, Ingredient reactant, ItemStack output) { + this.input = input; + this.reactant = reactant; + this.output = output; + } + + @Override + public List<List<ItemStack>> getInput() { + return Lists.newArrayList(Collections.singletonList(input), Arrays.asList(reactant.getStackArray())); + } + + @Override + public List<ItemStack> getOutput() { + return Collections.singletonList(output); + } + + @Override + public Identifier getRecipeCategory() { + return DefaultPlugin.BREWING; + } + + public List<ItemStack> getOutput(int slot) { + List<ItemStack> stack = new ArrayList<>(); + for(int i = 0; i < slot * 2; i++) + stack.add(new ItemStack(Blocks.AIR)); + for(int i = 0; i < 6 - slot * 2; i++) + stack.addAll(getOutput()); + return stack; + } + + @Override + public List<List<ItemStack>> getRequiredItems() { + return Collections.singletonList(Collections.singletonList(ItemStack.EMPTY)); + } +} |
