use of crazypants.enderio.base.handler.darksteel.DarkSteelRecipeManager.UpgradePath in project EnderIO by SleepyTrousers.
the class DarkSteelUpgradeRecipeCategory method register.
public static void register(IModRegistry registry) {
long start = System.nanoTime();
registry.addRecipeCatalyst(new ItemStack(blockDarkSteelAnvil.getBlockNN()), VanillaRecipeCategoryUid.ANVIL);
NNList<ItemStack> blacklist = new NNList<>();
for (UpgradePath rec : allRecipes) {
rec.getOutput().getItem().getSubItems(getCreativeTab(rec), blacklist);
}
NNList<ItemStack> seen = new NNList<>();
for (UpgradePath rec : allRecipes) {
if (!inList(blacklist, rec.getOutput()) && !inList(seen, rec.getOutput())) {
seen.add(rec.getOutput());
}
}
int enchantmentRecipes = registerBookEnchantmentRecipes(registry, seen);
final IVanillaRecipeFactory factory = registry.getJeiHelpers().getVanillaRecipeFactory();
Collection<IRecipeWrapper> anvilRecipes = NullHelper.notnullJ(allRecipes.stream().map(rec -> factory.createAnvilRecipe(rec.getInput(), Collections.singletonList(rec.getUpgrade()), Collections.singletonList(rec.getOutput()))).collect(Collectors.toList()), "Stream#collect");
registry.addRecipes(anvilRecipes, VanillaRecipeCategoryUid.ANVIL);
Log.info(String.format("DarkSteelUpgradeRecipeCategory: Added %d dark steel upgrade recipes and %d enchantment recipes for upgradable items to JEI in %.3f seconds.", allRecipes.size(), enchantmentRecipes, (System.nanoTime() - start) / 1000000000d));
}
Aggregations