public static void addArcaneRecipeBookEntryViaXML( String id, String desc, String category, IArcaneRecipe ir, MathExpression cost, int row, int col, Class root, String path) { ItemStack out = 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(); }
/** @param recipe an arcane worktable crafting recipe. */ public ResearchPage(IArcaneRecipe recipe) { this.type = PageType.ARCANE_CRAFTING; this.recipe = recipe; this.recipeOutput = recipe.getRecipeOutput(); }