From 6ff07fe77b6d15157f262a766798e683e55c2c57 Mon Sep 17 00:00:00 2001 From: shedaniel Date: Mon, 28 Feb 2022 10:05:31 +0800 Subject: Add search caching hint --- .../java/me/shedaniel/rei/api/client/search/SearchFilter.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'api') diff --git a/api/src/main/java/me/shedaniel/rei/api/client/search/SearchFilter.java b/api/src/main/java/me/shedaniel/rei/api/client/search/SearchFilter.java index 2038b7cdb..80b4987df 100644 --- a/api/src/main/java/me/shedaniel/rei/api/client/search/SearchFilter.java +++ b/api/src/main/java/me/shedaniel/rei/api/client/search/SearchFilter.java @@ -27,6 +27,7 @@ import me.shedaniel.rei.api.common.entry.EntryStack; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; +import java.util.Collection; import java.util.function.Predicate; /** @@ -70,4 +71,13 @@ public interface SearchFilter extends Predicate> { * @return the original filter */ String getFilter(); + + /** + * Prepares the following stacks for matching, this could help to speed up the matching process.
+ * However, this is not required. + * + * @param stacks the stacks to prepare + */ + default void prepareFilter(Collection> stacks) { + } } -- cgit