/** @param recipe an infusion crafting recipe. */ public ResearchPage(InfusionRecipe recipe) { this.type = PageType.INFUSION_CRAFTING; this.recipe = recipe; if (recipe.getRecipeOutput() instanceof ItemStack) { this.recipeOutput = (ItemStack) recipe.getRecipeOutput(); } else { this.recipeOutput = recipe.getRecipeInput(); } }
public static void addInfusionRecipeBookEntryViaXML( String id, String desc, String category, InfusionRecipe ir, MathExpression cost, int row, int col, Class root, String path) { ItemStack out = (ItemStack) ir.getRecipeOutput(); AspectList aspects = new AspectList(); for (Aspect a : ir.getAspects().aspects.keySet()) { aspects.add(a, Math.max(1, (int) (cost.evaluate(ir.getAspects().getAmount(a))))); } String name = out.getDisplayName(); CustomThaumResearch res = new CustomThaumResearch(id, category, aspects, col, row, 0, out).setName(name); res.setDescription(desc); XMLResearch xml = new XMLResearch(id.toLowerCase(Locale.ENGLISH), root, path, ir, 2); res.setPages(xml.getPages()); res.registerResearchItem(); }