aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/api/subsets/SubsetsRegistry.java
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2020-04-01 20:01:34 +0800
committershedaniel <daniel@shedaniel.me>2020-04-01 20:01:34 +0800
commit66abc317e5fc36a397ca1cc919e388fbe143956b (patch)
tree915cc4799d89297b8d4bd2dbe1046c177f4d1627 /src/main/java/me/shedaniel/rei/api/subsets/SubsetsRegistry.java
parent3919ec1e15d6eb9a8aa4564bb2d4e4dfdbeb54e3 (diff)
downloadRoughlyEnoughItems-66abc317e5fc36a397ca1cc919e388fbe143956b.tar.gz
RoughlyEnoughItems-66abc317e5fc36a397ca1cc919e388fbe143956b.tar.bz2
RoughlyEnoughItems-66abc317e5fc36a397ca1cc919e388fbe143956b.zip
ScrollingContainer & SubsetsMenu && 20w18b
Signed-off-by: shedaniel <daniel@shedaniel.me>
Diffstat (limited to 'src/main/java/me/shedaniel/rei/api/subsets/SubsetsRegistry.java')
-rw-r--r--src/main/java/me/shedaniel/rei/api/subsets/SubsetsRegistry.java40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/main/java/me/shedaniel/rei/api/subsets/SubsetsRegistry.java b/src/main/java/me/shedaniel/rei/api/subsets/SubsetsRegistry.java
new file mode 100644
index 000000000..3c7e46304
--- /dev/null
+++ b/src/main/java/me/shedaniel/rei/api/subsets/SubsetsRegistry.java
@@ -0,0 +1,40 @@
+package me.shedaniel.rei.api.subsets;
+
+import me.shedaniel.rei.api.EntryStack;
+import me.shedaniel.rei.impl.subsets.SubsetsRegistryImpl;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+
+@ApiStatus.Experimental
+public interface SubsetsRegistry {
+ SubsetsRegistry INSTANCE = new SubsetsRegistryImpl();
+
+ /**
+ * Gets all paths an entry is in, note that this is a really slow call as it looks through all paths.
+ */
+ @NotNull
+ List<String> getEntryPaths(@NotNull EntryStack stack);
+
+ @Nullable
+ Set<EntryStack> getPathEntries(@NotNull String path);
+
+ @NotNull
+ Set<EntryStack> getOrCreatePathEntries(@NotNull String path);
+
+ @NotNull
+ Set<String> getPaths();
+
+ void registerPathEntry(@NotNull String path, @NotNull EntryStack stack);
+
+ void registerPathEntries(@NotNull String path, @NotNull Collection<EntryStack> stacks);
+
+ default void registerPathEntries(@NotNull String path, @NotNull EntryStack... stacks) {
+ registerPathEntries(path, Arrays.asList(stacks));
+ }
+}