diff options
Diffstat (limited to 'src/main/java/me/shedaniel/plugin/potion/VanillaPotionRecipe.java')
| -rwxr-xr-x | src/main/java/me/shedaniel/plugin/potion/VanillaPotionRecipe.java | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/main/java/me/shedaniel/plugin/potion/VanillaPotionRecipe.java b/src/main/java/me/shedaniel/plugin/potion/VanillaPotionRecipe.java new file mode 100755 index 000000000..3f4592a90 --- /dev/null +++ b/src/main/java/me/shedaniel/plugin/potion/VanillaPotionRecipe.java @@ -0,0 +1,48 @@ +package me.shedaniel.plugin.potion; + +import me.shedaniel.api.IRecipe; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; + +public class VanillaPotionRecipe implements IRecipe<ItemStack> { + + private ItemStack[] input, reactWith, output; + + @Override + public String getId() { + return "potion"; + } + + public VanillaPotionRecipe(ItemStack[] input, ItemStack[] reactWith, ItemStack[] output) { + this.input = input; + this.reactWith = reactWith; + this.output = output; + } + + @Override + public List<ItemStack> getOutput() { + return Arrays.asList(output); + } + + @Override + public List<List<ItemStack>> getInput() { + List<List<ItemStack>> input = new LinkedList<>(); + input.add(new ArrayList<>(Arrays.asList(this.input))); + input.add(new ArrayList<>(Arrays.asList(this.reactWith))); + return input; + } + + 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; + } +} |
