public static void addCrucibleRecipeBookEntryViaXML( String id, String desc, String category, CrucibleRecipe ir, MathExpression cost, int row, int col, Class root, String path) { ItemStack out = ir.getRecipeOutput(); AspectList aspects = new AspectList(); for (Aspect a : ir.aspects.aspects.keySet()) { aspects.add(a, Math.max(1, (int) (cost.evaluate(ir.aspects.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(); }
/** @param recipe an alchemy crafting recipe. */ public ResearchPage(CrucibleRecipe recipe) { this.type = PageType.CRUCIBLE_CRAFTING; this.recipe = recipe; this.recipeOutput = recipe.getRecipeOutput(); }