Added maxmimum size to recipes cache

This commit is contained in:
Auxilor
2022-03-03 14:52:29 +00:00
parent cf0d725189
commit 7e4b3075ed

View File

@@ -31,6 +31,7 @@ public final class Recipes {
* Cached recipes from matrix.
*/
private static final LoadingCache<ItemStack[], Optional<CraftingRecipe>> RECIPES_FROM_MATRIX = Caffeine.newBuilder()
.maximumSize(2048L)
.build(
matrix -> RECIPES.values().stream().filter(recipe -> recipe.test(matrix)).findFirst()
);