aboutsummaryrefslogtreecommitdiff
path: root/api/src/main/java/me
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2022-07-28 01:39:41 +0800
committershedaniel <daniel@shedaniel.me>2022-08-26 10:52:28 +0900
commit9954713e457a5a5d80025432961b56ab0003bbb0 (patch)
treed26b3a09f824e58edd2ad7df39e6c4f48fcc6bb9 /api/src/main/java/me
parentc85b3d49f6d88e7e92b06bacca1ce93db7b75fd0 (diff)
downloadRoughlyEnoughItems-9954713e457a5a5d80025432961b56ab0003bbb0.tar.gz
RoughlyEnoughItems-9954713e457a5a5d80025432961b56ab0003bbb0.tar.bz2
RoughlyEnoughItems-9954713e457a5a5d80025432961b56ab0003bbb0.zip
More work on config module
Diffstat (limited to 'api/src/main/java/me')
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/client/entry/filtering/FilteringRule.java34
-rw-r--r--api/src/main/java/me/shedaniel/rei/impl/ClientInternals.java9
2 files changed, 43 insertions, 0 deletions
diff --git a/api/src/main/java/me/shedaniel/rei/api/client/entry/filtering/FilteringRule.java b/api/src/main/java/me/shedaniel/rei/api/client/entry/filtering/FilteringRule.java
new file mode 100644
index 000000000..cbc13636e
--- /dev/null
+++ b/api/src/main/java/me/shedaniel/rei/api/client/entry/filtering/FilteringRule.java
@@ -0,0 +1,34 @@
+/*
+ * This file is licensed under the MIT License, part of Roughly Enough Items.
+ * Copyright (c) 2018, 2019, 2020, 2021, 2022 shedaniel
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+package me.shedaniel.rei.api.client.entry.filtering;
+
+import net.fabricmc.api.EnvType;
+import net.fabricmc.api.Environment;
+import org.jetbrains.annotations.ApiStatus;
+
+@ApiStatus.Experimental
+@Environment(EnvType.CLIENT)
+public interface FilteringRule {
+ boolean isManual();
+}
diff --git a/api/src/main/java/me/shedaniel/rei/impl/ClientInternals.java b/api/src/main/java/me/shedaniel/rei/impl/ClientInternals.java
index 60c6399fd..df5e4938e 100644
--- a/api/src/main/java/me/shedaniel/rei/impl/ClientInternals.java
+++ b/api/src/main/java/me/shedaniel/rei/impl/ClientInternals.java
@@ -65,6 +65,7 @@ public final class ClientInternals {
REIClientPlugin.class,
UnaryOperator.identity());
private static final DelegatingFavoriteEntryProvider DELEGATE_FAVORITE_ENTRY = resolveService(DelegatingFavoriteEntryProvider.class);
+ private static final FavoritesEntriesListProvider FAVORITES_ENTRIES_LIST = resolveService(FavoritesEntriesListProvider.class);
private static Function<CompoundTag, DataResult<FavoriteEntry>> favoriteEntryFromJson = (object) -> throwNotSetup();
private static Function<Boolean, ClickArea.Result> clickAreaHandlerResult = (result) -> throwNotSetup();
private static BiConsumer<List<ClientTooltipComponent>, TooltipComponent> clientTooltipComponentProvider = (tooltip, result) -> throwNotSetup();
@@ -154,6 +155,10 @@ public final class ClientInternals {
return DELEGATE_FAVORITE_ENTRY.delegate(supplier, toJoin);
}
+ public static List<FavoriteEntry> getFavoritesEntriesList() {
+ return FAVORITES_ENTRIES_LIST.get();
+ }
+
public static DataResult<FavoriteEntry> favoriteEntryFromJson(CompoundTag tag) {
return favoriteEntryFromJson.apply(tag);
}
@@ -221,4 +226,8 @@ public final class ClientInternals {
public interface DelegatingFavoriteEntryProvider {
FavoriteEntry delegate(Supplier<DataResult<FavoriteEntry>> result, Supplier<CompoundTag> tag);
}
+
+ public interface FavoritesEntriesListProvider {
+ List<FavoriteEntry> get();
+ }
}