/** * This class was created by <williewillus>. It's distributed as * part of the Botania Mod. Get the Source Code in github: * https://github.com/Vazkii/Botania * <p/> * Botania is Open Source and distributed under the * Botania License: http://botaniamod.net/license.php */ package vazkii.botania.client.integration.jei.petalapothecary; import java.util.List; import javax.annotation.Nonnull; import com.google.common.collect.ImmutableList; import mezz.jei.api.ingredients.IIngredients; import mezz.jei.api.recipe.IRecipeWrapper; import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; import vazkii.botania.api.recipe.RecipePetals; public class PetalApothecaryRecipeWrapper implements IRecipeWrapper { private final List<List<ItemStack>> input; private final ItemStack output; public PetalApothecaryRecipeWrapper(RecipePetals recipe) { ImmutableList.Builder<List<ItemStack>> builder = ImmutableList.builder(); for(Object o : recipe.getInputs()) { if(o instanceof ItemStack) { builder.add(ImmutableList.of((ItemStack) o)); } if(o instanceof String) { builder.add(OreDictionary.getOres((String) o)); } } input = builder.build(); output = recipe.getOutput(); } @Override public void getIngredients(@Nonnull IIngredients ingredients) { ingredients.setInputLists(ItemStack.class, input); ingredients.setOutput(ItemStack.class, output); } @Override public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) { } @Nonnull @Override public List<String> getTooltipStrings(int mouseX, int mouseY) { return ImmutableList.of(); } @Override public boolean handleClick(@Nonnull Minecraft minecraft, int mouseX, int mouseY, int mouseButton) { return false; } }