Closed josephcsible closed 6 years ago
AFAIK, stream().map()
doesn't create a lazy-transformed list, so this change will introduce a big performance issue when only subsets of the given list are needed.
I haven't looked into Collections2.transform
yet, but that sounds good to me at the moment. The recipe capability is not included in public releases anyways, so breaking changes are fine.
It looks like Collections2.transform is exactly what we want then, if breaking changes are okay. I'll change this PR to do that tonight.
This now depends on CyclopsMC/CommonCapabilitiesAPI#5.
@josephcsible https://github.com/CyclopsMC/CommonCapabilitiesAPI/pull/5 has been merged, could you update the submodule in this PR as well?
Done.
The change in question is that they're going to start giving you a
Collection<IRecipe>
instead of aList<IRecipe>
. After I made this, I noticed that this now makes an independent list rather than a view that stays up-to-date. If the latter is important, then we'd need to changeIRecipeHandler#getRecipes()
to return aCollection<RecipeDefinition>
instead of aList<RecipeDefinition>
(which would be a breaking change), but then we could just useCollections2.transform
in place ofLists.transform
.