diff options
| author | Unknown <shekwancheung0528@gmail.com> | 2018-12-30 20:10:36 +0800 |
|---|---|---|
| committer | Unknown <shekwancheung0528@gmail.com> | 2018-12-30 20:10:36 +0800 |
| commit | 3e1f4333a51513b440b32adfe9b698590fbf76f5 (patch) | |
| tree | cf337b4e12df85cd30d25721bab6c1ba1f4591f8 /src/main/java/me/shedaniel/plugin/potion/VanillaPotionRecipe.java | |
| parent | 814e2e94ad643f04576ab0569c4b94f96b275f51 (diff) | |
| download | RoughlyEnoughItems-3e1f4333a51513b440b32adfe9b698590fbf76f5.tar.gz RoughlyEnoughItems-3e1f4333a51513b440b32adfe9b698590fbf76f5.tar.bz2 RoughlyEnoughItems-3e1f4333a51513b440b32adfe9b698590fbf76f5.zip | |
Better stuff
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; + } +} |
